# Simulate 8 studies with true effect = -0.4, varying sample sizes and heterogeneity
studies <- tibble(
study = paste0("Study ", 1:8),
n = c(50, 120, 80, 200, 45, 300, 90, 150),
effect = c(-0.6, -0.35, -0.55, -0.38, -0.22, -0.41, -0.70, -0.30),
se = sqrt(0.5 / n)
) |> mutate(
lo = effect - 1.96*se,
hi = effect + 1.96*se
)
ggplot(studies, aes(x=effect, y=reorder(study, effect))) +
geom_point(aes(size=n), color="#0891b2") +
geom_errorbarh(aes(xmin=lo, xmax=hi), height=0.25, color="#e2e8f0", linewidth=0.8) +
geom_vline(xintercept=0, linetype=2, color="#e63946") +
geom_vline(xintercept=-0.4, linetype=3, color="#22d3ee") +
scale_size_continuous(range=c(2,7)) +
labs(title="Eight studies — same question, different answers. Which do we believe?",
x="Effect estimate (95% CI)", y=NULL, size="Sample n") + theme_di()