The normal machinery for testing a mean assumes you know . You almost never do. Substituting the sample standard deviation introduces a second source of randomness into the test statistic, and the resulting distribution is fatter in the tails than a normal. Student’s is the exact accounting of that extra uncertainty.

The idea

The distribution generalizes the standard normal, is symmetric around zero and bell-shaped like it, but has heavier tails, and the tail mass is controlled entirely by the degrees-of-freedom parameter . The two endpoints are instructive: at , is the standard Cauchy distribution with very fat tails and no mean; as it becomes with very thin tails. Small samples do not merely give you a wider interval, they give you a qualitatively different distribution.

Where the distribution comes from

The characterization is a ratio. is the distribution of

where is standard normal, is chi-squared with degrees of freedom, and and are independent. The numerator is the signal; the denominator is the randomness in the variance estimate. Its density is

The moments make the heavy tails concrete. For degrees of freedom, the expected value is 0 when , the variance is when , skewness is 0 when , and excess kurtosis is when . Moments of order or higher do not exist at all. A with 3 degrees of freedom has no finite kurtosis; a with 1 has no mean.

Shifting the constant gives the noncentral : the distribution of has noncentrality parameter , and that is the object used to study the power of a -test.

The test

A Student’s -test is any hypothesis test whose test statistic follows a distribution under the null. It applies where the statistic would be normal if a scaling term were known, and that scaling term is typically an unknown nuisance parameter estimated from the data. A -test often yields very similar results, because the -test converges to the -test as the dataset grows.

One-sample

Testing :

The parent population does not have to be normal, but the distribution of sample means is assumed to be. If the observations are independent and the second moment exists, the central limit theorem makes approximately , though only approximately, since the CLT would apply exactly if were the true standard deviation rather than an estimate. That gap is why follows Student’s asymptotically rather than the normal outright.

Two-sample, independent

Strictly, the name Student’s -test belongs to the version that also assumes equal population variances. With that assumption:

The pooled standard deviation is defined so that its square is an unbiased estimator of the common variance whether or not the population means are equal. Total degrees of freedom are .

Drop the equal-variance assumption and you get Welch’s -test, which estimates the two variances separately:

with degrees of freedom from the Welch-Satterthwaite equation

Here the denominator is not a pooled variance, and the distribution of the statistic is only approximated by a : the true distribution depends slightly on the two unknown population variances, which is the Behrens-Fisher problem.

Paired

When one sample is tested twice (repeated measures) or two samples are matched into pairs, form the differences and test them as a one-sample problem:

where and are the mean and standard deviation of the pairwise differences, is zero when testing whether the average difference is nonzero, and is the number of pairs.

Pairing is a form of blocking. It has greater power than the unpaired test when the paired units are similar with respect to noise factors independent of group membership. Measuring blood pressure in the same patients before and after a medication makes each patient their own control, eliminating the random inter-patient variation and raising power. The costs are two: every subject must be examined twice, and because half the sample now depends on the other half, the paired test has only degrees of freedom where is the total number of observations. Pairs become the test units, so the sample has to be doubled to reach the same degrees of freedom an unpaired design would have had.

Warning

Independence versus pairing is a design fact, not a data fact, and it is generally not testable from the data. If the data are known to be dependent by design, a dependent test must be used. With partially paired data, the independent test may give invalid results because the statistic might not follow a distribution, while the dependent test is sub-optimal because it throws the unpaired observations away.

Assumptions and robustness

The simplest form of the test assumes three things: , that follows a distribution with degrees of freedom, and that and are independent. Normality of the individual data values is not required if these conditions hold.

Robustness is better than the assumption list suggests. Most two-sample -tests are robust to all but large deviations. Student’s original test is highly robust to unequal variances when the two sample sizes are equal, while Welch’s test is insensitive to variance equality regardless of whether sample sizes are similar. The CLT usually rescues the normality requirement for moderately large samples, but the sample size needed for convergence depends on the skewness of the original data, and can run from 30 to 100 or higher.

For large , Slutsky’s theorem shows the sample-variance distribution barely matters: by the CLT, by the law of large numbers, and the ratio converges in distribution to .

The brewery

The distribution was first derived as a posterior distribution in 1876 by Helmert and Lüroth, and appeared in more general form as the Pearson type IV distribution in Karl Pearson’s 1895 paper. It is therefore an example of Stigler’s Law of Eponymy: the name honors someone else.

That someone is William Sealy Gosset, who published it in English in 1908 in Biometrika as “The Probable Error of a Mean” under the pseudonym “Student”. He worked at the Guinness Brewery in Dublin and devised the test as an economical way to monitor the quality of stout. He cared about small samples because that was what the work gave him, such as the chemical properties of barley. Two accounts of the pseudonym circulate: that his employer preferred staff to publish under pen names, and that Guinness did not want competitors to know they were using the -test on raw material. Gosset spent the first two terms of the 1906 to 1907 academic year on Guinness study leave in Karl Pearson’s Biometric Laboratory at University College London, and his identity was known to fellow statisticians and to Pearson as editor-in-chief. Ronald Fisher made it famous, naming it “Student’s distribution” and using the letter for the test value.

Sources

  • Student’s t-distribution (Wikipedia) - the heavier-tail characterization and the Cauchy/normal endpoints, the density, the moments including nonexistence at order , the characterization and noncentral , and the Helmert/Lüroth/Pearson/Gosset/Fisher history.
  • Student’s t-test (Wikipedia) - the definition of the test and its relation to the -test, the one-sample, pooled two-sample, Welch, and paired formulas with their degrees of freedom, the assumption list and robustness results, the Slutsky argument, and the Guinness/study-leave history.