Statistical inference

Print the chapter

Every lesson of the chapter, ready for paper. Exercise sets are lettered A, B, C… and answered at the end.

To save a PDF, choose “Save as PDF” in the print dialog.

1. Populations, samples, parameters and statistics

Warm-up

Three quick questions from earlier lessons.

Discover

A poll of 1,000 voters finds 52% support for a candidate. Is 52% the support among all voters?

  1. Not exactly: it estimates it
  2. Yes

Key idea

We study a sample to learn about a population.

The population is the whole group of interest; a sample is the part we actually observe. A parameter is a number describing the population (usually unknown); a statistic is a number computed from the sample, used to estimate the parameter.

Worked example

A factory tests 200 of today's 10,000 bulbs; 3% are faulty.

Population: the 10,000 bulbs
Everything produced today.
Sample: the 200 bulbs
Those tested.
3% is a statistic estimating the faulty rate today
Computed from the sample.

Your turn, guided

Your turn: how many faulty bulbs were found in the sample?

66
3% of 200.

Practice ★

  1. A researcher measures the sleep of 376 randomly chosen teenagers and finds a mean of 7.1 hours. What is 7.1?
    1. A statistic: it describes the sample
    2. A parameter: it describes all teenagers
    3. The population
  1. To learn how much US college students spend on books, a team surveys 671 students at 20 colleges. What is the population?
    1. All US college students
    2. The 671 students surveyed
    3. The 20 colleges

Watch out!

Practice ★★

  1. Census records show that 52% of all households in a town own a car. What is 52%?
    1. A parameter: it describes the whole population
    2. A statistic
    3. A sample proportion

Exit ticket

Three questions to check you have got it.

  1. A researcher measures the sleep of 376 randomly chosen teenagers and finds a mean of 7.1 hours. What is 7.1?
    1. A statistic: it describes the sample
    2. A parameter: it describes all teenagers
    3. The population
  2. A researcher measures the sleep of 288 randomly chosen teenagers and finds a mean of 7.1 hours. What is 7.1?
    1. A statistic: it describes the sample
    2. A parameter: it describes all teenagers
    3. The population
  3. A researcher measures the sleep of 121 randomly chosen teenagers and finds a mean of 7.1 hours. What is 7.1?
    1. A statistic: it describes the sample
    2. A parameter: it describes all teenagers
    3. The population

Summary card

Population and sample

  • Population → parameter (usually unknown).
  • Sample → statistic (an estimate).

Watch out: a number from the sample is a statistic.

2. Bias in sampling

Warm-up

Three quick questions from earlier lessons.

Discover

A TV show asks viewers to text in their opinion; 50,000 do. Is that a better sample than 1,000 randomly chosen adults?

  1. No, the random 1,000 is better
  2. Yes, it is 50 times bigger

Key idea

Bias is a systematic error from how data are collected.

Voluntary response: people choose to respond. Convenience sampling: easy-to-reach individuals. Undercoverage: part of the population cannot be chosen. Nonresponse: chosen people do not answer. Response bias: wording or setting distorts answers. A larger sample does not reduce bias.

Worked example

A survey by phone at 2 p.m. on weekdays.

Working adults are rarely reached
Who is home?
Undercoverage
They cannot be in the sample.
The bias does not shrink with more calls
The estimate leans towards people at home.

Your turn, guided

Your turn: of 1,200 people chosen, 300 answered. The response rate as a fraction:

14\tfrac{1}{4}
300 ÷ 1,200: a high risk of nonresponse bias.

Practice ★

  1. A news website asks readers to vote online; 4824 vote and 80% favor a new law. What is the main problem?
    1. Voluntary response bias: people with strong opinions choose to respond
    2. The sample is too small
    3. None: 4824 responses are representative
  1. A survey of 115 adults is done by calling landline numbers. What kind of bias is most likely?
    1. Undercoverage: people without landlines cannot be chosen
    2. Response bias from the wording
    3. None, if the numbers are chosen at random

Watch out!

Practice ★★

  1. A biased survey of 238 people is repeated with 10 times as many people, chosen the same way. What happens to the bias?
    1. It stays: a larger sample reduces random variability, not bias
    2. It disappears
    3. It becomes 10 times smaller
  2. A biased survey of 402 people is repeated with 10 times as many people, chosen the same way. What happens to the bias?
    1. It stays: a larger sample reduces random variability, not bias
    2. It disappears
    3. It becomes 10 times smaller

Exit ticket

Three questions to check you have got it.

  1. A news website asks readers to vote online; 4824 vote and 80% favor a new law. What is the main problem?
    1. Voluntary response bias: people with strong opinions choose to respond
    2. The sample is too small
    3. None: 4824 responses are representative
  2. A news website asks readers to vote online; 1714 vote and 80% favor a new law. What is the main problem?
    1. Voluntary response bias: people with strong opinions choose to respond
    2. The sample is too small
    3. None: 1714 responses are representative
  3. A news website asks readers to vote online; 3716 vote and 80% favor a new law. What is the main problem?
    1. Voluntary response bias: people with strong opinions choose to respond
    2. The sample is too small
    3. None: 3716 responses are representative

Summary card

Bias

Voluntary response, convenience, undercoverage, nonresponse, response bias.

Watch out: a bigger biased sample is still biased.

3. Comparing two groups: two proportions and paired data

Warm-up

Three quick questions from earlier lessons.

Discover

To test whether two groups have the same success rate, group A had 30 of 100 and group B 50 of 100. Under H₀ (same rate), what is the best estimate of that common rate?

  1. 0.4
  2. It cannot be estimated

Key idea

Two independent groups, or one group measured twice.

Two proportions: pooled p^=x1+x2n1+n2\hat{p} = \dfrac{x_1 + x_2}{n_1 + n_2}, z=p^1−p^2p^(1−p^)(1/n1+1/n2)z = \dfrac{\hat{p}_1 - \hat{p}_2}{\sqrt{\hat{p}(1 - \hat{p})(1/n_1 + 1/n_2)}}. Paired data (same subjects twice): a one-sample t test on the differences.

Worked example

x1=30x_1 = 30, n1=100n_1 = 100; x2=50x_2 = 50, n2=100n_2 = 100.

p^=0.4\hat{p} = 0.4
Pool.
SE≈0.069SE \approx 0.069
√(0.4 × 0.6 × 0.02).
z≈−2.89z \approx -2.89
(0.3 − 0.5)/0.069.

Your turn, guided

Your turn: 20 of 50 and 30 of 50. The pooled proportion.

0.50.5
50/100.

Practice ★

  1. To test H₀: p₁ = p₂, group 1 had 21 successes out of 82 and group 2 had 22 out of 102. Find the pooled proportion.
  2. To test H₀: p₁ = p₂, group 1 had 51 successes out of 85 and group 2 had 51 out of 105. Find the pooled proportion.
  1. 24 students take a test before and after a course. Which procedure compares the scores?
    1. A paired t test on the 24 differences (after − before)
    2. A two-sample t test treating the groups as independent
    3. A two-proportion z test

Watch out!

Practice ★★

  1. Testing H₀: p₁ = p₂ with n₁ = n₂ = 100, the pooled proportion is 3/10. Find the standard error of p̂₁ − p̂₂.

Exit ticket

Three questions to check you have got it.

  1. To test H₀: p₁ = p₂, group 1 had 21 successes out of 82 and group 2 had 22 out of 102. Find the pooled proportion.
  2. To test H₀: p₁ = p₂, group 1 had 51 successes out of 85 and group 2 had 51 out of 105. Find the pooled proportion.
  3. To test H₀: p₁ = p₂, group 1 had 32 successes out of 93 and group 2 had 53 out of 113. Find the pooled proportion.

Summary card

Comparing two groups

  • Two proportions: pooled p^\hat{p} in the SE.
  • Paired: test the differences.

Watch out: pool counts, not proportions.

4. Observational studies, experiments and confounding

Warm-up

Three quick questions from earlier lessons.

Discover

Cities with more firefighters at a fire have more damage. Do firefighters cause damage?

  1. No, bigger fires explain both
  2. Yes, the data show it

Key idea

Only experiments can show cause and effect.

In an observational study we record what happens without intervening; in an experiment we impose treatments. A confounding variable is related to both the explanatory and the response variable, so its effect cannot be separated. Observational studies show associations, not causation.

Worked example

Students who take music lessons have higher grades.

Observational study
Nobody assigned the lessons.
Possible confounder: family income
Affects both lessons and grades.
Conclusion: association only
To test cause, assign lessons at random.

Your turn, guided

Your turn: 80 volunteers are split at random, 40 per group. How many get the treatment?

4040
Half of 80.

Practice ★

  1. Researchers randomly assign 66 volunteers to drink coffee or water, then test their reaction times. What kind of study is it?
    1. An experiment: the researchers assign the treatment
    2. An observational study
    3. A sample survey
  1. Children with bigger shoes read better (16% higher scores). What is the most likely explanation?
    1. A confounding variable: age affects both shoe size and reading
    2. Bigger feet improve reading
    3. It must be pure chance

Watch out!

Practice ★★

  1. An observational study of 3416 adults finds that those who eat breakfast weigh less. Does this show that eating breakfast causes lower weight?
    1. No: other differences between the groups could explain it
    2. Yes, because the sample is large
    3. Yes, if the association is strong
  2. An observational study of 5700 adults finds that those who eat breakfast weigh less. Does this show that eating breakfast causes lower weight?
    1. No: other differences between the groups could explain it
    2. Yes, because the sample is large
    3. Yes, if the association is strong

Exit ticket

Three questions to check you have got it.

  1. Researchers randomly assign 66 volunteers to drink coffee or water, then test their reaction times. What kind of study is it?
    1. An experiment: the researchers assign the treatment
    2. An observational study
    3. A sample survey
  2. Researchers randomly assign 166 volunteers to drink coffee or water, then test their reaction times. What kind of study is it?
    1. An experiment: the researchers assign the treatment
    2. An observational study
    3. A sample survey
  3. Researchers randomly assign 46 volunteers to drink coffee or water, then test their reaction times. What kind of study is it?
    1. An experiment: the researchers assign the treatment
    2. An observational study
    3. A sample survey

Summary card

Studies

  • Observational: record. Experiment: assign.
  • Confounding hides cause in observational data.

Watch out: association is not causation.

5. Designing experiments: randomization, replication, blocking

Warm-up

Three quick questions from earlier lessons.

Discover

To compare two fertilizers, you put fertilizer A on the sunny half of a field and B on the shady half. A grows better. What is the flaw?

  1. Sunlight, not the fertilizer, could explain the difference
  2. There is no flaw

Key idea

Principles of experimental design.

Comparison of treatments (often with a control or placebo group); random assignment of units to treatments; replication on enough units; blocking groups similar units first and randomizes within each block. With several factors, the treatments are all combinations of their levels.

Worked example

Test 2 doses × 3 diets on 60 rats.

Treatments: 2×3=62 \times 3 = 6
Each combination.
10 rats per treatment
Replication.
Shuffle the rats into the 6 groups
Random assignment.

Your turn, guided

Your turn: 3 temperatures × 4 times. Number of treatments.

1212
3 × 4.

Practice ★

  1. Why are 196 subjects assigned to the treatments at random?
    1. To balance other variables between the groups, so differences can be blamed on the treatment
    2. So the results apply to the whole population
    3. To give every subject the same chance of being in the study
  1. An experiment tests 2 fertilizer types at 5 watering levels, with every combination used. How many treatments are there?
  2. An experiment tests 3 fertilizer types at 4 watering levels, with every combination used. How many treatments are there?

Watch out!

Practice ★★

  1. A test of two diets on 115 adults first splits them into men and women, then randomizes diets within each group. What is this design?
    1. A randomized block design, blocking by sex
    2. A stratified random sample
    3. A completely randomized design

Exit ticket

Three questions to check you have got it.

  1. An experiment tests 2 fertilizer types at 5 watering levels, with every combination used. How many treatments are there?
  2. An experiment tests 3 fertilizer types at 4 watering levels, with every combination used. How many treatments are there?
  3. An experiment tests 4 fertilizer types at 4 watering levels, with every combination used. How many treatments are there?

Summary card

Experimental design

Compare · randomize · replicate · block. Treatments = combinations of factor levels.

Watch out: blocks (experiments) vs strata (samples).

6. z-scores and the normal model

Warm-up

Three quick questions from earlier lessons.

Discover

The blue curve is a normal distribution with mean mm and standard deviation ss. Move them.

A normal curve with mean m and standard deviation s: symmetric and bell-shaped, centered at m, wider and lower as s grows.

What happens to the curve when ss increases?

  1. It gets wider and lower
  2. It moves to the right

Key idea

Standardize to compare, and use the 68–95–99.7 rule.

z-score: z=x−μσz = \dfrac{x - \mu}{\sigma}, the number of SDs above the mean. For a normal distribution, about 68% of values lie within 1 SD of the mean, 95% within 2, 99.7% within 3.

Worked example

SAT maths: mean 520, SD 110. A score of 685.

z=1.5z = 1.5
(685 − 520)/110.
Between 300 and 740: about 95% of scores
Within 2 SDs: about 95%.
Above 740: about 2.5%
Half of the remaining 5%.

Your turn, guided

Your turn: mean 70, SD 5. The z-score of 62.

z=−1.6z = -1.6
(62 − 70)/5.

Practice ★

  1. Test scores have mean 75 and standard deviation 3. Find the z-score of a score of 52.
  2. Test scores have mean 55 and standard deviation 2. Find the z-score of a score of 81.
  3. Test scores have mean 66 and standard deviation 10. Find the z-score of a score of 94.

Watch out!

Practice ★★

  1. Heights are approximately normal with mean 76 and standard deviation 4. By the 68–95–99.7 rule, what percent are between 72 and 84?
  2. Heights are approximately normal with mean 69 and standard deviation 6. By the 68–95–99.7 rule, what percent are between 63 and 81?
  1. Mean 71, standard deviation 8. Which value has z-score −3-3?
  2. Mean 79, standard deviation 6. Which value has z-score 33?

Exit ticket

Three questions to check you have got it.

  1. Test scores have mean 75 and standard deviation 3. Find the z-score of a score of 52.
  2. Test scores have mean 55 and standard deviation 2. Find the z-score of a score of 81.
  3. Test scores have mean 66 and standard deviation 10. Find the z-score of a score of 94.

Summary card

z-scores and the normal model

  • z=(x−μ)/σz = (x - \mu)/\sigma; x=μ+zσx = \mu + z\sigma.
  • 68–95–99.7 within 1, 2, 3 SDs.

Watch out: the percentages are for both sides together.

7. Sampling variability and sampling distributions

Warm-up

Three quick questions from earlier lessons.

Discover

Five classmates each survey 20 random students about a new rule. Will they all get the same percentage in favor?

  1. No, the percentages will vary
  2. Yes, if they all sample at random

Key idea

A statistic has a distribution of its own.

  1. Step 110 samples: a few values of p̂, scattered.
  2. Step 2100 samples: a shape appears.
  3. Step 31,000 samples (scaled): a mound centered near p — the sampling distribution.

The sampling distribution of a statistic is its distribution over all possible random samples of the same size. Its center tells us about bias; its spread (standard error) shrinks as the sample size grows.

Worked example

Imagine 1,000 samples of 50 students and the p̂ of each.

A histogram of p̂ values
Plot the 1,000 values.
Centered near the true p
Where it is centered.
Narrower: less variability
With samples of 200 instead.

Your turn, guided

Your turn: by what factor does SD(x̄) change when nn goes from 25 to 100?

It is halved: factor 12\tfrac{1}{2}
√25/√100.

Practice ★

  1. Many random samples of size 161 are taken from the same population. Which quantity changes from sample to sample?
    1. The sample proportion p̂ (a statistic)
    2. The population proportion p (a parameter)
    3. The sample size
  1. Compared with samples of size 73, samples of size 292 give sample means that…
    1. vary less around the population mean
    2. vary more
    3. are more biased

Watch out!

Practice ★★

  1. What is the sampling distribution of the sample mean for samples of size 25?
    1. The distribution of x̄ over all possible samples of size 25
    2. The distribution of the 25 values in one sample
    3. The distribution of the population

Exit ticket

Three questions to check you have got it.

  1. Many random samples of size 161 are taken from the same population. Which quantity changes from sample to sample?
    1. The sample proportion p̂ (a statistic)
    2. The population proportion p (a parameter)
    3. The sample size
  2. Many random samples of size 224 are taken from the same population. Which quantity changes from sample to sample?
    1. The sample proportion p̂ (a statistic)
    2. The population proportion p (a parameter)
    3. The sample size
  3. Many random samples of size 490 are taken from the same population. Which quantity changes from sample to sample?
    1. The sample proportion p̂ (a statistic)
    2. The population proportion p (a parameter)
    3. The sample size

Summary card

Sampling variability

  • Statistics vary from sample to sample.
  • Sampling distribution: a statistic over all samples.
  • Larger nn: less variability.

Watch out: data distribution vs sampling distribution.

8. Point estimates and margins of error

Warm-up

Three quick questions from earlier lessons.

Discover

A poll reports 52% support, "plus or minus 3 points". Which range of values is plausible for the true support?

  1. 49% to 55%
  2. 52% to 55%

Key idea

An interval estimate: point estimate ± margin of error.

A confidence interval is estimate±margin of error\text{estimate} \pm \text{margin of error}, with margin of error =(critical value)×(standard error)= (\text{critical value}) \times (\text{standard error}). The point estimate is the center of the interval; the margin of error is half its width. Larger samples give smaller margins.

Worked example

Interval (0.42, 0.50).

Point estimate =0.46= 0.46
Center.
Margin of error =0.04= 0.04
Half the width.
0.46±0.040.46 \pm 0.04
Written as estimate ± ME.

Your turn, guided

Your turn: interval (12, 20). The margin of error.

44
(20 − 12)/2.

Practice ★

  1. A 95% confidence interval for a proportion is (39/100, 49/100). Find the margin of error.
  2. A 95% confidence interval for a proportion is (20/100, 32/100). Find the margin of error.
  1. A confidence interval for a mean is (41, 55). Find the point estimate.

Watch out!

Practice ★★

  1. A 95% interval from a sample of 591 is too wide. Which change makes it narrower?
    1. A larger sample size
    2. A higher confidence level, such as 99%
    3. Nothing: the width is fixed by the population

Exit ticket

Three questions to check you have got it.

  1. A 95% confidence interval for a proportion is (39/100, 49/100). Find the margin of error.
  2. A 95% confidence interval for a proportion is (20/100, 32/100). Find the margin of error.
  3. A 95% confidence interval for a proportion is (27/100, 37/100). Find the margin of error.

Summary card

Interval estimates

Estimate ± ME, ME = critical value × SE; ME = half the width.

Watch out: width = 2 × ME.

9. Confidence intervals for a proportion

Warm-up

Three quick questions from earlier lessons.

Discover

In a sample of 400, p̂ = 0.5. The standard error is 0.5×0.5/400=0.025\sqrt{0.5 \times 0.5 / 400} = 0.025. For 95% confidence (z* ≈ 2), what is the margin of error?

  1. 0.05
  2. 0.025

Key idea

The one-proportion z interval.

p^±z∗p^(1−p^)n\hat{p} \pm z^*\sqrt{\dfrac{\hat{p}(1 - \hat{p})}{n}}, for a random sample with np^≥10n\hat{p} \ge 10 and n(1−p^)≥10n(1 - \hat{p}) \ge 10. For 95% confidence, z∗=1.96z^* = 1.96. Interpret: "we are 95% confident that the interval captures the population proportion".

Worked example

n=100n = 100, p^=0.3\hat{p} = 0.3, 95%.

SE≈0.0458SE \approx 0.0458
√(0.3 × 0.7/100).
ME≈0.090ME \approx 0.090
1.96 × SE.
(0.210,0.390)(0.210, 0.390)
0.3 ± 0.090.

Your turn, guided

Your turn: SE = 0.02 and z* = 2. The margin of error.

0.040.04
2 × 0.02.

Practice ★

  1. In a random sample of 400, p̂ = 5/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  2. In a random sample of 400, p̂ = 9/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  1. In a random sample of 100, p̂ = 3/10. Using z* = 2, find the upper end of the approximate 95% interval for p.

Watch out!

Practice ★★

  1. A 95% confidence interval for the proportion of voters who support a plan is (0.48, 0.52). Which interpretation is right?
    1. We are 95% confident that the interval from 0.48 to 0.52 captures the true proportion of supporters
    2. 95% of the sample supports the plan
    3. There is a 95% probability that p is between 0.48 and 0.52
  1. Boss problem. In a random sample of 100, p̂ = 3/10. Build a 95% interval with z* = 1.96.

Exit ticket

Three questions to check you have got it.

  1. In a random sample of 400, p̂ = 5/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  2. In a random sample of 400, p̂ = 9/10. Using z* = 1.96, find the margin of error of a 95% interval for p.
  3. In a random sample of 400, p̂ = 8/10. Using z* = 1.96, find the margin of error of a 95% interval for p.

Summary card

Interval for p

p^±z∗p^(1−p^)/n\hat{p} \pm z^*\sqrt{\hat{p}(1 - \hat{p})/n}; check random and large counts.

Watch out: "confident", not "probability", for a computed interval.