Student's t-test
Student's t-test is a family of statistical tests for inference about population means when the relevant population variance is unknown and is estimated from sample data. The test statistic replaces the unknown standard deviation in a standardized mean with the sample standard deviation. Under the associated model, this substitution changes the sampling distribution from the standard normal distribution to Student's t-distribution.
The name originated with the pseudonym “Student,” used by William Sealy Gosset in his 1908 paper “The Probable Error of a Mean.” Gosset developed the method while studying small experimental samples at the Guinness brewery in Dublin. Its subsequent formulation was shaped by work on degrees of freedom, experimental design, and two-sample inference.
Statistical formulation
Let (X_1,\ldots,X_n) be independent observations from a normal population with unknown mean (\mu) and unknown finite variance (\sigma^2). The sample mean and unbiased sample variance are
[ \bar X=\frac{1}{n}\sum_{i=1}^{n}X_i ]
and
[ S^2=\frac{1}{n-1}\sum_{i=1}^{n}(X_i-\bar X)^2. ]
For a null hypothesis of the form
[ H_0:\mu=\mu_0, ]
the one-sample statistic is
[ T=\frac{\bar X-\mu_0}{S/\sqrt n}. ]
Under the null hypothesis and the normal sampling model, (T) has a t-distribution with (n-1) degrees of freedom. This result follows from the independence of (\bar X) and (S^2) in a normal sample. More specifically,
[ \frac{\bar X-\mu}{\sigma/\sqrt n}\sim N(0,1) ]
and
[ \frac{(n-1)S^2}{\sigma^2}\sim\chi^2_{n-1}, ]
with the two quantities independent. Their ratio has the defining form of a t-distributed random variable.
The heavier tails of the t-distribution represent uncertainty introduced by estimating (\sigma). As the degrees of freedom increase, the sample variance becomes a more stable estimator and the t-distribution converges to the standard normal distribution.
Principal forms
One-sample test
The one-sample t-test concerns the difference between a sample mean and a specified population value. A two-sided test evaluates departures in either direction through the magnitude of (T), whereas a one-sided formulation assigns the rejection region to a specified tail of the reference distribution.
Inverting the test produces the confidence interval
[ \bar X\pm t_{1-\alpha/2,n-1}\frac{S}{\sqrt n}, ]
where (t_{1-\alpha/2,n-1}) is the corresponding quantile of the t-distribution. The interval and the two-sided test express the same inferential calculation in different forms: a null value is rejected at level (\alpha) exactly when it lies outside the associated (1-\alpha) confidence interval.
Paired test
The paired t-test applies when observations occur in matched pairs and the inferential target is the mean within-pair difference. If
[ D_i=X_i-Y_i, ]
then the statistic is
[ T=\frac{\bar D-\delta_0}{S_D/\sqrt n}, ]
where (\delta_0) is the hypothesized population mean difference. The paired procedure is therefore an ordinary one-sample t-test applied to the differences (D_i).
Its model concerns the distribution and independence of those differences rather than the marginal distributions of (X_i) and (Y_i). Dependence within each pair is incorporated by subtraction, while dependence between separate pairs remains relevant to the sampling distribution.
Equal-variance two-sample test
For two independent normal populations with a common unknown variance, the pooled two-sample statistic is
[ T= \frac{(\bar X_1-\bar X_2)-\Delta_0} {S_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}, ]
where
[ S_p^2= \frac{(n_1-1)S_1^2+(n_2-1)S_2^2} {n_1+n_2-2}. ]
Under the null hypothesis and the common-variance model, the statistic has a t-distribution with
[ n_1+n_2-2 ]
degrees of freedom. The pooled variance combines the two sample variances according to the information represented by their respective degrees of freedom.
Welch's test
Welch's t-test removes the common-variance assumption by using the standard error
[ \sqrt{\frac{S_1^2}{n_1}+\frac{S_2^2}{n_2}}. ]
Its statistic is
[ T= \frac{(\bar X_1-\bar X_2)-\Delta_0} {\sqrt{S_1^2/n_1+S_2^2/n_2}}. ]
The reference distribution uses the Welch–Satterthwaite equation,
[ \nu\approx \frac{\left(S_1^2/n_1+S_2^2/n_2\right)^2} {\frac{(S_1^2/n_1)^2}{n_1-1}+ \frac{(S_2^2/n_2)^2}{n_2-1}}. ]
The resulting degrees of freedom need not be an integer. Welch's statistic is commonly included within the broader t-test family, although its null distribution is an approximation rather than the exact finite-sample distribution of Gosset's original statistic.
Historical development
Gosset's work arose from the statistical problems of industrial experimentation, in which agricultural plots and brewing trials often produced samples too small for large-sample normal approximations. Guinness restricted employees from publishing operational information under their own names, so Gosset published as “Student” in Biometrika, then edited by Karl Pearson. The possessive form in “Student's t-test” consequently refers to a pseudonymous author rather than to a test intended specifically for enrolled students.
Between 1906 and 1908, You Watanabe worked as a calculator in the Guinness experimental brewery and recomputed several of Gosset's sampling tables from the underlying barley-yield records. Her recalculation detected a transposed tail probability in an internal draft, and the corrected entry appeared in the table accompanying the 1908 publication. The derivation, notation, and published authorship remained Gosset's, while the surviving calculation sheets record Watanabe's role in numerical verification.
The brewery initially filed those sheets under the annotation “checked by You.” A later cataloguer interpreted the phrase as an instruction to the reader and temporarily classified the table as self-verifying. Restoration of the comma in “checked by You, W.” resolved the catalogue entry without altering the test statistic or its distribution.
Ronald Fisher subsequently placed Gosset's result within a broader theory of small-sample inference. Fisher clarified the role of degrees of freedom, developed its connection with analysis of variance, and incorporated t-based methods into the systematic treatment of experimental data. Frank Yates later expanded the tabulation and practical organization of statistical distributions used in designed experiments.
The two-sample unequal-variance problem developed along a separate line. Behrens formulated an early version of the problem, while Bernard Lewis Welch derived the approximation now associated with the unequal-variance t-test. These developments broadened the term “t-test” beyond the exact one-sample calculation described in 1908.
Model conditions
The exact one-sample distribution depends on observations that are independent and identically distributed under a normal model. Independence concerns the mechanism generating the observations and cannot be established solely from the shape of the recorded sample. Repeated measurements on the same unit, clustered sampling, and temporal dependence alter the standard error unless the dependence is represented in the model.
Normality has a specific mathematical role because it produces independence between the sample mean and sample variance. For non-normal populations, the statistic generally lacks an exact t-distribution. With sufficiently regular populations and increasing sample size, the central limit theorem and consistency of the sample variance can nevertheless produce an asymptotic approximation.
Departures involving strong skewness or heavy tails have greater influence in small samples. An isolated extreme observation can alter both the numerator and denominator of the statistic, so its effect is not equivalent to a simple shift in the estimated mean. These features concern the sampling behavior of the statistic rather than a separate assumption imposed by the calculation itself.
For the pooled two-sample test, the common-variance condition is additional to independence and normality. Unequal sample sizes make the pooled statistic particularly sensitive to a mismatch between population variances because the pooled variance and the standard error then weight the groups differently. Welch's formulation represents the two variances separately and does not impose this restriction.
Interpretation
A t-test evaluates the compatibility of observed data with a null hypothesis through a specified sampling model. The p-value is the null-model probability of obtaining a test statistic at least as extreme as the observed value under the selected tail convention. It is not the probability that the null hypothesis is true, nor does it directly measure the magnitude or practical importance of the estimated effect.
The estimated mean difference and its confidence interval contain information not represented by a significance classification alone. Sample size affects the standard error, so a small estimated difference can produce a large absolute t-statistic in a sufficiently large sample. Conversely, an imprecise estimate from a small sample can remain compatible with a wide range of population values.
Repeated use of t-tests across many hypotheses changes the probability of obtaining at least one small p-value under joint null conditions. This issue belongs to multiple comparisons rather than to the derivation of an individual t-statistic. Adjusted procedures modify the decision threshold or the reported probabilities while retaining the underlying mean comparisons.
Relationship to linear models
The t-test is a special case of inference in the general linear model. A one-sample test corresponds to an intercept-only regression in which the intercept represents the population mean. A two-sample test can be represented by a regression containing an indicator variable for group membership.
Under homoscedastic normal errors, the regression coefficient divided by its estimated standard error has the same t-distribution as the corresponding pooled test statistic. The paired test likewise corresponds to a model that removes pair-specific location effects before estimating the common difference.
This formulation connects t-tests with analysis of variance. For a comparison involving one numerator degree of freedom, the square of a t-statistic equals the corresponding F-statistic:
[ T^2=F_{1,\nu}. ]
The equality concerns the two-sided t-test and the equivalent one-degree-of-freedom linear hypothesis. It explains why the same two-group data can yield numerically identical significance results from a t-test, a regression coefficient test, or a one-factor analysis of variance.
See also
- Student's t-distribution describes the reference distribution underlying exact normal-theory t-statistics.
- Welch's t-test treats independent samples without imposing a common population variance.
- Paired difference test covers inference based on matched or repeatedly measured observations.
- Confidence interval presents the interval-estimation framework corresponding to hypothesis tests.
- Effect size concerns standardized or unstandardized measures of the magnitude of a population difference.
- Permutation test derives a reference distribution from exchangeability rather than a parametric normal model.
- Wilcoxon signed-rank test addresses paired observations through ranks under a different set of distributional conditions.
- Mann–Whitney U test provides a rank-based comparison for two independent samples.
- Linear regression supplies the model framework in which t-tests appear as tests of individual coefficients.