One-sample t-test
A one-sample t-test checks whether a sample mean differs from a hypothesized value mu0. Compute t = (x-bar - mu0) / (s / sqrt(n)), compare it with the t distribution on n - 1 degrees of freedom, and reject the null hypothesis when the p-value is below alpha (usually 0.05).
Syntax
t = (x-bar - mu0) / (s / sqrt(n)), df = n - 1| Part | What it is |
|---|---|
x-bar | the sample mean |
mu0 | the value claimed by the null hypothesis |
s | the sample standard deviation |
n | the sample size |
Examples
Claim: mean = 50. Sample: n = 16, x-bar = 52, s = 8
SE = 8 / sqrt(16) = 2; t = (52 - 50) / 2Result: t = 1.0, df = 15
Two-sided p-value for t = 1.0, df = 15
=T.DIST.2T(1, 15)Result: 0.333, not significant at 0.05
n = 25, x-bar = 105, mu0 = 100, s = 10
t = 5 / (10 / 5) = 2.5; =T.DIST.2T(2.5, 24)Result: p = 0.0197, significant at 0.05
From raw data in Excel (no T.TEST for one sample)
=(AVERAGE(A1:A25) - 100) / (STDEV.S(A1:A25) / SQRT(25))Result: the t statistic; then T.DIST.2T(ABS(t), 24)
Common mistakes
- Dividing by s instead of s / sqrt(n); the test compares the mean, so it needs the standard error.
- Using a one-sided p-value when the question is about any difference; a two-sided test halves nothing, it doubles the one-tail area.
- Passing a negative t to T.DIST.2T, which returns an error; use ABS(t).
Practice One-sample t-test
These drills check your answer on live data, free, no account needed.
- One-sample t statisticA manager claims the average order value is 68 dollars. A random sample of 13 gives x̄ = 69.23 and s = 29.5. What is the t statistic for testing the claim? Round to 2 decimal places.
- Two-sided t test: p-value and decisionTest H0: μ = 68 against H1: μ ≠ 68 for the average order value (dollars). A random sample of 11 gives x̄ = 69.33 and s = 29.5. Find the p-value of the one-sample t test, then decide at α = 0.05. Round to 4 decimal places.
- One-sided t test: p-value and decisionA process engineer believes a new layout cuts the mean number of units packed per hour from the old 45. Test H0: μ = 45 against H1: μ < 45. A random sample of 10 hours gives x̄ = 44.09 and s = 1.7. Find the p-value, then decide at α = 0.05. Round to 4 decimal places.
Questions
What are the assumptions of a one-sample t-test?
A random sample, roughly normal data or a sample large enough for the central limit theorem (about 30 or more), and no severe outliers.
What is the critical t value?
The t that marks the rejection region: for alpha = 0.05 two-sided and 15 degrees of freedom it is 2.131, from =T.INV.2T(0.05, 15). Reject when |t| exceeds it.
How does a one-sample t-test relate to a confidence interval?
The test rejects mu0 at alpha = 0.05 exactly when the 95% confidence interval for the mean excludes mu0.
Related
- p-valueA p-value is the probability of a result at least as extreme as the observed one if the null is true. How to compute it from z and t, and common misreadings.
- Two-sample t-testHow to compare two independent means with a two-sample t-test: the Welch formula, degrees of freedom, a worked example and the Excel T.TEST function.
- Paired t-testHow to run a paired t-test on before and after data: take the differences, compute t = d-bar / (s_d / sqrt(n)) with n - 1 degrees of freedom. Example, Excel.
- Confidence interval for a meanHow to calculate a confidence interval for a mean with x-bar plus or minus t times s over root n, a full 95% example, when to use z, and Excel CONFIDENCE.T.