Confidence Intervals and Test Assumptions › Test Assumptions: The Foundation of Valid Inference
Machine Learning from ScratchAll chapters Confidence Intervals and Test Assumptions › Test Assumptions: The Foundation of Valid InferenceOne section · Sections in this chapter4 / 9 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Every statistical test is built on assumptions. When these assumptions hold, the test does what it claims: it controls the Type I error rate at the specified level and has known power properties. When assumptions are violated, these guarantees may break down.
Understanding assumptions isn't about rigidly checking boxes. It's about understanding when violations matter, when they don't, and what alternatives exist.
Assumption 1: Independence
Independence is the most important assumption and the one most commonly violated without recognition.
What independence means: Each observation provides unique information. The value of one observation doesn't tell you anything about another observation's value.
Why it matters: Statistical tests calculate standard errors assuming each observation contributes independent information. When observations are correlated, the effective sample size is smaller than the actual sample size. The test "thinks" it has more information than it does, leading to standard errors that are too small, test statistics that are too large, and p-values that are too small.
Common violations:


The consequences: If you analyze repeated measures as if they were independent, your standard errors will be too small (often dramatically so), your p-values will be too small, and you'll make many more false positive claims than you think. A study that appears to have n=100 might effectively have n=10 if each of 10 subjects contributes 10 correlated measurements.
Solutions: Use methods designed for your data structure:
- Repeated measures: paired t-tests, repeated measures ANOVA, mixed-effects models
- Clustered data: cluster-robust standard errors, mixed-effects models
- Time series: ARIMA models, autocorrelation-corrected standard errors
Assumption 2: Normality
Many tests assume the data (or the sampling distribution of a statistic) is normally distributed.
What normality means: The t-test and z-test assume that the sampling distribution of the mean is normal. For small samples, this requires the population itself to be approximately normal. For large samples, the Central Limit Theorem saves us.
The Central Limit Theorem: This remarkable theorem states that the sampling distribution of the mean approaches normality as sample size increases, regardless of the population distribution. This is why t-tests work even when individual observations aren't normal.

How fast does the CLT work? It depends on the population distribution:
| Population Distribution | Sample Size Needed for Approximate Normality |
|---|---|
| Already normal | Any n works |
| Symmetric, light tails | n ≥ 10 usually sufficient |
| Moderately skewed | n ≥ 30 is a common guideline |
| Heavily skewed | n ≥ 50 to 100 may be needed |
| Very heavy tails | n ≥ 100+ may be needed |
When normality matters most: For small samples (n < 20 or so), the shape of the population distribution affects test validity. Severe skewness or outliers can inflate or deflate Type I error rates.
Checking normality: Use histograms and Q-Q plots to visually assess normality. Q-Q plots compare your data quantiles to theoretical normal quantiles. Points should fall roughly on a straight line if the data are normal.



Assumption 3: Equal Variances (Homoscedasticity)
Two-sample t-tests can assume equal variances in both groups (pooled t-test) or allow unequal variances (Welch's t-test).
Why equal variances matter for the pooled test: The pooled t-test combines variance estimates from both groups to get a single "pooled" variance:
This pooling is only valid if both groups truly have the same variance. When variances differ, the pooled estimate doesn't accurately represent either group.
What happens when variances differ: The consequences depend on the relationship between variance and sample size:
- If the group with larger variance has smaller n: Type I error is inflated (you reject too often)
- If the group with larger variance has larger n: Type I error is deflated (you reject too rarely)
- If sample sizes are equal: Effects are minimal

The solution: Welch's t-test: Welch's t-test doesn't assume equal variances. It calculates standard errors separately for each group and uses a modified degrees of freedom (the Welch-Satterthwaite approximation).
The key insight is that Welch's test is nearly as powerful as the pooled test when variances ARE equal, but much more accurate when they're not. This asymmetry makes Welch's test the recommended default.