# load additional library
library(ggplot2) # for further customization of the plots
# run spec analysis
results <- run_specs(example_data,
y = c("y1", "y2"),
x = c("x1", "x2"),
model = "lm",
controls = c("c1", "c2"),
subset = list(group1 = unique(example_data$group1)))
# plot results directly
plot_specs(results)
# Customize each part and then combine
p1 <- plot_curve(results) +
geom_hline(yintercept = 0, linetype = "dashed", color = "grey") +
ylim(-3, 12) +
labs(x = "", y = "regression coefficient")
p2 <- plot_choices(results) +
labs(x = "specifications (ranked)")
plot_specs(plot_a = p1, # arguments must be called directly!
plot_b = p2,
rel_height = c(2, 2))
Run the code above in your browser using DataLab