StatsCapybara · Cheat sheet
Assumption Checks
What each test assumes, how to check it, and the fix when it's violated. Plot first, test second.
① t-tests & ANOVA · comparing means
| Assumption (how to check) | If it's violated | § |
|---|---|---|
| Normality · Q–Q plot; Shapiro–Wilk at small n | Non-parametric (Mann–Whitney / Kruskal–Wallis), or transform. Robust when n is large. | 2.5 |
| Equal variances · Levene's test; compare boxplot spreads | Use Welch's t / Welch's ANOVA — don't pool the variances. | 1.12 |
| Independence · by design; no hidden clustering | Model the structure: paired / RM-ANOVA / mixed model. | 4.5 |
| Sphericity · RM-ANOVA only; Mauchly's test | Greenhouse–Geisser / Huynh–Feldt correction, or a mixed model. | 2.4 |
② Correlation & regression
| Assumption (how to check) | If it's violated | § |
|---|---|---|
| Linearity · scatterplot; residuals-vs-fitted | Transform, add a polynomial term, or use Spearman ρ. | 2.10 |
| Normal residuals · Q–Q plot of the residuals | Usually fine at large n; transform y; bootstrap the CIs. | 3.8 |
| Constant variance · residuals-vs-fitted; a funnel = bad | Robust (HC) SEs, transform y, or weighted least squares. | 2.10 |
| No influential points · Cook's distance; leverage | Investigate it; report with & without; robust regression. | 2.10 |
| Low multicollinearity · VIF (worry > 10) | Drop or combine predictors; ridge / lasso. | 3.2 |
③ Chi-square · counts
| Assumption (how to check) | If it's violated | § |
|---|---|---|
| Expected counts ≥ 5 · read the expected-count table (~80% of cells) | Fisher's exact test (small / 2×2), or merge sparse categories. | 2.7 |
| Independence · each case in exactly one cell | McNemar's test for paired / repeated data. | 2.7 |
The order of operations
Look before you test. A Q–Q plot, a residual plot and a boxplot tell you more than a p-value for the assumption ever will.
Sample size flips the risk. Assumption tests are themselves too weak at small n and too twitchy at large n. And by the CLT, mean-comparison tests are robust to non-normality when n is large — it's the small samples where violations bite.
A violation is a fork, not a wall. It tells you which method to switch to — never a reason to look away and report the broken test anyway.