The T-Test › Summary
Michael BrenndoerferJanuary 3, 20261 min read
Machine Learning from ScratchAll chapters Part 2 of 9Hypothesis Testing
The T-Test › SummaryOne section · Sections in this chapter9 / 11 ↓
Sections in this chapter11
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
The t-test is the fundamental tool for comparing means when population variance is unknown, which is nearly always. Key takeaways:
The t-distribution:
- Accounts for uncertainty from estimating variance
- Has heavier tails than the normal distribution
- Converges to normal as degrees of freedom increase
- Requires larger critical values for small samples
One-sample t-test:
- Compares sample mean to hypothesized value
- Test statistic:
- Degrees of freedom:
Two-sample t-test:
- Compares means from two independent groups
- Pooled variant assumes equal variances
- Welch's variant (recommended default) handles unequal variances
- Degrees of freedom differ between variants
Paired t-test:
- For matched pairs or repeated measures
- Analyzes within-pair differences
- Often more powerful than independent tests by eliminating between-subject variability
Assumptions:
- Independence (critical, design-based)
- Normality (less restrictive for large samples)
- Equal variances (pooled test only; avoid by using Welch's)
When in doubt: Use Welch's t-test for two-sample comparisons. You sacrifice minimal power when variances are equal but avoid the equal-variance assumption when they differ.