Statistics Quest

One-sample t-test

Tests whether a population mean equals a stated value, using the sample mean, the sample SD and the t distribution with n − 1 degrees of freedom.

t=xˉ−μ0s/n,df=n−1t = \frac{\xbar - \mu_0}{s/\sqrt{n}}, \qquad df = n - 1
xˉ\xbar
Sample mean.
μ0\mu_0
Mean stated by H0H_0.
ss
Sample standard deviation (divisor n − 1).
nn
Sample size.
xˉ±t1−α/2, n−1 sn\xbar \pm t_{1-\alpha/2,\,n-1}\,\frac{s}{\sqrt{n}}
The matching confidence interval (one-sided alternatives give a one-sided bound).
t1−α/2, n−1t_{1-\alpha/2,\,n-1}
The t quantile with n − 1 df.

When to use

One quantitative variable, one sample, and a benchmark mean to compare with (a target, a specification, a claimed value). If σ were genuinely known, the z-test would use σ\sigma instead of ss — in practice σ is almost never known.

Assumptions

  • Independent observations (random sample or a process in a stable state).
  • The population is roughly normal, or n is large enough for the CLT: with n ≥ 30 moderate skewness is fine; with small n check a dot plot or Q–Q plot for strong skew and outliers.
  • Outliers matter more than mild non-normality: the mean and SD are both sensitive to them.

How to interpret

  • A small p-value is evidence that the population mean differs from μ0\mu_0 (in the direction of H1H_1).
  • The CI gives the plausible values of μ; the test at level α rejects exactly when μ0\mu_0 is outside the (1−α)(1-\alpha) CI.
  • Cohen's d=(xˉ−μ0)/sd = (\xbar - \mu_0)/s expresses the gap in SD units.

Common mistakes

  • Using the population SD formula (divide by n) for s.
  • Using z critical values with a small sample and estimated SD.
  • Testing paired before/after data as two separate samples — use the paired t-test on the differences.
  • Concluding "the mean is 12" after a non-significant result.

Example

Delivery times 12, 15, 11, 14, 13, 16, 12, 15 (n = 8) vs μ0=12\mu_0 = 12: xˉ=13.5\xbar = 13.5, s=1.773s = 1.773, SE =1.773/8=0.627= 1.773/\sqrt 8 = 0.627, t=1.5/0.627=2.39t = 1.5/0.627 = 2.39, df = 7, two-sided p=0.048p = 0.048. 95% CI: 12.02 to 14.98 minutes; d=0.85d = 0.85.