# 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.

d <- read.csv("stats_synthetic.csv")
t.test(d$score_post, d$score_pre, paired=TRUE)
ab <- subset(d, group %in% c("A","B"))
t.test(score_post ~ group, data=ab) # Welch by default
# Neither observational contrast establishes causality.
