A sample of 16 bike commutes has minutes and minutes. Compute the t-statistic for . Give the exact value.
The t-test for a mean
Tests for with an estimated SD: the t-statistic, degrees of freedom, reading t.test output, paired differences, and how and move t and p.
Key ideas
- Standard error of
: the estimated SD of the sample mean. Replacing with is what turns a z-score into a t-statistic.
- t-distribution
Centered at 0, symmetric, heavier tails than the standard normal; closer to normal as df grows. p-values come from
pt, notpnorm.- Conditions
A random sample, and or an approximately normal population, so the CLT applies.
- Paired data
When each unit is measured twice (before/after, with/without), compute one difference per unit and run a one-sample t-test on the differences. is then the true mean difference, and the null value is usually 0.
- Reading
t.test The output gives t, df, the p-value for the stated alternative, an interval and the sample mean. Check that the alternative line matches .
Formulas
Drive-through waits
A coffee chain advertises an average drive-through wait of 4.0 minutes. A regional manager thinks waits at her stores are longer and times a random sample of 36 orders. Interpret the output.
t.test(wait, mu = 4, alternative = "greater")
One Sample t-test
data: wait
t = 2.5, df = 35, p-value = 0.008628
alternative hypothesis: true mean is greater than 4
95 percent confidence interval:
4.162086 Inf
sample estimates:
mean of x
4.5 Parameter: = the true mean drive-through wait, in minutes, for all orders at this manager's stores. versus .
Condition: random sample with .
Statistic: with , so SE and . The sample mean wait is 2.5 standard errors above the hypothesized 4 minutes.
p-value: assuming the true mean wait is 4 minutes, the chance of a t-statistic of 2.5 or larger is about 0.0086.
Very strong evidence that the true mean drive-through wait at these stores is greater than 4 minutes.
Check yourself
A one-sample t-test uses 30 observations. Which reference distribution gives its p-value?
Why does a test about a mean use a t-distribution instead of the standard normal?
A sample gives with 40 df. A student who planned computes the p-value. Which is closest?
Thirty drivers each complete a reaction-time task once while rested and once after a night shift. How should the shift effect on mean reaction time be tested?
Quantity A: the p-value from a two-sided t-test with , , , . Quantity B: the same test with .
A city tests whether the mean response time of its ambulances differs from 12 minutes. Which conclusion fits the output?
t.test(minutes, mu = 12) One Sample t-test data: minutes t = -0.84, df = 59, p-value = 0.4043 alternative hypothesis: true mean is not equal to 12