Student's t distribution
Student's t distribution: like the normal curve, but with heavier tails for small samples. With the default parameters (degrees of freedom ν = 5) its mean is 0 and its standard deviation 1.291. Use the simulator below to draw samples and see it take shape.
Simulate it
Change the parameters, then draw random samples. The bars are the samples; the line is the exact density. With more samples the bars settle onto it.
Samples to draw
What is the Student's t distribution?
Student's t distribution looks like the standard normal bell curve but with heavier tails. It arises when you standardise a sample mean using the sample's own standard deviation instead of the unknown population value: the extra uncertainty from estimating the spread makes extreme values more likely.
It is controlled by one parameter, the degrees of freedom ν (for a one-sample test, n − 1). As ν grows the heavy tails disappear and the t distribution becomes the standard normal. It is the basis of t-tests and of confidence intervals for means.
Where it is used
- Confidence interval for a mean when σ is unknown.
- One-sample, two-sample and paired t-tests.
- Testing the coefficients of a regression.
- Modelling heavy-tailed data such as financial returns (as a robust alternative to the normal).
Shape and parameters
Symmetric around 0 like the normal. With ν = 1 it is the Cauchy distribution, which has no mean; the mean exists for ν > 1 and the variance ν/(ν − 2) for ν > 2. By ν around 30 it is already very close to the normal.
What it assumes
- Data from a roughly normal population (the t procedures are fairly robust for moderate samples).
- Independent observations.
How it relates to other distributions
- Normal distribution: The limit as the degrees of freedom grow.
- Chi-square distribution: A t variable is Z divided by √(χ²/ν).
- F distribution: The square of a t variable with ν df is an F with (1, ν) df.
Common mistakes
- Using the normal (z) critical value for a small sample, which makes the interval too narrow.
- Using n instead of n − 1 for the degrees of freedom.
- Confusing one-tailed and two-tailed critical values.
How to work it out
- 1
The probability density function (the formula that gives the shape):
- 2
Its mean (the long-run average) and variance (the spread):
- 3
Worked example with the default parameters (degrees of freedom ν = 5): With 5 degrees of freedom, what is the probability that |T| exceeds 2.571?
LaTeX source of the formulas on this page
\[ f(x)=\frac{\Gamma\!\left(\frac{\nu+1}{2}\right)}{\sqrt{\nu\pi}\,\Gamma\!\left(\frac{\nu}{2}\right)}\left(1+\frac{x^2}{\nu}\right)^{-\frac{\nu+1}{2}} \]
\[ \mu = 0\ (\nu>1),\qquad \sigma^2 = \frac{\nu}{\nu-2}\ (\nu>2) \]
\[ \text{answer} = 0.0500 \]At a glance
| Property | Value |
|---|---|
| Type | Continuous (measurements) |
| Parameters | degrees of freedom ν |
| Possible values | all real numbers |
| Mean | 0 |
| Variance | 1.6667 |
| Standard deviation | 1.291 |
| Example (degrees of freedom ν = 5) | With 5 degrees of freedom, what is the probability that |T| exceeds 2.571? Answer: 0.0500. |
How to compute it in Excel, Python and R
| Tool | Function |
|---|---|
| Excel / Google Sheets | =T.DIST(x, ν, TRUE) (T.INV.2T for the two-tailed critical value) |
| Python (SciPy) | scipy.stats.t.cdf(x, df) (t.ppf for critical values) |
| R | pt(x, df) (qt for critical values) |
Questions
What is the Student's t distribution used for?
Like the normal curve, but with heavier tails for small samples. Typical uses: Confidence interval for a mean when σ is unknown. One-sample, two-sample and paired t-tests. Testing the coefficients of a regression.
What are the mean and variance of the Student's t distribution?
Mean: μ = 0\ (\nu>1). Variance: σ² = (\nu)/(\nu-2)\ (\nu>2).
What does the Student's t distribution assume?
Data from a roughly normal population (the t procedures are fairly robust for moderate samples). Independent observations.
How do I calculate it in Excel?
=T.DIST(x, ν, TRUE) (T.INV.2T for the two-tailed critical value)
How is the Student's t distribution related to other distributions?
Normal distribution: The limit as the degrees of freedom grow. Chi-square distribution: A t variable is Z divided by √(χ²/ν). F distribution: The square of a t variable with ν df is an F with (1, ν) df.