Inference for means
🖨 Print a self-study sheet Why print?
Inference for means follows the same four steps as inference for proportions: state, plan, do, conclude. The new ingredient is the distribution, needed because we almost never know the population standard deviation and must estimate it with the sample standard deviation . The most common exam mistake in this unit is not the arithmetic but choosing the wrong procedure, especially treating paired data as two independent samples.
distributions
When is replaced by , the standardized statistic follows a distribution with degrees of freedom (df). A distribution is symmetric and bell-shaped like the normal, but has heavier tails, so its critical values are larger; as df increase it approaches the standard normal. The quantity is the standard error of .
Conditions for one-sample procedures:
| Condition | Check |
|---|---|
| Random | random sample or random assignment |
| when sampling without replacement | |
| Normal/large sample | population normal, or , or (for small ) a graph of the data shows no strong skew or outliers |
One-sample interval and test
- Interval: , with t^* from df =n-1.
- Test of H_0:\mu=\mu_0: t=\dfrac{\bar x-\mu_0}{s/\sqrt n}, P-value from the t distribution with df =n-1.
Paired data
Data are paired when each observation in one set is naturally matched with one in the other: the same subjects measured twice, or matched pairs in an experiment. Compute the differences within each pair, then use one-sample t procedures on the differences, with parameter \mu_{\text{diff}}.
Two independent samples
For two independent random samples or two groups in a randomized experiment:
- Interval: (\bar x_1-\bar x_2)\pm t^*\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}.
- Test of H_0:\mu_1-\mu_2=0: t=\dfrac{\bar x_1-\bar x_2}{\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}}.
Use the degrees of freedom given by the calculator, or the conservative choice df = the smaller of n_1-1 and n_2-1. Check the normal/large sample condition for each sample.
Similar exercises
A random sample of 25 batteries has mean life 12.4 hours and standard deviation 2.5 hours; the data show no strong skew. Construct a 90\% confidence interval for the mean life of all such batteries.
What you need: df =24 gives t^*\approx1.711.
Show solution
The standard error is \dfrac{2.5}{\sqrt{25}}=0.5 hours, and with df =24 the critical value for 90\% is t^*\approx1.711.
The margin of error is 1.711(0.5)\approx0.856, so the interval is 12.4\pm0.856, that is (11.54,\ 13.26).
So we are 90\% confident that the true mean battery life is between about 11.54 and 13.26 hours.
Answer. (11.54,\ 13.26) hours.
Explain why t^* for a 95\% interval with n=10 is larger than 1.96.
What you need: estimating \sigma by s adds uncertainty.
Show solution
With n=10 we use a t distribution with 9 degrees of freedom, because \sigma is estimated by s.
This extra uncertainty gives the t distribution heavier tails than the normal, so we must go farther from the centre to capture the middle 95\%: t^*\approx2.262>1.96.
So t^* is larger because the sample standard deviation is itself uncertain, especially for small samples.
Answer. Heavier tails with 9 df: t^*\approx2.262.
A random sample of 12 house prices in a town is strongly skewed right with one very large outlier. Is a one-sample t interval for the mean price appropriate?
What you need: the normal/large sample condition.
Show solution
The sample size 12 is less than 30, so the normal/large sample condition depends on the shape of the data.
The data are strongly skewed with an outlier, which suggests the population is not normal, so the sampling distribution of \bar x may not be approximately normal.
So a t interval is not appropriate; a larger sample would be needed.
Answer. No.
A 95\% confidence interval for a mean is (47.2,\ 53.6). Is there convincing evidence that \mu\ne50? Is there convincing evidence that \mu\ne45?
What you need: values inside the interval are plausible.
Show solution
The value 50 lies inside the interval, so it is a plausible value of \mu: there is not convincing evidence that \mu\ne50.
The value 45 lies outside the interval, so it is not plausible: there is convincing evidence, at about the 5\% level for a two-sided test, that \mu\ne45.
So the answer is no for 50 and yes for 45.
Answer. No for 50; yes for 45.
For each study, decide whether the data are paired or come from two independent samples.
a) The reaction times of 20 drivers are measured with and without a phone call.
b) The heights of 30 randomly chosen boys and 30 randomly chosen girls are compared.
What you need: are the measurements naturally matched?
Show solution
a) Each driver is measured twice, so each "with phone" time is matched with the same driver's "without phone" time: the data are paired.
b) The boys and girls are separate random samples with no natural matching, so these are two independent samples.
So study a) uses paired procedures and study b) uses two-sample procedures.
Answer. a) paired; b) two independent samples.
Applied exercises
A battery maker claims its batteries last 40 hours on average. A random sample of 20 batteries has mean 38.5 hours and standard deviation 3.2 hours, with no strong skew. Test the claim at \alpha=0.05 against the alternative that the mean is less than 40 hours.
What you need: t=\dfrac{38.5-40}{3.2/\sqrt{20}}, df =19.
Show solution
State: H_0:\mu=40, H_a:\mu<40, where \mu is the true mean life of the batteries; \alpha=0.05.
Plan: one-sample t test. Random sample; 20 is less than 10\% of all batteries; no strong skew in the sample.
Do: t=\dfrac{38.5-40}{3.2/\sqrt{20}}\approx\dfrac{-1.5}{0.7155}\approx-2.096 with df =19, so the P-value is about 0.0248.
Conclude: since 0.0248<0.05, we reject H_0. There is convincing evidence that the mean battery life is less than 40 hours.
Answer. t\approx-2.096, P-value \approx0.0248; reject the claim.
Independent random samples of 40 customers at shop X and 45 customers at shop Y give mean waiting times 25.1 and 22.4 minutes, with standard deviations 4.0 and 5.0 minutes. Construct a 95\% confidence interval for \mu_X-\mu_Y, using df \approx82 (t^*\approx1.989), and interpret it.
What you need: standard error \sqrt{\dfrac{4^2}{40}+\dfrac{5^2}{45}}.
Show solution
The difference in sample means is 25.1-22.4=2.7 minutes, and the standard error is \sqrt{\dfrac{16}{40}+\dfrac{25}{45}}=\sqrt{0.4+0.5556}\approx0.9775.
The margin of error is 1.989(0.9775)\approx1.945, so the interval is 2.7\pm1.945, that is (0.755,\ 4.645) minutes. Both samples are larger than 30, so the normal/large sample condition holds.
So we are 95\% confident that the true mean waiting time at shop X is between about 0.76 and 4.64 minutes longer than at shop Y; since 0 is not in the interval, the shops differ.
Answer. (0.755,\ 4.645) minutes.
In a matched-pairs experiment with 10 pairs, the differences have mean 1.8 and standard deviation 2.0, with no strong skew. Construct a 95\% confidence interval for \mu_{\text{diff}}.
What you need: df =9 gives t^*\approx2.262.
Show solution
The standard error of the mean difference is \dfrac{2.0}{\sqrt{10}}\approx0.6325, and with df =9, t^*\approx2.262.
The margin of error is 2.262(0.6325)\approx1.431, so the interval is 1.8\pm1.431, that is (0.369,\ 3.231).
So we are 95\% confident that the true mean difference is between about 0.37 and 3.23; since the interval is entirely positive, the treatment appears to increase the response.
Answer. (0.369,\ 3.231).
A researcher wants a 95\% confidence interval for a mean with margin of error at most 3 units. From earlier studies, \sigma\approx15. Using the z^* approximation, find the smallest sample size.
What you need: n\ge\left(\dfrac{z^*\sigma}{M}\right)^2.
Show solution
The margin of error is approximately z^*\dfrac{\sigma}{\sqrt n}, so we need 1.96\cdot\dfrac{15}{\sqrt n}\le3, that is \sqrt n\ge\dfrac{1.96\times15}{3}=9.8.
Hence n\ge9.8^2=96.04, and we round up.
So the smallest sample size is 97.
Answer. 97.
Marked like the Vietnamese graduation exam: Part I 0.25 points per question; Part II up to 1 point per question (1, 2, 3, 4 correct statements give 0.1, 0.25, 0.5, 1 point); Part III 0.5 points per question.
Part I. Multiple choice
df =n-1.
Estimating \sigma adds uncertainty.
The same patients are measured twice.
The sample shape gives evidence about the population shape.
Part II. True or false
| a) The standard error of the mean is 2. | ||
| b) The degrees of freedom are 35. | ||
| c) A 95\% t interval uses t^*=1.96 exactly. | ||
| d) The normal/large sample condition is met because n\ge30. |
With df =35, t^*\approx2.03.
Part III. Short answer
\dfrac{8}{\sqrt{16}}=2.
\dfrac{52-50}{0.8}=2.5.
Show answers and explanations
- Part I, question 1: B. df =n-1.
- Part I, question 2: A. Estimating \sigma adds uncertainty.
- Part I, question 3: D. The same patients are measured twice.
- Part I, question 4: C. The sample shape gives evidence about the population shape.
- Part II, question 1: a) True; b) True; c) False; d) True. With df =35, t^*\approx2.03.
- Part III, question 1: 2. \dfrac{8}{\sqrt{16}}=2.
- Part III, question 2: 2.5. \dfrac{52-50}{0.8}=2.5.