Learn on your own. Parents beside you. Teachers guide.

Lemonmath
Tiếng Việt

Inference for means

Lesson 4.2 · 55 min read · Updated

Inference for means follows the same four steps as inference for proportions: state, plan, do, conclude. The new ingredient is the tt distribution, needed because we almost never know the population standard deviation σ\sigma and must estimate it with the sample standard deviation ss. 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.

tt distributions

When σ\sigma is replaced by ss, the standardized statistic t=xˉ−μs/nt=\frac{\bar x-\mu}{s/\sqrt n} follows a tt distribution with n−1n-1 degrees of freedom (df). A tt 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 sn\dfrac{s}{\sqrt n} is the standard error of xˉ\bar x.

Conditions for one-sample procedures:

Condition Check
Random random sample or random assignment
10%10\% n≤0.1Nn\le0.1N when sampling without replacement
Normal/large sample population normal, or n≥30n\ge30, or (for small nn) a graph of the data shows no strong skew or outliers

One-sample tt interval and test

  • Interval: xˉ±t∗sn\bar x\pm t^*\dfrac{s}{\sqrt n}, 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

Exercise 1

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 and how to start

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.

Exercise 2

Explain why t^* for a 95\% interval with n=10 is larger than 1.96.

What you need and how to start

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.

Exercise 3

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 and how to start

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.

Exercise 4

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 and how to start

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.

Exercise 5

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 and how to start

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

Exercise 6

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 and how to start

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.

Exercise 7

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 and how to start

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.

Exercise 8

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 and how to start

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).

Exercise 9 Challenge

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 and how to start

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.

Mini test

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

Question 1. For a one-sample t procedure with n=20, the degrees of freedom are
Question 2. Compared with the standard normal, a t distribution has
Question 3. A study measures each patient's blood pressure before and after a drug. The correct procedure is
Question 4. For a small sample, the normal/large sample condition is checked by

Part II. True or false

Question 1. A random sample of 36 values has \bar x=50 and s=12. Decide whether each statement is 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.

Part III. Short answer

Question 1. Find the standard error of the mean when s=8 and n=16.

Question 2. In a test, \bar x=52, \mu_0=50 and the standard error is 0.8. Find t.

Show answers and explanations
  1. Part I, question 1: B. df =n-1.
  2. Part I, question 2: A. Estimating \sigma adds uncertainty.
  3. Part I, question 3: D. The same patients are measured twice.
  4. Part I, question 4: C. The sample shape gives evidence about the population shape.
  5. Part II, question 1: a) True; b) True; c) False; d) True. With df =35, t^*\approx2.03.
  6. Part III, question 1: 2. \dfrac{8}{\sqrt{16}}=2.
  7. Part III, question 2: 2.5. \dfrac{52-50}{0.8}=2.5.
📈 My progress

Finding Lemonmath useful?

Send this page to a friend, a parent or a teacher who could use it. Studying on your own is easier with company, and Lemonmath is free for everyone.

Facebook ✉ Email