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 α\alpha. 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.

Key takeaways
  • The one-sample t-test checks a population mean when the variance is unknown, using T=Xˉ−μ0S/n∼tn−1T=\dfrac{\bar X-\mu_0}{S/\sqrt n}\sim t_{n-1}.
  • The chi-squared test for a variance uses (n−1)S2σ02∼χn−12\dfrac{(n-1)S^2}{\sigma_0^2}\sim\chi^2_{n-1}; 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, F=S12/σ12S22/σ22∼Fn1−1, n2−1F=\dfrac{S_1^2/\sigma_1^2}{S_2^2/\sigma_2^2}\sim F_{n_1-1,\,n_2-1}.
  • 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 Xˉ\bar X and S2S^2 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 χ2\chi^2 statistic is also the prototypical example motivating the general asymptotic theory of Likelihood Ratio Tests, since Wilks' theorem shows that −2log⁡(likelihood ratio)-2\log(\text{likelihood ratio}) converges to the same χ2\chi^2 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?

DefinitionPivotal test statistics for the mean, variance, and variance ratio

Let X1,…,XnX_1,\dots,X_n be i.i.d. N(μ,σ2)N(\mu,\sigma^2), and (for two-sample problems) let Y1,…,YmY_1,\dots,Y_m be an independent i.i.d. N(ν,τ2)N(\nu,\tau^2) sample. Write

Xˉ=1n∑i=1nXi,S2=1n−1∑i=1n(Xi−Xˉ)2.\bar X=\frac1n\sum_{i=1}^n X_i,\qquad S^2=\frac{1}{n-1}\sum_{i=1}^n(X_i-\bar X)^2 .

One-sample tt-statistic (testing H0:μ=μ0H_0:\mu=\mu_0, σ2\sigma^2 unknown):

T=Xˉ−μ0S/n.T=\frac{\bar X-\mu_0}{S/\sqrt n}.

Two-sample tt-statistic (testing H0:μ=νH_0:\mu=\nu, assuming equal unknown variances σ2=τ2\sigma^2=\tau^2), with pooled variance Sp2=(n−1)S2+(m−1)SY2n+m−2S_p^2=\dfrac{(n-1)S^2+(m-1)S_Y^2}{n+m-2}:

T=Xˉ−YˉSp1/n+1/m.T=\frac{\bar X-\bar Y}{S_p\sqrt{1/n+1/m}}.

Chi-squared statistic for a variance (testing H0:σ2=σ02H_0:\sigma^2=\sigma_0^2):

Q=(n−1)S2σ02.Q=\frac{(n-1)S^2}{\sigma_0^2}.

Chi-squared goodness-of-fit statistic for a multinomial vector (O1,…,Ok)(O_1,\dots,O_k) of counts from nn trials, with hypothesized cell probabilities p1,…,pkp_1,\dots,p_k and expected counts Ej=npjE_j=np_j:

Q=∑j=1k(Oj−Ej)2Ej.Q=\sum_{j=1}^k \frac{(O_j-E_j)^2}{E_j}.

FF-statistic for equality of variances (testing H0:σ2=τ2H_0:\sigma^2=\tau^2):

F=S2SY2.F=\frac{S^2}{S_Y^2}.

Under the stated null hypotheses and normality assumptions, T∼tn−1T\sim t_{n-1} (or tn+m−2t_{n+m-2}), Q∼χn−12Q\sim\chi^2_{n-1} (exact for the variance test, asymptotic χk−12\chi^2_{k-1} for goodness of fit as n→∞n\to\infty), and F∼Fn−1,m−1F\sim F_{n-1,m-1}.

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 σ\sigma — we must estimate it from the same data used to estimate μ\mu. This double use of the data injects extra variability compared to the clean Z=(Xˉ−μ0)/(σ/n)∼N(0,1)Z=(\bar X-\mu_0)/(\sigma/\sqrt n)\sim N(0,1) case, and the t-distribution has heavier tails than the standard normal to compensate, with the excess vanishing as n→∞n\to\infty (since S→σS\to\sigma). The chi-squared distribution arises because ∑(Xi−Xˉ)2/σ2\sum (X_i-\bar X)^2/\sigma^2 is literally a sum of n−1n-1 independent squared standard normals (after accounting for the one degree of freedom used to estimate μ\mu). 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 σ2\sigma^2 under the null σ2=τ2\sigma^2=\tau^2, leaving a distribution that depends only on the two degrees-of-freedom parameters.

Figure
Three pivotal quantities and where they live on their reference distributions
t₍ₙ₋₁₎: bell-shaped, heavier tails than N(0,1) T = 2.31 0 χ²₍ₖ₋₁₎: right-skewed, supported on [0,∞) Q = 7.82 F₍ₙ₋₁,ₘ₋₁₎: skewed, supported on [0,∞), mean ≈ m/(m-2) F = 2.47 Common template: estimate − hypothesis standard error reject if statistic falls in extreme tail region
TheoremExact null distributions of the standard tests

Let X1,…,XnX_1,\dots,X_n be i.i.d. N(μ,σ2)N(\mu,\sigma^2) with n≥2n\ge 2, and let Y1,…,YmY_1,\dots,Y_m be an independent i.i.d. N(ν,τ2)N(\nu,\tau^2) sample with m≥2m\ge 2. Define Xˉ,S2,Yˉ,SY2\bar X, S^2, \bar Y, S_Y^2 as above.

(a) Xˉ\bar X and S2S^2 are independent, Xˉ∼N(μ,σ2/n)\bar X\sim N(\mu,\sigma^2/n), and (n−1)S2σ2∼χn−12\dfrac{(n-1)S^2}{\sigma^2}\sim\chi^2_{n-1}.

(b) Under H0:μ=μ0H_0:\mu=\mu_0,

T=Xˉ−μ0S/n∼tn−1.T=\frac{\bar X-\mu_0}{S/\sqrt n}\sim t_{n-1}.

(c) Under H0:σ2=σ02H_0:\sigma^2=\sigma_0^2,

Q=(n−1)S2σ02∼χn−12.Q=\frac{(n-1)S^2}{\sigma_0^2}\sim\chi^2_{n-1}.

(d) If additionally σ2=τ2\sigma^2=\tau^2 (common unknown variance) and H0:μ=νH_0:\mu=\nu holds, with pooled variance Sp2S_p^2 as defined above,

T=Xˉ−YˉSp1/n+1/m∼tn+m−2.T=\frac{\bar X-\bar Y}{S_p\sqrt{1/n+1/m}}\sim t_{n+m-2}.

(e) Under H0:σ2=τ2H_0:\sigma^2=\tau^2 (no constraint on μ,ν\mu,\nu),

F=S2SY2∼Fn−1, m−1.F=\frac{S^2}{S_Y^2}\sim F_{n-1,\,m-1}.

(f) (Pearson, asymptotic) Let (O1,…,Ok)(O_1,\dots,O_k) be multinomial counts from nn i.i.d. trials with true cell probabilities p1,…,pk>0p_1,\dots,p_k>0 (∑pj=1\sum p_j=1), and let Ej=npjE_j=np_j. Then as n→∞n\to\infty,

Q=∑j=1k(Oj−Ej)2Ej →d χk−12.Q=\sum_{j=1}^k\frac{(O_j-E_j)^2}{E_j}\ \xrightarrow{d}\ \chi^2_{k-1}.
Proof

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 Xˉ\bar X and S2S^2, and the chi-squared identity. Write X=(X1,…,Xn)⊤\mathbf X=(X_1,\dots,X_n)^\top. Since the XiX_i are i.i.d. N(μ,σ2)N(\mu,\sigma^2), X∼N(μ1,σ2In)\mathbf X\sim N(\mu\mathbf 1,\sigma^2 I_n) as a multivariate Gaussian vector. Let OO be any n×nn\times n orthogonal matrix whose first row is (1n,…,1n)\left(\frac1{\sqrt n},\dots,\frac1{\sqrt n}\right); such OO exists by extending this unit vector to an orthonormal basis of Rn\mathbb R^n (Gram–Schmidt). Define Z=O(X−μ1)/σ\mathbf Z=O(\mathbf X-\mu\mathbf 1)/\sigma. Since (X−μ1)/σ∼N(0,In)(\mathbf X-\mu\mathbf 1)/\sigma\sim N(0,I_n) and OO is orthogonal, Z∼N(0,OO⊤)=N(0,In)\mathbf Z\sim N(0, OO^\top)=N(0,I_n): an orthogonal transformation of a standard multivariate normal vector is again standard multivariate normal (its covariance transforms as OInO⊤=InO I_n O^\top=I_n). So Z1,…,ZnZ_1,\dots,Z_n are i.i.d. N(0,1)N(0,1). By construction, Z1=1n∑i(Xi−μ)/σ=n(Xˉ−μ)/σZ_1=\frac{1}{\sqrt n}\sum_i (X_i-\mu)/\sigma=\sqrt n(\bar X-\mu)/\sigma, so Xˉ\bar X is a function of Z1Z_1 alone. Because OO is orthogonal it preserves Euclidean norm:

∑i=1n(Xi−μσ)2=∥Z∥2=Z12+∑j=2nZj2.\sum_{i=1}^n\left(\frac{X_i-\mu}{\sigma}\right)^2=\|\mathbf Z\|^2=Z_1^2+\sum_{j=2}^n Z_j^2.

Also, a direct algebraic identity (adding and subtracting Xˉ\bar X) gives

∑i=1n(Xi−μ)2=∑i=1n(Xi−Xˉ)2+n(Xˉ−μ)2,\sum_{i=1}^n(X_i-\mu)^2=\sum_{i=1}^n(X_i-\bar X)^2+n(\bar X-\mu)^2,

so dividing by σ2\sigma^2,

∑i=1n(Xi−μσ)2=(n−1)S2σ2+Z12.\sum_{i=1}^n\left(\frac{X_i-\mu}{\sigma}\right)^2=\frac{(n-1)S^2}{\sigma^2}+Z_1^2.

Comparing the two displayed decompositions of ∥Z∥2\|\mathbf Z\|^2 and canceling the common term Z12Z_1^2 gives

(n−1)S2σ2=∑j=2nZj2.\frac{(n-1)S^2}{\sigma^2}=\sum_{j=2}^n Z_j^2.

The right side is a function of Z2,…,ZnZ_2,\dots,Z_n only, which are independent of Z1Z_1 (independence of coordinates of a standard multivariate normal vector, since Cov⁡(Zi,Zj)=0\operatorname{Cov}(Z_i,Z_j)=0 for i≠ji\ne j and joint normality makes zero covariance equivalent to independence). Since Xˉ\bar X is a function of Z1Z_1 alone and S2S^2 is a function of Z2,…,ZnZ_2,\dots,Z_n alone, Xˉ\bar X and S2S^2 are independent. Finally, ∑j=2nZj2\sum_{j=2}^n Z_j^2 is a sum of n−1n-1 independent squared standard normals, which is by definition χn−12\chi^2_{n-1}. This proves Xˉ∼N(μ,σ2/n)\bar X\sim N(\mu,\sigma^2/n) (immediate since Z1∼N(0,1)Z_1\sim N(0,1) and Xˉ=μ+σZ1/n\bar X=\mu+\sigma Z_1/\sqrt n), (n−1)S2/σ2∼χn−12(n-1)S^2/\sigma^2\sim\chi^2_{n-1}, and their independence.

Part (b): the one-sample tt-statistic. Under H0:μ=μ0H_0:\mu=\mu_0, set Z=n(Xˉ−μ0)/σ∼N(0,1)Z=\sqrt n(\bar X-\mu_0)/\sigma\sim N(0,1) by part (a). Set V=(n−1)S2/σ2∼χn−12V=(n-1)S^2/\sigma^2\sim\chi^2_{n-1}, independent of ZZ by part (a) (independence of Xˉ\bar X and S2S^2 passes to independence of any functions of them separately). By the defining construction of the tt-distribution (a standard normal divided by the square root of an independent chi-squared over its degrees of freedom), Z/V/(n−1)∼tn−1Z/\sqrt{V/(n-1)}\sim t_{n-1}. Compute:

ZV/(n−1)=n(Xˉ−μ0)/σS2/σ2=Xˉ−μ0S/n=T.\frac{Z}{\sqrt{V/(n-1)}}=\frac{\sqrt n(\bar X-\mu_0)/\sigma}{\sqrt{S^2/\sigma^2}}=\frac{\bar X-\mu_0}{S/\sqrt n}=T.

Hence T∼tn−1T\sim t_{n-1}.

Part (c): the chi-squared variance statistic. Under H0:σ2=σ02H_0:\sigma^2=\sigma_0^2, part (a) applied with σ2=σ02\sigma^2=\sigma_0^2 gives directly Q=(n−1)S2/σ02∼χn−12Q=(n-1)S^2/\sigma_0^2\sim\chi^2_{n-1}.

Part (d): the two-sample pooled tt-statistic. Apply part (a) to each sample separately: (n−1)S2/σ2∼χn−12(n-1)S^2/\sigma^2\sim\chi^2_{n-1} and (m−1)SY2/τ2∼χm−12(m-1)S_Y^2/\tau^2\sim\chi^2_{m-1}, each independent of its own sample mean, and the two samples are independent of each other by hypothesis. Under σ2=τ2\sigma^2=\tau^2, 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, Mχν2(t)=(1−2t)−ν/2M_{\chi^2_\nu}(t)=(1-2t)^{-\nu/2} for t<1/2t<1/2, since the m.g.f. of a sum of independents is the product, and (1−2t)−ν1/2(1−2t)−ν2/2=(1−2t)−(ν1+ν2)/2(1-2t)^{-\nu_1/2}(1-2t)^{-\nu_2/2}=(1-2t)^{-(\nu_1+\nu_2)/2}, which is the m.g.f. of χν1+ν22\chi^2_{\nu_1+\nu_2}; m.g.f.s determine distributions uniquely). So

(n−1)S2+(m−1)SY2σ2=(n+m−2)Sp2σ2∼χn+m−22,\frac{(n-1)S^2+(m-1)S_Y^2}{\sigma^2}=\frac{(n+m-2)S_p^2}{\sigma^2}\sim\chi^2_{n+m-2},

independent of Xˉ−Yˉ\bar X-\bar Y (which is a function of Xˉ\bar X and Yˉ\bar Y alone, each independent of its own sample variance and the two samples mutually independent). Under H0:μ=νH_0:\mu=\nu, since Xˉ∼N(μ,σ2/n)\bar X\sim N(\mu,\sigma^2/n) and Yˉ∼N(ν,σ2/m)\bar Y\sim N(\nu,\sigma^2/m) independently,

Xˉ−Yˉ∼N ⁣(0, σ2(1/n+1/m)),\bar X-\bar Y\sim N\!\left(0,\ \sigma^2(1/n+1/m)\right),

so

Z=Xˉ−Yˉσ1/n+1/m∼N(0,1),Z=\frac{\bar X-\bar Y}{\sigma\sqrt{1/n+1/m}}\sim N(0,1),

independent of V=(n+m−2)Sp2/σ2∼χn+m−22V=(n+m-2)S_p^2/\sigma^2\sim\chi^2_{n+m-2}. Again by the defining ratio construction of the tt-distribution,

ZV/(n+m−2)=Xˉ−YˉSp1/n+1/m=T∼tn+m−2.\frac{Z}{\sqrt{V/(n+m-2)}}=\frac{\bar X-\bar Y}{S_p\sqrt{1/n+1/m}}=T\sim t_{n+m-2}.

Part (e): the FF-statistic. By part (a) applied to each sample, U=(n−1)S2/σ2∼χn−12U=(n-1)S^2/\sigma^2\sim\chi^2_{n-1} and V=(m−1)SY2/τ2∼χm−12V=(m-1)S_Y^2/\tau^2\sim\chi^2_{m-1}, independently (independent samples, and each variance statistic depends only on its own sample). By the defining construction of the FF-distribution (ratio of two independent chi-squareds, each divided by its own degrees of freedom),

U/(n−1)V/(m−1)=S2/σ2SY2/τ2∼Fn−1,m−1.\frac{U/(n-1)}{V/(m-1)}=\frac{S^2/\sigma^2}{S_Y^2/\tau^2}\sim F_{n-1,m-1}.

Under H0:σ2=τ2H_0:\sigma^2=\tau^2, the common factor cancels:

F=S2/σ2SY2/σ2=S2SY2∼Fn−1,m−1.F=\frac{S^2/\sigma^2}{S_Y^2/\sigma^2}=\frac{S^2}{S_Y^2}\sim F_{n-1,m-1}.

Part (f): asymptotic chi-squared goodness of fit (Pearson's theorem). Let O=(O1,…,Ok)\mathbf O=(O_1,\dots,O_k) be the count vector, multinomial with parameters nn and (p1,…,pk)(p_1,\dots,p_k). Write p^j=Oj/n\hat p_j=O_j/n. By the multivariate central limit theorem applied to the i.i.d. category-indicator vectors eci∈Rk\mathbf e_{c_i}\in\mathbb R^k (where cic_i is the category of trial ii, each with mean vector p=(p1,…,pk)\mathbf p=(p_1,\dots,p_k) and covariance matrix Σ\Sigma with Σjj=pj(1−pj)\Sigma_{jj}=p_j(1-p_j), Σjl=−pjpl\Sigma_{jl}=-p_jp_l for j≠lj\ne l), we get

n(p^−p) →d N(0,Σ).\sqrt n(\hat{\mathbf p}-\mathbf p)\ \xrightarrow{d}\ N(0,\Sigma).

Let D=diag⁡(p1,…,pk)D=\operatorname{diag}(p_1,\dots,p_k) and note Σ=D−pp⊤\Sigma=D-\mathbf p\mathbf p^\top. Define W=D−1/2n(p^−p)\mathbf W=D^{-1/2}\sqrt n(\hat{\mathbf p}-\mathbf p); by the continuous mapping theorem, W→dN(0, D−1/2ΣD−1/2)\mathbf W\xrightarrow{d} N(0,\ D^{-1/2}\Sigma D^{-1/2}). Compute

D−1/2ΣD−1/2=Ik−D−1/2pp⊤D−1/2=Ik−ss⊤,s=(p1,…,pk)⊤,D^{-1/2}\Sigma D^{-1/2}=I_k-D^{-1/2}\mathbf p\mathbf p^\top D^{-1/2}=I_k-\mathbf s\mathbf s^\top,\qquad \mathbf s=(\sqrt{p_1},\dots,\sqrt{p_k})^\top,

and ∥s∥=1\|\mathbf s\|=1 since ∑pj=1\sum p_j=1. The matrix Π=ss⊤\Pi=\mathbf s\mathbf s^\top is the orthogonal projection onto the line spanned by s\mathbf s (it is symmetric, and Π2=s(s⊤s)s⊤=ss⊤=Π\Pi^2=\mathbf s(\mathbf s^\top\mathbf s)\mathbf s^\top=\mathbf s\mathbf s^\top=\Pi using s⊤s=1\mathbf s^\top\mathbf s=1), so Ik−ΠI_k-\Pi is the orthogonal projection onto the (k−1)(k-1)-dimensional orthogonal complement of s\mathbf s, a matrix of rank k−1k-1 that is idempotent. By a standard fact about quadratic forms in Gaussian vectors (if W∼N(0,Π′)\mathbf W\sim N(0,\Pi') with Π′\Pi' an idempotent symmetric matrix of rank rr, then W⊤W∼χr2\mathbf W^\top\mathbf W\sim\chi^2_r — proved by diagonalizing Π′=UΛU⊤\Pi'=U\Lambda U^\top with UU orthogonal and Λ\Lambda diagonal with rr ones and k−rk-r zeros, so U⊤W∼N(0,Λ)U^\top\mathbf W\sim N(0,\Lambda) has rr nondegenerate i.i.d. N(0,1)N(0,1) coordinates and k−rk-r coordinates identically zero, and W⊤W=(U⊤W)⊤(U⊤W)\mathbf W^\top\mathbf W=(U^\top\mathbf W)^\top(U^\top\mathbf W) is the sum of the rr squared standard normals), applied here with Π′=Ik−Π\Pi'=I_k-\Pi and r=k−1r=k-1, we get that the limiting distribution of W⊤W\mathbf W^\top\mathbf W is χk−12\chi^2_{k-1}. Finally, observe

W⊤W=n(p^−p)⊤D−1(p^−p)=∑j=1kn(p^j−pj)2pj=∑j=1k(Oj−npj)2npj=∑j=1k(Oj−Ej)2Ej=Q.\mathbf W^\top\mathbf W=n(\hat{\mathbf p}-\mathbf p)^\top D^{-1}(\hat{\mathbf p}-\mathbf p)=\sum_{j=1}^k\frac{n(\hat p_j-p_j)^2}{p_j}=\sum_{j=1}^k\frac{(O_j-np_j)^2}{np_j}=\sum_{j=1}^k\frac{(O_j-E_j)^2}{E_j}=Q.

By the continuous mapping theorem applied to W→dN(0,Ik−Π)\mathbf W\xrightarrow{d}N(0,I_k-\Pi) and the continuous function w↦w⊤w\mathbf w\mapsto\mathbf w^\top\mathbf w, we conclude Q→dχk−12Q\xrightarrow{d}\chi^2_{k-1}. ■\blacksquare

∎

Worked examples

Example 1 (one-sample tt-test, asymmetric numbers). A materials engineer claims a new alloy has mean tensile strength μ0=430\mu_0=430 MPa. A sample of n=12n=12 specimens gives sample mean xˉ=424.6\bar x=424.6 MPa and sample standard deviation s=9.8s=9.8 MPa. Test H0:μ=430H_0:\mu=430 against H1:μ≠430H_1:\mu\ne 430 at α=0.05\alpha=0.05. The standard error is s/n=9.8/12=9.8/3.4641=2.8285s/\sqrt n=9.8/\sqrt{12}=9.8/3.4641=2.8285. The test statistic is

t=424.6−4302.8285=−5.42.8285=−1.9091.t=\frac{424.6-430}{2.8285}=\frac{-5.4}{2.8285}=-1.9091.

Under H0H_0, T∼t11T\sim t_{11}. The two-sided critical value is t11,0.025=2.201t_{11,0.025}=2.201. Since ∣t∣=1.9091<2.201|t|=1.9091<2.201, we do not reject H0H_0 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 t11t_{11} density, is approximately 2×P(T11>1.9091)≈2×0.0413=0.08262\times P(T_{11}>1.9091)\approx 2\times 0.0413=0.0826, confirming borderline non-significance: this dataset would reject the claim at α=0.10\alpha=0.10 but not α=0.05\alpha=0.05, illustrating the sensitivity of conclusions to the chosen significance level rather than to the data alone.

Example 2 (FF-test for two variances, asymmetric samples). Two production lines fill bottles with juice. Line A: n=10n=10 bottles, sample variance sA2=2.89s_A^2=2.89 mL². Line B: m=16m=16 bottles, sample variance sB2=1.21s_B^2=1.21 mL². Test H0:σA2=σB2H_0:\sigma_A^2=\sigma_B^2 against H1:σA2≠σB2H_1:\sigma_A^2\ne\sigma_B^2 at α=0.05\alpha=0.05, assuming both populations are normal and the two samples independent. Put the larger sample variance in the numerator to simplify the tail lookup:

F=sA2sB2=2.891.21=2.3884,F=\frac{s_A^2}{s_B^2}=\frac{2.89}{1.21}=2.3884,

with numerator degrees of freedom n−1=9n-1=9 and denominator degrees of freedom m−1=15m-1=15, so under H0H_0, F∼F9,15F\sim F_{9,15} by part (e) above. For a two-sided test at α=0.05\alpha=0.05 we compare to the upper 2.5%2.5\% critical value F9,15,0.025≈3.12F_{9,15,0.025}\approx 3.12 (from an FF-table). Since 2.3884<3.122.3884<3.12, we fail to reject H0H_0: the data do not provide significant evidence that the two lines' filling variability differs, despite Line A's sample variance being nearly 2.4×2.4\times 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 n=120n=120 times with observed face counts (O1,…,O6)=(15,24,29,14,22,16)(O_1,\dots,O_6)=(15,24,29,14,22,16). Under H0H_0: fair die, Ej=120/6=20E_j=120/6=20 for all jj. Then

Q=∑j=16(Oj−20)220=25+16+81+36+4+1620=17820=8.9.Q=\sum_{j=1}^{6}\frac{(O_j-20)^2}{20}=\frac{25+16+81+36+4+16}{20}=\frac{178}{20}=8.9.

With k−1=5k-1=5 degrees of freedom, the upper 5%5\% critical value is χ5,0.052=11.07\chi^2_{5,0.05}=11.07. Since 8.9<11.078.9<11.07, we do not reject fairness at α=0.05\alpha=0.05, even though face 3 was observed nearly 45%45\% more often than expected — again illustrating that a single unusual cell need not be globally significant once aggregated across all categories.

CounterexampleWhy normality of the data cannot be dropped

The entire exact-distribution machinery in the theorem rests on X1,…,XnX_1,\dots,X_n being i.i.d. normal. Drop that hypothesis, keeping everything else (i.i.d., finite variance), and the stated exact null distribution of TT can fail badly at small nn, even though the large-sample behavior is still salvageable by the CLT. Take X1,…,XnX_1,\dots,X_n i.i.d. from an Exponential(11) distribution shifted so that its mean is μ0=1\mu_0=1 (i.e. Xi∼Exp(1)X_i\sim\text{Exp}(1) exactly, so E[Xi]=1=μ0E[X_i]=1=\mu_0, Var⁡(Xi)=1\operatorname{Var}(X_i)=1), and consider n=5n=5. The theorem's proof used the identity ∑(Xi−μ)2/σ2∼χn−12+Z12\sum(X_i-\mu)^2/\sigma^2 \sim \chi^2_{n-1}+Z_1^2 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 Xˉ\bar X and S2S^2 are independent, nor that (n−1)S2/σ2∼χn−12(n-1)S^2/\sigma^2\sim\chi^2_{n-1}. Concretely, for Exponential(11) data, Xˉ\bar X and S2S^2 are not independent (one can show Cov⁡\operatorname{Cov} 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

T=Xˉ−1S/5T=\frac{\bar X-1}{S/\sqrt 5}

does not follow a t4t_4 distribution exactly. Simulation (or exact computation of the density of TT for Exponential(1) samples with n=5n=5) shows its distribution is noticeably right-skewed rather than symmetric, so a two-sided test calibrated against t4t_4 quantiles has an actual Type-I error rate that differs from the nominal α\alpha — for instance a nominal 5%5\% two-sided test can have true rejection probability closer to 88–9%9\% at such small nn, because the lower tail of TT is thinner and the upper tail fatter than t4t_4 predicts. Only as n→∞n\to\infty does the CLT rescue approximate validity of the tt-test for non-normal data; at small nn under skewed populations, the exact tn−1t_{n-1} calibration is simply wrong, which is precisely why the normality hypothesis is stated explicitly rather than treated as decorative.

Scope, edge cases & common traps

SituationCorrect handlingCommon trap
Variance unknown, one meanUse tn−1t_{n-1}, not zzUsing N(0,1)N(0,1) critical values with estimated σ\sigma, understating tail probability
Two-sample tt, variances possibly unequalUse Welch's approximate tt (not covered here)Assuming the pooled-variance tn+m−2t_{n+m-2} is always valid
Chi-squared goodness of fit, small expected countsCombine cells so Ej≥5E_j\ge 5 (rule of thumb)Applying the χk−12\chi^2_{k-1} approximation with tiny expected counts, inflating Type-I error
FF-test for variancesAssumes normal populations, sensitive to non-normalityTreating the F-test as robust the way the t-test roughly is
One-sided vs. two-sided alternativeChoose the alternative before seeing dataPeeking at the sign of Xˉ−μ0\bar X-\mu_0 then picking a one-sided test — invalidates the stated α\alpha
Degrees of freedom bookkeepingEach 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
WS
William Sealy Gosset ("Student")
1876–1937 · Guinness Brewery, Dublin & later Rothamsted

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 (Xˉ−μ)/(S/n)(\bar X-\mu)/(S/\sqrt n) 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.

History
- 1875–1900: Karl Pearson develops the chi-squared goodness-of-fit test, publishing the foundational 1900 paper introducing Q=∑(Oj−Ej)2/EjQ=\sum (O_j-E_j)^2/E_j and its asymptotic χ2\chi^2 distribution.
- 1908: William Sealy Gosset, writing as "Student," publishes "The Probable Error of a Mean," introducing the t-distribution for small-sample inference about a mean with unknown variance.
- 1925: Ronald A. Fisher publishes Statistical Methods for Research Workers, rigorously deriving the sampling distributions of S2S^2, formalizing the FF-ratio's precursor (the variance-ratio statistic), and popularizing significance testing broadly.
- 1934: George Snedecor names and tabulates the variance-ratio distribution "F" in Fisher's honor, cementing the modern F-test for comparing two variances.
- 1930s–present: The t, chi-squared, and F tests become embedded as special cases inside the general theory of Likelihood Ratio Tests and as the backbone of the ANOVA tables used in Linear Regression and Least Squares.
Why does the t-distribution have heavier tails than the normal distribution?

Because the t-statistic's denominator, S/nS/\sqrt n, is itself a random variable estimated from the same data, rather than the true fixed σ\sigma. When SS happens to underestimate σ\sigma in a given sample, the resulting TT value is inflated relative to what Z=(Xˉ−μ0)/(σ/n)Z=(\bar X-\mu_0)/(\sigma/\sqrt n) would have been. This extra source of variability widens the tails of TT's distribution compared to N(0,1)N(0,1). As the degrees of freedom n−1n-1 grow, SS becomes a increasingly precise estimate of σ\sigma (by the law of large numbers applied to S2S^2), 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 H0H_0 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 (Xˉ,S2,Yˉ,SY2)(\bar X, S^2, \bar Y, S_Y^2) factoring cleanly: independence of the two samples is what lets us say Xˉ−Yˉ\bar X-\bar Y 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 Di=Xi−YiD_i=X_i-Y_i, which reduces the two-sample problem to a one-sample problem on DiD_i and sidesteps the independence requirement between XiX_i and YiY_i within each pair.

What happens to the F-test statistic if the two sample variances are swapped?

If F=SA2/SB2F=S_A^2/S_B^2 with SA2S_A^2 in the numerator, swapping to F′=SB2/SA2=1/FF'=S_B^2/S_A^2=1/F simply inverts the statistic, and its null distribution becomes Fm−1,n−1F_{m-1,n-1} instead of Fn−1,m−1F_{n-1,m-1} — 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 ≥1\ge 1, making it possible to always compare against the upper-tail critical value of the appropriate Fdf1,df2F_{\text{df}_1,\text{df}_2} 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 σ2=τ2\sigma^2=\tau^2; the derivation of the pooled variance Sp2S_p^2 and its exact χn+m−22\chi^2_{n+m-2} distribution depends on adding two chi-squared statistics that share the same scale σ2\sigma^2. If σ2≠τ2\sigma^2\ne\tau^2, the pooled-variance tt-statistic no longer has an exact tn+m−2t_{n+m-2} 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 Q=∑(Oj−Ej)2/EjQ=\sum(O_j-E_j)^2/E_j is a second-order Taylor approximation to twice the log-likelihood ratio statistic G2=2∑Ojlog⁡(Oj/Ej)G^2=2\sum O_j\log(O_j/E_j) used for testing the same multinomial goodness-of-fit hypothesis. Both statistics converge to the same χk−12\chi^2_{k-1} limiting distribution under H0H_0 as n→∞n\to\infty, a special case of Wilks' general theorem for Likelihood Ratio Tests under standard regularity conditions. In practice they usually agree closely for large nn 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.

Before this

Where this leads