Understand the idea
If you knew the true spread of the population, you could use the normal distribution and be done. You never do: you estimate the spread from the same small sample you are already using, and that estimate is itself uncertain.
Student's t is the distribution that accounts for that extra uncertainty. It looks like the normal bell but with fatter tails, meaning extreme values are a bit more likely than the normal would suggest. Fatter tails push critical values further out, so confidence intervals come out wider, which is the honest price of not knowing the spread.
It has one setting, the degrees of freedom, which grows with your sample size. Small samples give few degrees of freedom and noticeably fat tails. As the sample grows the tails thin out and t becomes indistinguishable from the normal: by about 30 degrees of freedom the difference is small, and by a few hundred it is negligible.
Student's t distribution is often just called the t distribution, and its graph the t curve.
Practitioner explanation
If Z ~ N(0,1) and V ~ chi-square_nu independently, then T = Z / sqrt(V/nu) follows t_nu. This is exactly the structure of a standardized mean with an estimated variance, which is why t rather than z is correct for the one- and two-sample tests and for regression coefficients.
Moments exist only up to order nu - 1: the mean is undefined for nu = 1 (Cauchy) and the variance nu/(nu-2) is undefined for nu <= 2 and inflated for small nu. Convergence to the normal is fast: the two-sided 95% critical value falls from 12.71 at nu = 1 to 2.776 at nu = 4, 2.086 at nu = 20, 1.984 at nu = 100, against the normal's 1.960.
In KernelStats the two-sample t uses Satterthwaite degrees of freedom by default, which are generally non-integer; the reference distribution is then a t with fractional nu, evaluated through the incomplete beta function. This is why Welch output shows a fractional df while Student's pooled option shows the integer n1 + n2 - 2.
When to use it
Consider it when
Whenever a mean or a regression coefficient is standardized by an estimated standard error: the t-tests, ANOVA contrasts, and regression coefficient tests and intervals.
Use caution when
As a model for the DATA. Student's t is the reference distribution for a test statistic; it is a heavy-tailed data model only when you have deliberately chosen robust t-regression.
Formulas and symbols
Density
nu is the degrees of freedom and Gamma is the gamma function.
Degrees of freedom used by the two-sample test
Which one applies depends on the equal_var option.
Worked example
Scenario
A one-sample confidence interval from n = 10 observations, compared to what a normal reference would give.
Result
With 9 degrees of freedom the two-sided 95% critical value is 2.262, against the normal's 1.960: an interval about 15% wider.
Interpretation
That extra 15% is the cost of having estimated the standard deviation from only 10 points. Using 1.96 here would produce an interval whose real coverage is below 95%.
Common misconceptions
Misconception
You use t for small samples and z for large ones.
Correction
You use t whenever the standard deviation is estimated, at any sample size. It happens to converge to z as the sample grows, so the distinction stops mattering numerically, but the reason for choosing t is the estimated standard error, not the sample size.
Misconception
The t distribution assumes the data are normal.
Correction
The exact t result requires normal errors, but the tests built on it are robust for moderate n by the CLT. The heavier tails of t reflect uncertainty in the variance estimate, not a claim about the shape of the data.
References
- NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.4 t distribution, NIST/SEMATECH (2012), §1.3.6.6.4.
