Compare › Parametric

One sample t-test

Tests whether the mean of one sample differs from a specified null value μ₀.

What is One sample t-test?

Student's t-test compares the sample mean against a fixed reference. The test statistic t = (x̄ − μ₀) / (s/√n) measures how many standard errors the observed mean is away from the null; under H₀ it follows a t-distribution with n − 1 df.

Use it whenever you have a known reference value (a clinical cut-off, a published mean, a manufacturer-specified target) and want to know whether your sample is consistent with it. With one sample and no reference value, descriptive statistics + CI is more honest than a test.

For non-normal small samples (n < 30), the non-parametric Wilcoxon signed-rank is the standard alternative. For n ≥ 30 the t-test's normality assumption is largely irrelevant via the CLT.

When should I use One sample t-test?

  • Comparing one sample's mean to a known reference (e.g. is our cohort's BMI different from the population mean of 25?).
  • When the variable is approximately normal or n ≥ 30 (CLT covers you).
  • Pair with a confidence interval — the CI is usually more informative than the p-value.

What data does it need?

One numeric column + null value μ₀.

What does it report?

t statistic, df = n − 1, two-sided p-value, sample mean + 95% CI for the population mean.

What does it assume?

  • Independent observations.
  • Approximately normal distribution (or n ≥ 30 to invoke CLT).

Formula

t = (x̄ − μ₀) / (s / √n), df = n − 1

How do I interpret the result?

Look at the 95% CI for the mean: it's the set of μ₀ values that would NOT be rejected at α = 0.05. If μ₀ falls outside the CI, the test rejects.

Small samples + obvious skew ⇒ switch to Wilcoxon signed-rank against the null hypothetical median. Don't try to "fix" non-normality by reporting the t-test with a footnote; just pick the right test.

See also

References

  • Student (1908). The probable error of a mean. Biometrika 6(1).