# 1) Independent t-test (two groups)
t.test(score ~ group, data = df, var.equal = FALSE)  # Welch by default if var.equal=FALSE

# 2) Mann-Whitney U (Wilcoxon rank-sum)
wilcox.test(score ~ group, data = df)

# 3) Paired t-test (before/after)
t.test(after, before, paired = TRUE, data = df)

# 4) Wilcoxon signed-rank (paired nonparam)
wilcox.test(after, before, paired = TRUE)

# 5) One-way ANOVA
res.aov <- aov(score ~ group, data = df); summary(res.aov)
TukeyHSD(res.aov)   # pairwise post-hoc

# 6) Kruskal-Wallis
kruskal.test(score ~ group, data = df)
pairwise.wilcox.test(df$score, df$group, p.adjust.method = "BH")

# 7) Pearson/Spearman correlation
cor.test(df$x, df$y, method = "pearson")
cor.test(df$x, df$y, method = "spearman")

# 8) Chi-square test (two categorical variables)
tbl <- table(df$cat1, df$cat2)
chisq.test(tbl)

# 9) Fisher exact (small samples)
fisher.test(tbl)

# 10) Linear regression
mod <- lm(score ~ age + treatment, data = df); summary(mod)

# 11) Logistic regression (binary outcome)
mod_logit <- glm(outcome ~ age + predictor, data = df, family = binomial); summary(mod_logit)