# Setup up specifications (returns object of class "specr.setup")
specs <- setup(data = example_data,
y = c("y1", "y2"),
x = c("x1", "x2"),
model = "lm",
controls = c("c1", "c2"),
subsets = list(group1 = unique(example_data$group1)))
# Run analysis (returns object of class "specr.object")
results <- specr(specs)
# Default summary of the "specr.object"
summary(results)
# Summarize the specification curve descriptively
summary(results, type = "curve")
# Grouping for certain analytical decisions
summary(results,
type = "curve",
group = c("x", "y"))
# Using customized functions
summary(results,
type = "curve",
group = c("x", "group1"),
stats = list(median = median,
min = min,
max = max))
Run the code above in your browser using DataLab