# Statistics Lab / ferdo — synthetic data (no real student records)
# Save stats_synthetic.csv in your working directory.
d <- read.csv("stats_synthetic.csv", stringsAsFactors = TRUE)
stopifnot(nrow(d) == 36, all(c("score_pre","score_post","group") %in% names(d)))
# Groups are observational labels: differences cannot establish a treatment effect.

set.seed(2026)
null_means <- replicate(5000, mean(rnorm(20, mean=0, sd=1)))
observed <- .5
mean(abs(null_means) >= abs(observed))
hist(null_means, main="Simulated null sampling distribution")
abline(v=c(-observed,observed), lty=2)
