Understanding the Student's t distribution calculator — concept and principle
A Student's t distribution calculator turns a t statistic and its degrees of freedom into one- and two-tailed p-values, and gives the critical t value for a chosen confidence level. It is the tool behind t-tests and confidence intervals for means when the population standard deviation is unknown and estimated from the sample, which is almost always the case in practice.
How it is calculated
- Two-tailed p = 2 × (1 − F(|t|; df)), the probability of a t at least as extreme in either direction.
- One-tailed p = 1 − F(|t|; df), the area in one tail.
- Critical t (two-sided) is the value t* with F(t*; df) = 1 − (1 − C) ÷ 2, where C is the confidence level. The calculator finds it by numerical search.
F is the t cumulative distribution function. It is computed from the regularized incomplete beta function: the two-tailed area beyond |t| equals I_x(df/2, 1/2) with x = df ÷ (df + t²). Degrees of freedom are usually n − 1 for a one-sample test, or n₁ + n₂ − 2 for a pooled two-sample test.
The principle
When you standardise a sample mean with the sample SD instead of the true σ, the extra uncertainty in s makes extreme values more likely than the normal curve predicts. William Sealy Gosset, writing as "Student" in 1908, derived the exact distribution of this ratio for normal data. It is bell-shaped and symmetric like the normal, but with heavier tails. As df grows, s becomes a reliable estimate of σ and the t distribution approaches the standard normal.
Worked example
- Inputs: t = 2.1, df = 15, confidence = 95%.
- x = 15 ÷ (15 + 2.1²) = 15 ÷ 19.41 ≈ 0.7728, and I_x(7.5, 0.5) ≈ 0.05306.
- Two-tailed p ≈ 0.0531; one-tailed p = 0.05306 ÷ 2 ≈ 0.0265.
- For 95% confidence, F(t*) = 0.975, giving critical t ≈ 2.1314.
| t statistic | Two-tailed p |
|---|---|
| 0.525 | 0.607256397 |
| 1.05 | 0.310341515 |
| 1.57 | 0.136108584 |
| 2.1 | 0.0530552562 |
| 2.62 | 0.0191223112 |
| 3.15 | 0.0066063591 |
| 4.2 | 0.0007729033 |
How to read the result
At α = 0.05 two-sided, the example is just not significant: p ≈ 0.053 > 0.05, and |t| = 2.1 is below 2.131. Critical t values at 95% fall as df rises: about 2.228 at df = 10, 2.131 at df = 15, 2.042 at df = 30, approaching 1.960. A one-tailed test is justified only if the direction was fixed before seeing the data.
Common mistakes
- Using n instead of n − 1 (or the wrong df for a two-sample test).
- Halving the p-value after seeing which direction the effect went.
- Treating p = 0.053 and p = 0.047 as completely different conclusions.
Frequently asked questions
When should I use t instead of z?
Use t when σ is estimated from the sample. With large df the two give nearly the same answer.
Can df be a decimal?
Yes. Welch's unequal-variance t-test produces fractional df, and the formula works for any positive df.
Does a negative t change the p-value?
No. The distribution is symmetric, so the calculator uses |t|.
Sources: Student (W. S. Gosset), "The probable error of a mean", Biometrika 6(1), 1908 · NIST/SEMATECH e-Handbook of Statistical Methods, Section 1.3.6.6.4 t Distribution