Search

Search papers and lessons

Student's t-Distribution

Level 3 · 10 min read

The Student's t-distribution is a bell curve with heavier tails, used for averages and mean comparisons when the noise level must itself be estimated from a small sample.

On this page

  • Colour = topic mix
  • Probability
  • Calculus
  • Discrete math
  • Sign in to see your progress

TL;DR

The Student's t-distribution looks like the Gaussian bell curve but with fatter tails. It appears when you standardise an average using an estimate of the spread rather than the true spread. Because that estimate is itself noisy when the sample is small, extreme values are more likely than the Gaussian says. The one number that controls how fat the tails are is the degrees of freedom, which grows with the sample size.

Where you'll see it: in the t-test comparing two group means, in the confidence interval for a mean when the standard deviation is unknown, and in the heavy-tailed noise models of robust regression.

Intuition

Trusting a guessed ruler

Suppose you want to know the average height of a population, and you have only ten measurements. If you knew the true standard deviation σ\sigma, you would standardise the sample mean with σ\sigma and compare the result to a Gaussian. You do not know σ\sigma, so you estimate it from the same ten values. That estimate is itself random. Sometimes your sample happens to look tight and the estimated spread is too small. Then the standardised number is too big, and extreme results look more common than they should.

It is like measuring a table with a ruler you are not sure of. Most of the time the ruler is close enough, but occasionally it is off by a lot, and that occasional error makes big deviations more likely than a perfectly known ruler would suggest. The Student's t-distribution is the honest bell curve for this situation: it has the same shape idea, with extra probability in the tails to cover the uncertainty in the ruler.

−4−202400.10.20.30.4tdensity
  • df = 1 (Cauchy)
  • df = 3
  • Gaussian
Lower degrees of freedom give fatter tails. At df = 3 the curve is already visibly heavier than the Gaussian at |t| above 2.

One knob: the degrees of freedom

The t-distribution has a single parameter ν\nu, the degrees of freedom. Small ν\nu means heavy tails. As ν\nu grows, the t-distribution gets closer and closer to the standard Gaussian. With ν\nu around 30 the two are almost indistinguishable for practical purposes. This matches the intuition: more data means a more reliable estimate of the spread, so the ruler becomes trustworthy.

Why it is a ratio

The t-distribution arises as the ratio of two independent quantities: a standard Gaussian in the numerator, and a scaled square root of a chi-squared variable in the denominator that measures the estimated spread. The Gaussian gives you the signal, and the chi-squared gives you the noisy ruler. Their ratio is a t-variable.

flowchart LR
  A[Sample of n values] --> B[Sample mean]
  A --> C[Sample standard deviation s]
  B --> D[t = mean difference divided by s over root n]
  C --> D
  D --> E[Compare with t-distribution on n minus 1 degrees of freedom]

The math

Definition

Definition: Student's t-distribution

Let Z∼N(0,1)Z \sim \mathcal{N}(0, 1) and let V∼χν2V \sim \chi^2_\nu be independent of ZZ, where ν>0\nu \gt 0 is the degrees of freedom. Then

T=ZV/νT = \frac{Z}{\sqrt{V/\nu}}

follows a Student's t-distribution with ν\nu degrees of freedom, written T∼tνT \sim t_\nu. Its density is

fν(t)=Γ ⁣(ν+12)νπ Γ ⁣(ν2)(1+t2ν)−(ν+1)/2.f_\nu(t) = \frac{\Gamma\!\left(\frac{\nu+1}{2}\right)}{\sqrt{\nu\pi}\,\Gamma\!\left(\frac{\nu}{2}\right)} \left(1 + \frac{t^2}{\nu}\right)^{-(\nu+1)/2}.

Here tt is a value of TT, Γ\Gamma is the gamma function (the continuous version of the factorial, see the gamma distribution), and ν\nu is the degrees of freedom. The term (1+t2/ν)(1 + t^2/\nu) is what produces the tails: it decays like a power of tt, not like the exponential of t2t^2 in the Gaussian.

Moments

For ν>1\nu \gt 1 the mean is E[T]=0\mathbb{E}[T] = 0. For ν>2\nu \gt 2 the variance is

Var(T)=νν−2.\mathrm{Var}(T) = \frac{\nu}{\nu - 2}.

The variance is infinite for 1<ν≤21 \lt \nu \le 2 (and undefined for ν≤1\nu \le 1). This is the formal version of "heavy tails": extreme values are common enough that the average squared size does not settle. At ν=1\nu = 1 even the mean fails to exist, and the distribution is the Cauchy distribution.

The limit to the Gaussian

As ν→∞\nu \to \infty, the chi-squared variable V/νV/\nu concentrates at 1 by the law of large numbers, so TT approaches ZZ. Formally, fν(t)→exp⁡(−t2/2)/2πf_\nu(t) \to \exp(-t^2/2)/\sqrt{2\pi}.

The t-statistic for a sample mean

Let x1,…,xnx_1, \dots, x_n be independent draws from N(μ,σ2)\mathcal{N}(\mu, \sigma^2) with σ\sigma unknown. Define the sample mean and sample variance

xˉ=1n∑i=1nxi,s2=1n−1∑i=1n(xi−xˉ)2.\bar{x} = \frac{1}{n}\sum_{i=1}^n x_i, \qquad s^2 = \frac{1}{n-1}\sum_{i=1}^n (x_i - \bar{x})^2.

The sample variance uses n−1n - 1 rather than nn in the denominator, because xˉ\bar{x} has already been estimated from the same data, which uses up one degree of freedom. Then

t=xˉ−μs/n∼tn−1.t = \frac{\bar{x} - \mu}{s/\sqrt{n}} \sim t_{n-1}.

The numerator is Gaussian. The quantity (n−1)s2/σ2(n-1)s^2/\sigma^2 is chi-squared with n−1n - 1 degrees of freedom, and it is independent of xˉ\bar{x}. This independence is the key fact that makes the ratio exactly a t-variable. Gosset discovered the result in 1908 and Fisher later proved it rigorously.

Worked examples

Example
A confidence interval with ten measurements

A machine fills bottles, and ten bottles have mean volume xˉ=52.0\bar{x} = 52.0 ml with sample standard deviation s=4.0s = 4.0 ml. We want a 95 percent confidence interval for the true mean μ\mu.

  1. Degrees of freedom: n−1=9n - 1 = 9.
  2. From a t-table, the critical value with 2.5 percent in each tail at ν=9\nu = 9 is t0.975,9=2.262t_{0.975, 9} = 2.262.
  3. Standard error: s/n=4.0/10=1.265s/\sqrt{n} = 4.0/\sqrt{10} = 1.265.
  4. Margin of error: 2.262×1.265=2.8622.262 \times 1.265 = 2.862.
  5. Interval: 52.0±2.86252.0 \pm 2.862, which is (49.14,54.86)(49.14, 54.86) ml.
  6. Interpretation: the procedure captures the true mean 95 percent of the time over repeated samples. Using the Gaussian value 1.961.96 instead would give a margin of 2.482.48, which is too narrow for ten samples.
Example
A t-test comparing a mean to a target

The bottles should contain 50 ml. The same ten bottles give xˉ=52.0\bar{x} = 52.0 and s=4.0s = 4.0. Is the mean different from 50?

  1. The t-statistic is t=(52.0−50)/(4.0/10)=2.0/1.265=1.581t = (52.0 - 50)/(4.0/\sqrt{10}) = 2.0/1.265 = 1.581.
  2. With ν=9\nu = 9, a two-sided test has pp-value between 0.10 and 0.20 (the table gives t=1.833t = 1.833 for 0.10 and t=1.383t = 1.383 for 0.20).
  3. Interpretation: 1.58 standard errors is not unusual enough to reject the target of 50 at the usual 5 percent level. The data are consistent with 50 ml, although they lean toward more.
Example
How heavy are the tails?

Compare the chance that a value lies beyond ∣t∣=2|t| = 2.

  1. For the standard Gaussian, P(∣Z∣>2)=2(1−Φ(2))=2×0.0228=0.0455P(|Z| \gt 2) = 2(1 - \Phi(2)) = 2 \times 0.0228 = 0.0455.
  2. For t3t_3 the two-sided tail probability at t=2t = 2 is about 0.140.14. The table gives t=2.353t = 2.353 for a two-sided probability of 0.10 and t=1.638t = 1.638 for 0.20, so 2.02.0 sits near 0.140.14.
  3. The t-distribution puts about three times as much probability beyond ∣t∣=2|t| = 2. This is exactly the cost of not knowing the spread when the sample is tiny.
  4. With ν=30\nu = 30 the value is about 0.0550.055, very close to the Gaussian figure. The tails shrink quickly as the sample grows.

Tradeoffs and failure modes

The t-distribution is the right reference whenever the variance is estimated from the same data you are testing. It is the wrong reference, or at least an unnecessary one, in other cases:

SituationProblemBetter choice
The true standard deviation is knownUsing t wastes power and gives intervals that are too wideGaussian (z) interval
Large samples (say, 100 or more)t and Gaussian are nearly identical, so the extra care changes littleEither; use t for habit and safety
Data are clearly skewedThe t-test assumes roughly normal means, which skewed small samples may not satisfyBootstrap, rank tests, or a transformation
Outliers in the dataOne outlier inflates ss, which can hide a real effectRobust estimators, or a t-model with a small ν\nu fit to the data
Comparing two groups with unequal variancesThe pooled-variance t-test is wrongWelch's t-test, which uses adjusted degrees of freedom

Some practical warnings:

  • The t-test assumes independent observations. Repeated measures on the same person need a paired test or a model for correlation.
  • A large pp-value is not proof of no difference. It means the data are too few or too noisy to decide.
  • Heavy tails are a feature for modelling, too. Robust regression sometimes replaces Gaussian noise with a t-distribution with a few degrees of freedom, so that a few wild points do not dominate the fit.

History

William Sealy Gosset worked as a chemist and statistician at the Guinness brewery in Dublin. Brewing experiments often used very few samples, such as a handful of barley batches, and the standard large-sample methods gave misleading answers for them. Gosset worked out the distribution of the standardised mean with an estimated standard deviation in the years before 1908, using a mix of hand-run sampling experiments and algebra.

He published it in 1908 in Biometrika under the pseudonym "Student", because the brewery did not want competitors to know it used statistics. The paper, The Probable Error of a Mean, gave the first version of the t-distribution. Gosset's accompanying tables were limited in range.

Ronald Fisher gave the distribution a rigorous derivation in 1925 and showed that the degrees of freedom are n−1n - 1 for a single sample. He also popularised the t-table in his influential textbook Statistical Methods for Research Workers. The distribution caught on because it solved a real problem that large-sample statistics could not: how to make honest decisions from small samples. It is now the default tool for comparing means in science, medicine and industry.

Check yourself

QuestionA sample of n=5n = 5 values has mean 10 and sample standard deviation 2. What are the degrees of freedom, and what is the standard error of the mean?Show answer

The degrees of freedom are n−1=4n - 1 = 4. The standard error is s/n=2/5≈0.894s/\sqrt{n} = 2/\sqrt{5} \approx 0.894.

QuestionFor a sample of 25 values, the 95 percent t critical value is t0.975,24≈2.064t_{0.975, 24} \approx 2.064, while the Gaussian value is 1.961.96. Which interval is wider, and why does the gap shrink as the sample grows?Show answer

The t interval is wider, because 2.064>1.962.064 \gt 1.96. The gap shrinks as ν\nu grows because the t-distribution converges to the Gaussian: the estimate of the spread becomes reliable, so the extra uncertainty from estimating σ\sigma fades.

QuestionCompute the t-statistic for xˉ=103\bar{x} = 103, μ0=100\mu_0 = 100, s=6s = 6, n=16n = 16, and say whether the result is significant at the two-sided 5 percent level with ν=15\nu = 15 (critical value 2.131).Show answer

t=(103−100)/(6/16)=3/1.5=2.0t = (103 - 100)/(6/\sqrt{16}) = 3/1.5 = 2.0. Since ∣2.0∣<2.131|2.0| \lt 2.131, the result is not significant at the two-sided 5 percent level, even though the mean differs from 100 by 3.

QuestionWhy does the t-distribution have infinite variance when ν≤2\nu \le 2, and what does that imply for an average of extreme values?Show answer

Its tails decay like a power of tt, which is slow enough that the integral of t2t^2 against the density diverges for ν≤2\nu \le 2. Averages of such variables do not settle quickly: a single extreme value can dominate the sample mean, which is why heavy-tailed noise needs robust methods.

QuestionA researcher pools two small groups, each with n=8n = 8, and uses a t-test with ν=14\nu = 14. The two groups have very different spreads, s1=2s_1 = 2 and s2=10s_2 = 10. What is wrong, and what test should replace it?Show answer

The pooled-variance t-test assumes equal population variances, which is clearly violated here. The pooled estimate mixes the two spreads and gives unreliable pp-values. Welch's t-test handles unequal variances by using separate variance estimates and adjusted degrees of freedom. With equal group sizes the pooled test is less badly affected, but Welch's test is the safe default.

Sources