Standard Tests: t, Chi-Squared, and F
A quality-control engineer measures the diameter of forty ball bearings. She asks a deceptively simple question. Is the process still centered at the design specification of 10 mm? A geneticist crosses pea plants and observes offspring ratios. These ratios look close to 3:1 but not exactly. Is the deviation noise, or evidence against Mendel's law? A pharmacologist has two candidate assays. She wants to know whether one is genuinely noisier than the other. This is not just about whether it gives a different average. These three questions are answered by three heavily used tools in statistics. They are the t-test, the chi-squared test, and the F-test. These tests matter for a key reason. They convert the abstract machinery of Hypothesis Testing Framework into concrete procedures. These procedures target the most common real-world quantities. These include a mean, a variance, a categorical distribution, and a ratio of variances. Each test is built from a pivotal quantity. This is a function of the data and the unknown parameter. Its sampling distribution does not depend on that parameter. It is drawn from the three named families in The t, Chi-Squared, and F Distributions. The t-distribution absorbs the extra uncertainty of an estimated variance. The chi-squared distribution governs sums of squared deviations and categorical counts. The F-distribution governs ratios of independent variance estimates. Together they form a coherent small-sample theory. This theory predates, and still coexists with, large-sample likelihood methods used today. The big picture is that all three constructions follow one template. Start with a natural estimator of the parameter of interest. Standardize it using its true or estimated standard error. Show that the standardized quantity has an exact, parameter-free distribution under the null hypothesis. This assumes the data are (typically) i.i.d. Gaussian. Then reject the null when the observed value of that pivotal statistic falls in an extreme region. This region is calibrated by a p-value or a fixed significance level . This article gives the exact constructions and complete proofs. It covers the one-sample and two-sample t-tests. It covers the chi-squared test for a variance and for goodness of fit. It covers the F-test for equality of variances. It states every distributional hypothesis explicitly. It proves the null distribution of each test statistic from first principles. This uses Cochran-type decomposition and independence of sample mean and variance under normality. It works two fully asymmetric numerical examples per family. It closes by showing where these exact small-sample tests point forward. They foreshadow the asymptotic Likelihood Ratio Tests. They also foreshadow the F-tests that reappear inside Linear Regression and Least Squares.
- The one-sample t-test checks a population mean when the variance is unknown, using .
- The chi-squared test for a variance uses ; the goodness-of-fit version compares observed and expected category counts.
- The F-test compares two variances via the ratio of independent scaled chi-squared statistics, .
- Every exact test here relies on normality of the data (or of the errors) — this is the load-bearing assumption, not a technicality.
- Independence of and under normality is the single lemma that makes the whole t/chi-squared/F edifice exact rather than approximate.
- Key idea: each test is a pivotal quantity built from a Gaussian sample whose null distribution is known exactly, turning an estimation problem into a table look-up.
Where this lives today
The t-test remains the default tool for comparing two group means in clinical trials, A/B testing of website conversion rates (with large samples, via the CLT even when data are not exactly normal), and quality-control acceptance sampling. The paired t-test, a direct corollary of the one-sample construction applied to within-subject differences, underlies before/after experimental designs across the sciences. The chi-squared goodness-of-fit test is the standard diagnostic for testing whether observed categorical data (genetics ratios, survey responses, hash-function output bins, cryptographic randomness tests) match a hypothesized distribution, and its close relative, the chi-squared test of independence in a contingency table, is ubiquitous in epidemiology and social science. Pearson's statistic is also the prototypical example motivating the general asymptotic theory of Likelihood Ratio Tests, since Wilks' theorem shows that converges to the same family under regularity conditions. The F-test appears explicitly whenever two variance estimates are compared directly (equality-of-variance pre-tests before choosing pooled vs. Welch t-tests), but its largest modern footprint is inside the ANOVA table of Linear Regression and Least Squares, where the ratio of "explained" mean square to "residual" mean square is exactly an F-statistic under Gaussian error assumptions, used to test whether a regression model explains significantly more variability than chance. In signal processing and econometrics, F-tests compare nested models (testing whether a subset of regression coefficients is jointly zero), and in cryptography and simulation, chi-squared statistics are a standard battery test for the quality of pseudo-random number generators.
Ask the tutor: How do these exact small-sample tests change when the sample sizes are unequal and the variances are also unknown to be unequal — what does the Welch–Satterthwaite correction actually compute?
Let be i.i.d. , and (for two-sample problems) let be an independent i.i.d. sample. Write
One-sample -statistic (testing , unknown):
Two-sample -statistic (testing , assuming equal unknown variances ), with pooled variance :
Chi-squared statistic for a variance (testing ):
Chi-squared goodness-of-fit statistic for a multinomial vector of counts from trials, with hypothesized cell probabilities and expected counts :
-statistic for equality of variances (testing ):
Under the stated null hypotheses and normality assumptions, (or ), (exact for the variance test, asymptotic for goodness of fit as ), and .
Intuition
Every test in this family answers the same underlying question: is the discrepancy between what we observed and what the null hypothesis predicts larger than what sampling noise alone would produce? The three distributions differ in what kind of "noise" they measure. The t-distribution arises because we don't know — we must estimate it from the same data used to estimate . This double use of the data injects extra variability compared to the clean case, and the t-distribution has heavier tails than the standard normal to compensate, with the excess vanishing as (since ). The chi-squared distribution arises because is literally a sum of independent squared standard normals (after accounting for the one degree of freedom used to estimate ). It measures total squared deviation, so it is the natural currency for variance and for "distance" between observed and expected category counts. The F-distribution arises whenever we form the ratio of two independent variance estimates. Because each is (up to scaling) a chi-squared divided by its degrees of freedom, their ratio cancels the unknown common scale under the null , leaving a distribution that depends only on the two degrees-of-freedom parameters.
Let be i.i.d. with , and let be an independent i.i.d. sample with . Define as above.
(a) and are independent, , and .
(b) Under ,
(c) Under ,
(d) If additionally (common unknown variance) and holds, with pooled variance as defined above,
(e) Under (no constraint on ),
(f) (Pearson, asymptotic) Let be multinomial counts from i.i.d. trials with true cell probabilities (), and let . Then as ,
We prove each part in turn, using standard facts about the multivariate normal distribution and moment generating functions, and building later parts on earlier ones (never circularly on results not yet established).
Part (a): independence of and , and the chi-squared identity. Write . Since the are i.i.d. , as a multivariate Gaussian vector. Let be any orthogonal matrix whose first row is ; such exists by extending this unit vector to an orthonormal basis of (Gram–Schmidt). Define . Since and is orthogonal, : an orthogonal transformation of a standard multivariate normal vector is again standard multivariate normal (its covariance transforms as ). So are i.i.d. . By construction, , so is a function of alone. Because is orthogonal it preserves Euclidean norm:
Also, a direct algebraic identity (adding and subtracting ) gives
so dividing by ,
Comparing the two displayed decompositions of and canceling the common term gives
The right side is a function of only, which are independent of (independence of coordinates of a standard multivariate normal vector, since for and joint normality makes zero covariance equivalent to independence). Since is a function of alone and is a function of alone, and are independent. Finally, is a sum of independent squared standard normals, which is by definition . This proves (immediate since and ), , and their independence.
Part (b): the one-sample -statistic. Under , set by part (a). Set , independent of by part (a) (independence of and passes to independence of any functions of them separately). By the defining construction of the -distribution (a standard normal divided by the square root of an independent chi-squared over its degrees of freedom), . Compute:
Hence .
Part (c): the chi-squared variance statistic. Under , part (a) applied with gives directly .
Part (d): the two-sample pooled -statistic. Apply part (a) to each sample separately: and , each independent of its own sample mean, and the two samples are independent of each other by hypothesis. Under , the sum of two independent chi-squared variables is chi-squared with degrees of freedom added (immediate from the moment generating function of the chi-squared distribution, for , since the m.g.f. of a sum of independents is the product, and , which is the m.g.f. of ; m.g.f.s determine distributions uniquely). So
independent of (which is a function of and alone, each independent of its own sample variance and the two samples mutually independent). Under , since and independently,
so
independent of . Again by the defining ratio construction of the -distribution,
Part (e): the -statistic. By part (a) applied to each sample, and , independently (independent samples, and each variance statistic depends only on its own sample). By the defining construction of the -distribution (ratio of two independent chi-squareds, each divided by its own degrees of freedom),
Under , the common factor cancels:
Part (f): asymptotic chi-squared goodness of fit (Pearson's theorem). Let be the count vector, multinomial with parameters and . Write . By the multivariate central limit theorem applied to the i.i.d. category-indicator vectors (where is the category of trial , each with mean vector and covariance matrix with , for ), we get
Let and note . Define ; by the continuous mapping theorem, . Compute
and since . The matrix is the orthogonal projection onto the line spanned by (it is symmetric, and using ), so is the orthogonal projection onto the -dimensional orthogonal complement of , a matrix of rank that is idempotent. By a standard fact about quadratic forms in Gaussian vectors (if with an idempotent symmetric matrix of rank , then — proved by diagonalizing with orthogonal and diagonal with ones and zeros, so has nondegenerate i.i.d. coordinates and coordinates identically zero, and is the sum of the squared standard normals), applied here with and , we get that the limiting distribution of is . Finally, observe
By the continuous mapping theorem applied to and the continuous function , we conclude .
∎Worked examples
Example 1 (one-sample -test, asymmetric numbers). A materials engineer claims a new alloy has mean tensile strength MPa. A sample of specimens gives sample mean MPa and sample standard deviation MPa. Test against at . The standard error is . The test statistic is
Under , . The two-sided critical value is . Since , we do not reject at the 5% level — the sample is consistent with the claimed mean strength, although the deviation is fairly large in raw terms. The (two-sided) p-value, using the density, is approximately , confirming borderline non-significance: this dataset would reject the claim at but not , illustrating the sensitivity of conclusions to the chosen significance level rather than to the data alone.
Example 2 (-test for two variances, asymmetric samples). Two production lines fill bottles with juice. Line A: bottles, sample variance mL². Line B: bottles, sample variance mL². Test against at , assuming both populations are normal and the two samples independent. Put the larger sample variance in the numerator to simplify the tail lookup:
with numerator degrees of freedom and denominator degrees of freedom , so under , by part (e) above. For a two-sided test at we compare to the upper critical value (from an -table). Since , we fail to reject : the data do not provide significant evidence that the two lines' filling variability differs, despite Line A's sample variance being nearly Line B's — a reminder that variance ratios need substantially more separation than mean differences do, before small-to-moderate sample sizes can detect them reliably. As a companion, a chi-squared goodness-of-fit check: a die is rolled times with observed face counts . Under : fair die, for all . Then
With degrees of freedom, the upper critical value is . Since , we do not reject fairness at , even though face 3 was observed nearly more often than expected — again illustrating that a single unusual cell need not be globally significant once aggregated across all categories.
The entire exact-distribution machinery in the theorem rests on being i.i.d. normal. Drop that hypothesis, keeping everything else (i.i.d., finite variance), and the stated exact null distribution of can fail badly at small , even though the large-sample behavior is still salvageable by the CLT. Take i.i.d. from an Exponential() distribution shifted so that its mean is (i.e. exactly, so , ), and consider . The theorem's proof used the identity derived from the fact that an orthogonal transformation of a Gaussian vector is again Gaussian with independent coordinates. For exponential data this step is false: an orthogonal transform of a non-Gaussian vector generally has dependent, non-exponential coordinates, so there is no guarantee that and are independent, nor that . Concretely, for Exponential() data, and are not independent (one can show of suitable functions of them is nonzero because the third and fourth cumulants of the exponential are nonzero, unlike the Gaussian case where all cumulants beyond the second vanish). Consequently the statistic
does not follow a distribution exactly. Simulation (or exact computation of the density of for Exponential(1) samples with ) shows its distribution is noticeably right-skewed rather than symmetric, so a two-sided test calibrated against quantiles has an actual Type-I error rate that differs from the nominal — for instance a nominal two-sided test can have true rejection probability closer to – at such small , because the lower tail of is thinner and the upper tail fatter than predicts. Only as does the CLT rescue approximate validity of the -test for non-normal data; at small under skewed populations, the exact calibration is simply wrong, which is precisely why the normality hypothesis is stated explicitly rather than treated as decorative.
Scope, edge cases & common traps
| Situation | Correct handling | Common trap |
|---|---|---|
| Variance unknown, one mean | Use , not | Using critical values with estimated , understating tail probability |
| Two-sample , variances possibly unequal | Use Welch's approximate (not covered here) | Assuming the pooled-variance is always valid |
| Chi-squared goodness of fit, small expected counts | Combine cells so (rule of thumb) | Applying the approximation with tiny expected counts, inflating Type-I error |
| -test for variances | Assumes normal populations, sensitive to non-normality | Treating the F-test as robust the way the t-test roughly is |
| One-sided vs. two-sided alternative | Choose the alternative before seeing data | Peeking at the sign of then picking a one-sided test — invalidates the stated |
| Degrees of freedom bookkeeping | Each independent variance estimate consumes df equal to (sample size − number of estimated means) | Forgetting to subtract 1 per estimated mean when pooling variances |
The mathematician behind it
The three tests carry the names of three statisticians working in the early twentieth century, each solving a distinct small-sample problem created by real, expensive experimentation.
Origins · 1 minWilliam Sealy Gosset ("Student") and how this was discovered
Gosset worked as a chemist and statistician for Guinness, where he needed to draw reliable conclusions from small batches of barley and yeast experiments — sample sizes of a handful, not thousands. Guinness prohibited employees from publishing under their own names to protect trade secrets, so Gosset published his 1908 derivation of the exact sampling distribution of under the pseudonym "Student," giving the t-distribution its enduring name. He derived the distribution largely by empirical simulation and careful algebra before a fully rigorous proof (of the kind given above, via orthogonal transformations and Cochran-style decomposition) was supplied later by Ronald Fisher.
Why does the t-distribution have heavier tails than the normal distribution?
Because the t-statistic's denominator, , is itself a random variable estimated from the same data, rather than the true fixed . When happens to underestimate in a given sample, the resulting value is inflated relative to what would have been. This extra source of variability widens the tails of 's distribution compared to . As the degrees of freedom grow, becomes a increasingly precise estimate of (by the law of large numbers applied to ), so the t-distribution converges to the standard normal, which is why large-sample t-tests and z-tests give nearly identical results.
Can the chi-squared goodness-of-fit test be used to accept the null hypothesis, i.e., to prove the data fit the model?
No. Failing to reject only means the data are consistent with the hypothesized distribution at the chosen significance level; it never proves the model is exactly correct. With a small sample, the test has low power to detect real but modest departures from the hypothesized probabilities, so non-rejection may simply reflect insufficient data rather than a true fit. Conversely, with a very large sample, even a trivially small, practically irrelevant deviation can produce a significant chi-squared statistic. As with all hypothesis tests within the Hypothesis Testing Framework, statistical significance and practical significance must be assessed separately, and effect-size measures (e.g., Cramér's V) usefully complement the raw p-value.
Why must the two samples in a two-sample t-test or F-test be independent?
The entire derivation in the theorem relies on the joint distribution of factoring cleanly: independence of the two samples is what lets us say is normal with variance equal to the sum of the individual variances, and what lets us add the two chi-squared statistics' degrees of freedom when pooling. If the samples are dependent (for example, paired before/after measurements on the same subjects), that correlation must be accounted for explicitly, typically by switching to a paired t-test applied to the differences , which reduces the two-sample problem to a one-sample problem on and sidesteps the independence requirement between and within each pair.
What happens to the F-test statistic if the two sample variances are swapped?
If with in the numerator, swapping to simply inverts the statistic, and its null distribution becomes instead of — the degrees of freedom pair also swaps. This is why F-tables are conventionally read with the larger sample variance placed in the numerator: it standardizes the reported statistic to be , making it possible to always compare against the upper-tail critical value of the appropriate distribution, rather than needing both upper and lower tail tables.
Is the pooled two-sample t-test valid if the two variances are actually different?
Not exactly. The theorem's part (d) explicitly assumes ; the derivation of the pooled variance and its exact distribution depends on adding two chi-squared statistics that share the same scale . If , the pooled-variance -statistic no longer has an exact distribution, and using it can distort the Type-I error rate, especially when sample sizes are unequal. The standard remedy is the Welch–Satterthwaite approximate t-test, which uses a different standard error formula and a non-integer "effective" degrees of freedom, trading exactness for robustness to unequal variances.
How does Pearson's chi-squared statistic relate to a likelihood ratio test?
Pearson's is a second-order Taylor approximation to twice the log-likelihood ratio statistic used for testing the same multinomial goodness-of-fit hypothesis. Both statistics converge to the same limiting distribution under as , a special case of Wilks' general theorem for Likelihood Ratio Tests under standard regularity conditions. In practice they usually agree closely for large and well-populated cells, and Pearson's version is preferred historically for its closed algebraic form and better small-sample behavior in many settings.
Why does the F-test appear inside regression ANOVA tables rather than only in two-sample variance comparisons?
In Linear Regression and Least Squares, the overall F-test compares the reduction in residual sum of squares achieved by fitting the full model against the residual sum of squares of a restricted (null) model, each of which — under Gaussian error assumptions — is proportional to an independent chi-squared statistic. The ratio of these two mean squares, appropriately scaled by their degrees of freedom, is exactly the same F-ratio construction as in the two-sample variance test, just applied to "explained" versus "unexplained" variability rather than to two independent raw samples. This is why the F-distribution, first motivated by comparing two variances, turns out to be the natural tool for testing whether a whole block of regression coefficients is jointly zero.