One-Sample t-Test

Test whether a sample mean differs significantly from a known or hypothesised population value.

Overview

The one-sample t-test compares the mean of a single sample to a reference value (μ0). It answers questions like: “Is the average cholesterol in our sample different from the national average of 200 mg/dL?” The test can be two-sided (differs in either direction), left-sided (less than), or right-sided (greater than).

Worked Example

Scenario: Quality Control of Fill Volumes

A manufacturer labels bottles as containing 500 mL. A quality inspector samples n = 20 bottles and finds x̄ = 497.3 mL, s = 4.8 mL. Is the mean fill volume significantly different from 500 mL? (Two-sided, α = 0.05)

Using Statulator:

1 Open the One-Sample t-Test calculator.

2 Enter Mean = 497.3, SD = 4.8, n = 20, μ0 = 500.

3 Select Two-sided hypothesis.

4 Result: t = −2.515, df = 19, p = 0.021, 95% CI = (495.05, 499.55).

\[ t = \frac{497.3 - 500}{4.8 / \sqrt{20}} = \frac{-2.7}{1.073} = -2.515 \]

Interpretation Guide

The p-value of 0.021 is below 0.05, so we reject H0: the mean fill volume is significantly different from 500 mL. The 95% CI (495.05, 499.55) does not contain 500, which confirms the test result.

One-sided tests: Use a left-sided test if the concern is only underfilling, or a right-sided test if only overfilling matters. One-sided p-values are half the two-sided value when the direction matches the alternative.

Formula

Test Statistic
\[ t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}} \quad;\quad \text{df} = n - 1 \]
P-value

Two-sided: \( p = 2 \cdot P(T \leq -|t|) \)

Left-sided (H1: μ < μ0): \( p = P(T \leq t) \)

Right-sided (H1: μ > μ0): \( p = P(T \geq t) = 1 - P(T \leq t) \)

95% Confidence Interval
\[ \bar{x} \pm t_{\alpha/2,\,n-1} \cdot \frac{s}{\sqrt{n}} \]

Assumptions & Requirements

Textbook Examples

Medicine

A pharmacist tests whether the mean tablet weight in a batch differs from the labelled 500 mg. A sample of 25 tablets has mean = 497.2 mg, SD = 6.1 mg.

Inputs: x̄ = 497.2, μ0 = 500, s = 6.1, n = 25.
Result: t = −2.30, df = 24, p = 0.031 (two-sided).
Interpretation: The mean weight is significantly below the labelled 500 mg (p = 0.031). The batch may need investigation for under-dosing.

Education

A school principal checks whether the mean maths score of 30 students exceeds the national average of 65.

Inputs: x̄ = 68.4, μ0 = 65, s = 10.5, n = 30.
Result: t = 1.77, df = 29, p = 0.088 (two-sided).
Interpretation: The school's mean score does not differ significantly from the national average at the 5% level (p = 0.088).

Engineering

A lab tests whether the mean resistivity of 20 silicon wafers differs from the target of 10.0 Ω·cm.

Inputs: x̄ = 10.35, μ0 = 10.0, s = 0.80, n = 20.
Result: t = 1.96, df = 19, p = 0.065 (two-sided).
Interpretation: The mean resistivity does not significantly differ from the target at the 5% level (p = 0.065).

Agriculture

An agronomist tests whether the mean protein content of 15 wheat samples exceeds the minimum market standard of 11.5%.

Inputs: x̄ = 12.1, μ0 = 11.5, s = 1.2, n = 15.
Result: t = 1.94, df = 14, p = 0.074 (two-sided).
Interpretation: The mean protein content does not significantly differ from the 11.5% standard at the 5% level (p = 0.074).

References

  1. Student (1908). The probable error of a mean. Biometrika, 6(1), 1–25.
  2. Rosner, B. (2016). Fundamentals of Biostatistics (8th ed.). Cengage Learning.
  3. Altman, D. G. (1991). Practical Statistics for Medical Research. Chapman & Hall.