Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Comparing fairly
Two robot controllers are timed on a course. Controller B is faster by 1 second on average, but times vary by ±5 seconds from course to course. Is B really better, or did it get lucky?
Test both on the same courses and compare course by course. The course-to-course variation cancels, and even a small advantage stands out. That’s the idea behind the paired t-test. The family of tests on this page answers “is this difference real?” for means (t-tests), for several groups at once (ANOVA), and for counts (χ² tests).
Comparing a new algorithm with the baseline, checking whether failure types depend on the test site, or deciding whether three suppliers’ parts differ: these are the most common statistical questions in engineering, and these tests answer them.
- 1. Testing both controllers on the same courses lets you…
- 2. A test for 'do these counts fit the expected pattern?' is a…
- 3. To compare the means of 4 groups at once, use…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.t-tests
- One-sample: on df.
- Paired: take the differences and run a one-sample test of .
- Two-sample (Welch): , with Welch–Satterthwaite df . Prefer Welch over the “equal-variance” Student test. It costs almost nothing when the variances are equal and protects you when they aren’t.
χ² tests for counts
- Goodness of fit: on (categories − 1 − fitted parameters) df. For example, is a die fair?
- Independence in an table: , with df.
- Rule of thumb: expected counts . Otherwise use exact tests (Fisher).
One-way ANOVA
For groups and observations, , and on df. A large means the groups differ by more than the within-group noise explains.
- 1. A paired t-test is a one-sample t-test on…
- 2. Degrees of freedom for independence in a 3 × 4 table?
- 3. ANOVA's F compares…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.Where the p-values come from
- Student’s t: , via the regularized incomplete beta function (A5.1-6).
- F distribution: .
- χ²: , the regularized upper incomplete gamma function.
Exercise 1 implements all three, plus the tests themselves.
Designing for power: pairing and blocking
If two controllers run on the same courses with course variance and residual variance , then
- the unpaired difference has variance ;
- the paired difference has variance .
When , pairing can multiply the effective sample size many times over. With more than two treatments, the same idea is the randomized complete block design: , and you test treatments against the error mean square on df.
Assumptions, and what to do when they fail
- Independence: the most important assumption, and the one no test can fix.
- Normality: for t and ANOVA, the CLT helps for moderate n. Skewed small samples call for rank tests (A5.1-9) or the bootstrap (A5.1-11).
- Equal variances: use Welch’s t and Welch’s ANOVA.
- χ²: expected counts not too small.
- 1. Pairing helps most when the shared (course) variance is…
- 2. χ² tests need expected counts of at least about…
- 3. With unequal variances, prefer…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Why F follows an F distribution
Under (all means equal, normal errors, common ):
- Within-group part. , a sum of within-group terms (A5.1-2).
- Between-group part. : the group means are normal, and projecting out the grand mean removes one degree of freedom.
- Independence. The two are independent, as orthogonal projections of a Gaussian vector (Cochran’s theorem).
- Conclude. The ratio of independent variables, each divided by its df, is . ∎
With , for the equal-variance t-test.
Why Pearson’s X² is χ²
Counts are multinomial with . By the multivariate CLT, is approximately Gaussian, with covariance , a projection of rank . So . Each estimated parameter removes one more degree of freedom. is also the second-order expansion of the likelihood-ratio statistic .
After ANOVA: which groups differ?
A significant F says “not all equal”, not which. Use post-hoc comparisons with multiplicity control: Tukey’s HSD, or Holm/Bonferroni-corrected pairwise tests (A5.1-10).
Exercise 3.1: Show that SST = SS_B + SS_W
. The cross term is , because within-group deviations sum to zero.
- 1. For two groups, ANOVA's F equals…
- 2. The independence of SS_B and SS_W follows from…
- 3. Pearson's X² approximates which statistic?
Level 4: Expert
★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.Comparing controllers across terrain: blocking
Three controller variants are each timed on the same 12 terrain courses. The courses differ by tens of seconds, while the controllers differ by 3–6 s. A one-way ANOVA that ignores the courses lumps the course variation into “noise” and finds nothing (p ≈ 0.7). The blocked analysis removes the course effect first and finds the difference decisively (p ≈ 2·10⁻⁵), with a correct false-alarm rate under the null. Benchmarking planners on the same maps, learning algorithms on the same seeds and data splits, or hardware on the same units are all blocking. Analysing them as independent groups throws the advantage away.
These tests in AI, robotics and aerospace
- Benchmark comparisons. Paired tests over the same seeds, scenarios or datasets. Multiple algorithms across multiple datasets use Friedman/Nemenyi rank tests (Demšar, 2006).
- Failure analysis. χ² tests of whether failure modes depend on site, temperature band or software version, as in contingency tables of anomaly reports.
- Design of experiments. ANOVA and factorial designs identify which factors (gains, sampling rates, materials) matter in hardware testing, with blocking on test day or unit (Montgomery, 2017).
- Sensor and part acceptance. Two-sample tests compare a new supplier’s parts with the qualified baseline. Equivalence tests (TOST) demonstrate “no meaningful difference”.
- Simulation-to-reality checks. t-tests on paired sim/real metrics per scenario flag where a simulator is biased.
References
- “Student” (1908). “The probable error of a mean.” Biometrika, 6(1).
- B. L. Welch (1947). “The generalization of Student’s problem when several different population variances are involved.” Biometrika, 34.
- K. Pearson (1900). “On the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling.” Philosophical Magazine, 50(302).
- R. A. Fisher (1935). The Design of Experiments. Oliver & Boyd.
- W. G. Cochran (1934). “The distribution of quadratic forms in a normal system.” Math. Proc. Cambridge Phil. Soc., 30(2).
- D. Montgomery (2017). Design and Analysis of Experiments, 9th ed. Wiley.
- J. Demšar (2006). “Statistical comparisons of classifiers over multiple data sets.” JMLR, 7.
- J. Tukey (1949). “Comparing individual means in the analysis of variance.” Biometrics, 5(2).
- A. Agresti (2013). Categorical Data Analysis, 3rd ed. Wiley.
- D. Schuirmann (1987). “A comparison of the two one-sided tests procedure and the power approach for assessing equivalence.” J. Pharmacokinetics and Biopharmaceutics, 15.