Lessons and exercises follow the school system and stay in its language.Les leçons et les exercices suivent le système scolaire et restent dans sa langue.Lektionen und Übungen folgen dem Schulsystem und bleiben in seiner Sprache.

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.

  1. A survey of 23 students records the following. Tick all the categorical variables.
    1. Eye color
    2. ZIP code
    3. Takes the bus to school (yes/no)
    4. Height in cm
    5. Number of siblings
  2. Area codes such as 770 are numbers. Is the area code of a phone number a quantitative variable?
    1. No: it is categorical, a label that only looks like a number
    2. Yes: its values are numbers
    3. Yes, a discrete quantitative variable
  3. A study measures the resting heart rate of 29 runners. What are the cases (observational units)?
    1. The 29 runners
    2. The heart rates
    3. The number 29

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.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. In a random sample of students from a school of 300 students, 26% walk to school. Estimate how many students in the whole school walk.

2. Bias in sampling

Warm-up

Three quick questions from earlier lessons.

  1. A school has 600 juniors and 300 seniors. A stratified sample of 90 students is taken in proportion to grade. How many juniors are in the sample?
  2. A systematic sample of 28 customers is taken from a list of 140: a random start, then every kkth name. What is kk?
  3. A district has 60 classrooms. Five are chosen at random and every student in them is surveyed. Which sampling method is this?
    1. Cluster sampling
    2. Stratified sampling
    3. A simple random sample of students

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.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. A phone survey of a town of 2200 adults can only reach the 52% who have a listed number. How many adults can never be chosen (undercoverage)?

3. Comparing two groups: two proportions and paired data

Warm-up

Three quick questions from earlier lessons.

  1. Test H₀: p = 0.5 with a random sample of 100 in which p̂ = 52/100. Find the z statistic.
  2. Test H₀: p = 0.2 with n = 400 and p̂ = 28/100. Find the z statistic.
  3. A test gives a P-value of 0.05. What does it mean?
    1. If H₀ were true, a result at least as extreme as ours would happen with probability 0.05
    2. There is a 0.05 probability that H₀ is true
    3. The result is due to chance with probability 0.05

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.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. Group 1 had 41 successes out of 100 and group 2 had 26 out of 100. Find p^1−p^2\hat{p}_1 - \hat{p}_2.

4. Observational studies, experiments and confounding

Warm-up

Three quick questions from earlier lessons.

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

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.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. In an experiment, 200 randomly chosen people get a drug and 200 get a placebo. 73 and 58 people improve. By how many percentage points is the drug group's rate higher?

5. Designing experiments: randomization, replication, blocking

Warm-up

Three quick questions from earlier lessons.

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

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 3 watering levels, with every combination used. How many treatments are there?
  2. An experiment tests 9 fertilizer types at 12 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 3 watering levels, with every combination used. How many treatments are there?
  2. An experiment tests 9 fertilizer types at 12 watering levels, with every combination used. How many treatments are there?
  3. An experiment tests 8 fertilizer types at 9 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).

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. An experiment crosses 2 fertilizers with 2 watering levels, and each treatment is used on 3 plants. How many plants are needed?

6. z-scores and the normal model

Warm-up

Three quick questions from earlier lessons.

  1. A set of test scores has standard deviation 4. The teacher adds 10 points to every score. What is the new standard deviation?
  2. Lengths have standard deviation 11 cm. Each length is multiplied by 3. What is the new standard deviation, in the new units?
  3. Daily temperatures have mean 11 °C. With F=95C+32F = \tfrac{9}{5}C + 32, what is the mean in °F?

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 61 and standard deviation 10. Find the z-score of a score of 48.
  2. Test scores have mean 309 and standard deviation 34. Find the z-score of a score of 437.
  3. Test scores have mean 58 and standard deviation 2. Find the z-score of a score of 62.

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 72, standard deviation 2. Which value has z-score −3-3?
  2. Mean 295, standard deviation 16. Which value has z-score 11?

Exit ticket

Three questions to check you have got it.

  1. Test scores have mean 61 and standard deviation 10. Find the z-score of a score of 48.
  2. Test scores have mean 309 and standard deviation 34. Find the z-score of a score of 437.
  3. Test scores have mean 58 and standard deviation 2. Find the z-score of a score of 62.

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.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. Test scores have mean 68. A score of 74 has a z-score of 2. What is the standard deviation?

7. Sampling variability and sampling distributions

Warm-up

Three quick questions from earlier lessons.

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

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.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. Samples of size 22 give sample means with a spread (standard deviation) of ss. Samples of size 352 are taken instead. By what factor does the spread shrink?

8. Point estimates and margins of error

Warm-up

Three quick questions from earlier lessons.

  1. The population proportion is p = 8/10. Find the standard deviation of p̂ for random samples of size 83.
  2. The population proportion is p = 5/10. What is the mean of the sampling distribution of p̂ for samples of size 351?
  3. The population proportion is p = 1/8. What is the smallest sample size n for which np ≥ 10 and n(1 − p) ≥ 10?

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 (47/100, 51/100). Find the margin of error.
  2. A 95% confidence interval for a proportion is (76/100, 102/100). Find the margin of error.
  1. A confidence interval for a mean is (30, 40). 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 (47/100, 51/100). Find the margin of error.
  2. A 95% confidence interval for a proportion is (76/100, 102/100). Find the margin of error.
  3. A 95% confidence interval for a proportion is (43/100, 47/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.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. By what factor must the sample size grow to divide the margin of error by 3?

9. Confidence intervals for a proportion

Warm-up

Three quick questions from earlier lessons.

  1. A 95% confidence interval for a proportion is (47/100, 51/100). Find the margin of error.
  2. A confidence interval for a mean is (30, 40). Find the point estimate.
  3. 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

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

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.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. Using p^=0.5\hat{p} = 0.5 and z∗=2z^* = 2, how large must a sample be for a margin of error of 150\dfrac{1}{ 50 }?

10. Randomized response

Discover

A survey asks 'Have you ever cheated on a test?'. Many people would lie. Here is a trick: each person flips a coin in secret. Heads: answer truthfully. Tails: just say 'yes'. Can we still estimate the true rate?

  1. Yes: we know half the 'yes' answers come from tails
  2. No: the coin destroys the information

Key idea

Randomized response.

With a fair coin (heads: truth, tails: 'yes'):

P(yes)=12p+12P(\text{yes}) = \tfrac{1}{2}p + \tfrac{1}{2}, \quad so p=2 P(yes)−1\quad p = 2\,P(\text{yes}) - 1,

where pp is the true proportion. Randomness protects each person but not the overall estimate.

Worked example

62 % of the answers are 'yes'.

p=2×0.62−1p = 2 \times 0.62 - 1
Use the formula.
p=0.24p = 0.24: about 24 %
Compute.

Your turn, guided

Your turn: 70 % 'yes'. Estimate pp.

0.40.4
2×0.7−12 \times 0.7 - 1.

Practice ★

  1. Randomized response with a fair coin: 71 % of the answers are 'yes'. Estimate the true proportion (as a decimal).
  2. Randomized response with a fair coin: 69 % of the answers are 'yes'. Estimate the true proportion (as a decimal).
  3. Randomized response with a fair coin: 94 % of the answers are 'yes'. Estimate the true proportion (as a decimal).

Practice ★★

  1. Randomized response: 500 people answer and 420 say 'yes'. About how many of them truly are 'yes' people?
  2. Randomized response: 400 people answer and 216 say 'yes'. About how many of them truly are 'yes' people?

Exit ticket

Two questions to check.

  1. Randomized response with a fair coin: 71 % of the answers are 'yes'. Estimate the true proportion (as a decimal).
  2. Randomized response with a fair coin: 69 % of the answers are 'yes'. Estimate the true proportion (as a decimal).

Summary card

Randomized response

  • p=2P(yes)−1p = 2P(\text{yes}) - 1 with a fair coin.
  • Privacy for each person, accuracy for the group.

Statistics offices use variants of this idea to protect people's privacy.

11. History of experiments: Fisher at Rothamsted

Discover

At an agricultural station, a scientist wants to know if a new fertilizer works. Some plots get it, others don't. How should he choose which plots get it?

  1. At random
  2. Give it to the best-looking plots

Key idea

Experiments, from fields to medicine.

1840186018801900192019401837Rothamsted1837Rothamsted
  1. Step 11840186018801900192019401837Rothamsted1837Rothamsted1837: the Rothamsted station is founded to study soils and plant growth.
  2. Step 21840186018801900192019401837Rothamsted1890Fisher is born1837Rothamsted1890Fisher is bornRonald Fisher 1890–1962Barry Eagel, 1952. Barry Eagel. CC BY-SA 4.01890: Ronald Fisher is born; at Rothamsted he introduces randomization.
  3. Step 31840186018801900192019401837Rothamsted1890Fisher is born1935Fisher's The Design of Experiments1837Rothamsted1890Fisher is born1935Fisher's The Design of ExperimentsRonald Fisher 1890–1962Barry Eagel, 1952. Barry Eagel. CC BY-SA 4.01935: Fisher's The Design of Experiments.

At the Rothamsted Agricultural Experiment Station (founded 1837), Ronald Fisher (1890–1962) studied the design of experiments, introducing randomization and the analysis of variance. He collected his methods in The Design of Experiments (1935).

Worked example

20 plots, 10 to get the fertilizer. How many different random assignments are possible?

(2010)\dbinom{20}{10}
Choose 10 plots out of 20.
=184 756= 184\,756 possible assignments
Compute.

Practice ★

  1. What did Fisher introduce in the design of experiments at Rothamsted?
    1. Randomization and the analysis of variance
    2. Polls of voters
    3. The normal curve
  1. 4 plots are split at random into a treatment group and a control group of 2 each. How many assignments are possible?
  2. 6 plots are split at random into a treatment group and a control group of 3 each. How many assignments are possible?
  1. Like Fisher: 3 fertilizers are compared, each on 9 randomly chosen plots. How many plots are needed?

Summary card

Experiments today

  • Medical trials assign treatments at random.
  • Tech companies test website changes with random A/B splits.
  • Farmers still compare seeds and fertilizers on randomized plots.

Sources: MacTutor biography of Fisher (see "Sources and credits").