Chapter 22 Exercises: Sampling, Estimation, and Confidence Intervals
How to use these exercises: Start with Part A to check your conceptual understanding, then move to Parts B and C for applied and coding work. Part D pushes toward synthesis and deeper thinking. You'll need Python with NumPy, pandas, scipy.stats, and matplotlib for the coding exercises.
Difficulty key: ⭐ Foundational | ⭐⭐ Intermediate | ⭐⭐⭐ Advanced | ⭐⭐⭐⭐ Extension
Part A: Conceptual Understanding ⭐
Exercise 22.1 — Population vs. sample identification
For each scenario below, identify (a) the population, (b) the sample, (c) the parameter of interest, and (d) the statistic that estimates it.
- A university surveys 400 randomly selected students to estimate the proportion who use the campus mental health center.
- A factory tests 50 batteries from a day's production run of 12,000 to estimate the average battery lifetime.
- A political poll calls 1,200 registered voters in Ohio to estimate the proportion who support a ballot measure.
- A researcher measures the blood pressure of 80 patients taking a new medication to estimate its average effect.
Guidance
For each scenario: the population is the *entire group* you want to draw conclusions about; the sample is the *subset* you actually observe; the parameter is the number that describes the population (e.g., population mean, population proportion); the statistic is the number from your sample that estimates the parameter. For example, in scenario 1: Population = all students at the university. Sample = the 400 surveyed students. Parameter = the true proportion of all students who use the center. Statistic = the proportion in the sample who use the center.Exercise 22.2 — Bias identification ⭐
Each of the following sampling strategies has a bias problem. Name the type of bias and explain which direction it would push the results.
- A restaurant puts feedback cards on every table and reports that 85% of customers are "very satisfied."
- A newspaper runs an online poll asking "Should the city raise the minimum wage?" and reports the results as representative of public opinion.
- A study of long-term career outcomes surveys alumni from a university's 2010 graduating class, but only reaches those whose contact information is current.
- A pharmaceutical company publishes results from a clinical trial but doesn't mention two other trials of the same drug that showed no effect.
Guidance
1. **Voluntary response bias** — only people with strong feelings (very happy or very unhappy) bother filling out cards. The 85% likely overestimates satisfaction because moderately satisfied people don't fill out cards, but the few angry ones often do, creating an odd mix. 2. **Voluntary response / self-selection bias** — people who click through to vote feel strongly about the issue. The result overrepresents extreme views. 3. **Survivorship / non-response bias** — alumni with current contact info are more likely to be employed and successful. Those who moved frequently, left the workforce, or had difficult career paths are underrepresented. 4. **Publication bias** — selectively reporting only positive results inflates the apparent effectiveness of the drug. This is a form of bias in the "sample" of studies we see.Exercise 22.3 — Standard error reasoning ⭐
Without computing anything, answer these questions:
- If you double the sample size, what happens to the standard error? Does it halve? Explain.
- If the population has a standard deviation of 10, which gives a smaller standard error: a sample of 25 or a sample of 100?
- Two researchers study the same population. Researcher A samples 50 people. Researcher B samples 200 people. Who will have the narrower confidence interval? By how much (approximately)?
- Why does increasing the sample size have diminishing returns for reducing the standard error?
Guidance
1. Doubling the sample size reduces the SE by a factor of $\sqrt{2} \approx 1.41$, not by half. SE = $\sigma / \sqrt{n}$, so doubling n gives $\sigma / \sqrt{2n} = \text{SE} / \sqrt{2}$. 2. SE(25) = 10/5 = 2. SE(100) = 10/10 = 1. The sample of 100 has half the standard error. 3. Researcher B's CI will be narrower. Since SE is proportional to $1/\sqrt{n}$, the ratio is $\sqrt{50}/\sqrt{200} = \sqrt{1/4} = 1/2$. B's interval is about half as wide. 4. Because of the square root. To cut SE in half, you need 4x the data. To cut it to 1/3, you need 9x the data. Each additional reduction costs exponentially more.Exercise 22.4 — Confidence interval interpretation ⭐⭐
A survey reports: "The average American household spends $8,200 per year on food, with a 95% confidence interval of ($7,800, $8,600)."
For each statement below, say whether it is a correct or incorrect interpretation of this CI, and explain why.
- "There is a 95% probability that the true average is between $7,800 and $8,600."
- "If we repeated this survey many times, about 95% of the resulting intervals would contain the true average."
- "95% of American households spend between $7,800 and $8,600 on food."
- "We are 95% confident that the sample mean is between $7,800 and $8,600."
- "The true average is $8,200, give or take $400."
Guidance
1. **Incorrect.** The true average is a fixed number, not a random variable. The 95% refers to the method's long-run success rate, not to a probability about this specific interval. 2. **Correct.** This is the textbook-accurate interpretation. 3. **Incorrect.** The CI is about the *mean*, not about individual values. Individual household spending varies much more widely than $7,800 to $8,600. 4. **Incorrect.** The sample mean is known — it's $8,200. There's no uncertainty about the sample mean. The uncertainty is about the *population* mean. 5. **Partially correct but imprecise.** $8,200 is the point estimate and $400 is the margin of error, which is true. But "give or take" doesn't capture the formal meaning of the confidence level.Exercise 22.5 — Confidence level trade-offs ⭐⭐
A polling firm has a budget that allows surveying 800 people. Their client wants to report results with a margin of error no larger than 3 percentage points.
- If the estimated proportion is 50% (worst case for margin of error), what is the margin of error at 95% confidence with n = 800?
- If the margin of error is too large at 95% confidence, should they (a) increase the confidence level to 99%, (b) decrease the confidence level to 90%, or (c) increase the sample size? Explain the trade-offs.
- The client says "I want a very narrow interval AND very high confidence." Why is this request problematic without a larger budget?
Guidance
1. For a proportion, SE = $\sqrt{p(1-p)/n}$ = $\sqrt{0.5 \times 0.5/800}$ = $\sqrt{0.000313}$ ≈ 0.0177. At 95% confidence, MOE = 1.96 × 0.0177 ≈ 0.035 or 3.5 percentage points. Just slightly over the 3-point target. 2. Option (b) decreasing to 90% would shrink the interval (z* drops from 1.96 to 1.645). Option (c) increasing the sample size would also shrink it. Option (a) would make the interval *wider*, which is the wrong direction. The trade-off: (b) is free but increases the miss rate from 5% to 10%; (c) works but costs money. 3. Narrow intervals require large samples. High confidence requires wide intervals. The only way to have both is to increase n, which costs money. There's a fundamental tension between precision, confidence, and cost.Exercise 22.6 — When the population is small ⭐⭐
Your company has 150 employees. You survey 60 of them (40% of the company) about job satisfaction.
- Why might the standard formulas for standard error slightly overestimate the uncertainty in this situation?
- Look up the "finite population correction factor." What is it, and how does it modify the standard error formula?
- Compute the standard error with and without the correction factor if the sample standard deviation is 12.
Guidance
1. The standard SE formula assumes the population is infinitely large (or at least much larger than the sample). When you've sampled 40% of the population, there's less "unknown" left than the formula assumes. 2. The finite population correction (fpc) is $\sqrt{(N - n) / (N - 1)}$, where N is the population size and n is the sample size. You multiply the standard SE by this factor. 3. Without fpc: SE = 12/√60 = 1.549. The fpc = √((150-60)/(150-1)) = √(90/149) = 0.777. With fpc: SE = 1.549 × 0.777 = 1.204. The corrected SE is about 22% smaller.Exercise 22.7 — Sampling strategies for the real world ⭐⭐
For each scenario, recommend the most appropriate sampling method (simple random, stratified, cluster, systematic, or convenience) and explain your reasoning.
- Estimating the average test score across 500 high schools in a state, where test score distributions differ substantially between urban, suburban, and rural schools.
- Checking product quality on an assembly line that produces 10,000 items per day.
- Studying voter preferences across a country with 50 states and tens of thousands of precincts.
- A student researcher studying study habits who needs to survey students at their university but has limited time and no sampling frame.
Guidance
1. **Stratified** — stratify by urban/suburban/rural and sample within each stratum. This ensures representation of each school type and produces more precise estimates when strata differ. 2. **Systematic** — select every 100th item (or some regular interval). This is efficient on an assembly line and gives good coverage of the production run. 3. **Multi-stage cluster** — randomly select states, then randomly select precincts within those states, then survey all or a random sample of voters within selected precincts. This is practical because listing all voters nationally isn't feasible. 4. **Convenience** — standing outside the library or posting on social media. The student should acknowledge this limits generalizability. Stratifying by year or major could help somewhat.Part B: Applied Problems ⭐⭐
Exercise 22.8 — Computing confidence intervals by hand
A sample of 36 countries has a mean vaccination rate of 68.5% with a sample standard deviation of 15.2%.
- Compute the standard error.
- Compute the 95% confidence interval using z* = 1.96.
- Compute the 95% confidence interval using the t-distribution (t* with df = 35).
- Compute the 90% and 99% confidence intervals.
- Which interval is widest? Which is narrowest? Why?
Guidance
1. SE = 15.2/√36 = 15.2/6 = 2.533 2. 68.5 ± 1.96 × 2.533 = 68.5 ± 4.965 → (63.54, 73.46) 3. t*(35) = 2.030. CI = 68.5 ± 2.030 × 2.533 = 68.5 ± 5.142 → (63.36, 73.64). Slightly wider than the z-based interval. 4. At 90%: z* = 1.645 → 68.5 ± 4.167 → (64.33, 72.67). At 99%: z* = 2.576 → 68.5 ± 6.525 → (61.97, 75.03). 5. The 99% interval is widest; the 90% interval is narrowest. Higher confidence requires a wider net.Exercise 22.9 — Sample size determination ⭐⭐
You want to estimate the average daily screen time for college students. You need a margin of error no larger than 15 minutes at 95% confidence. A pilot study suggests the standard deviation is about 90 minutes.
- Use the margin of error formula (MOE = z* × σ/√n) to solve for n.
- What sample size do you need?
- If you wanted the margin of error to be 10 minutes instead, how does the required sample size change?
- What does this tell you about the cost of extra precision?
Guidance
1. MOE = z* × σ/√n → n = (z* × σ / MOE)² = (1.96 × 90 / 15)² = (11.76)² = 138.3. 2. Round up: n = 139. 3. For MOE = 10: n = (1.96 × 90 / 10)² = (17.64)² = 311.2 → n = 312. That's more than double! 4. Cutting the margin of error by 1/3 (from 15 to 10) more than doubles the required sample size. Precision is expensive in terms of data collection.Exercise 22.10 — Comparing two groups with CIs ⭐⭐
You have the following data on vaccination rates:
| Group | n | Mean | Std Dev |
|---|---|---|---|
| High-income countries | 50 | 82.3% | 8.5% |
| Low-income countries | 40 | 54.7% | 18.2% |
- Compute the 95% confidence interval for each group.
- Do the intervals overlap?
- Based on the CI overlap (or lack thereof), what can you tentatively conclude about the difference between groups?
- Why is comparing individual CIs not the same as constructing a CI for the difference between means?
Guidance
1. High-income: SE = 8.5/√50 = 1.202. CI = 82.3 ± 1.96 × 1.202 = (79.94, 84.66). Low-income: SE = 18.2/√40 = 2.878. CI = 54.7 ± 1.96 × 2.878 = (49.06, 60.34). 2. No, the intervals do not overlap. There's a gap of about 20 percentage points between the upper end of the low-income CI and the lower end of the high-income CI. 3. When 95% CIs don't overlap, the difference is statistically significant at the 0.05 level. We can tentatively conclude there's a real difference. 4. Non-overlapping individual CIs imply a significant difference, but overlapping CIs do NOT necessarily imply no significant difference. The proper approach is to construct a CI for the difference, which accounts for the combined uncertainty. We'll see this in Chapter 23.Exercise 22.11 — The Literary Digest in numbers ⭐⭐
The 1936 Literary Digest poll had 2.4 million responses predicting Landon would win 57% to Roosevelt's 43%. The actual result was Roosevelt 61%, Landon 37%.
- If the sample had been truly random, what would the margin of error have been for a sample of 2.4 million at 95% confidence? (Use p = 0.5 for the worst case.)
- How does this tiny margin of error contrast with the actual error of about 20 percentage points?
- What lesson does this teach about the relationship between sample size and sample quality?
Guidance
1. SE = √(0.5 × 0.5 / 2,400,000) = √(0.0000002083) = 0.000456. MOE = 1.96 × 0.000456 = 0.00089, or about 0.09 percentage points. The margin of error would have been less than a tenth of a percent! 2. The actual error was about 20 percentage points — roughly 22,000 times larger than the margin of error suggested. The formulas assume an unbiased sample; a biased sample invalidates them completely. 3. No amount of data can overcome systematic bias. A biased sample of 2.4 million is infinitely worse than an unbiased sample of 1,000.Exercise 22.12 — Interpreting real-world CIs ⭐⭐
A news article reports: "A new poll finds that 48% of registered voters plan to vote for Candidate A, with a margin of error of plus or minus 3 percentage points."
- What is the implied confidence interval?
- If the remaining 52% plan to vote for Candidate B (ignoring undecided), can the poll declare a winner? Why or why not?
- If the confidence level is 95%, what does the margin of error tell you about the sample size? (Work backward from the MOE formula for proportions.)
Guidance
1. The CI is (45%, 51%). 2. No. The CI includes values both below and above 50%. Candidate A might actually have anywhere from 45% to 51% support. Since 50% is inside the interval, the race is "too close to call." 3. MOE = z* × √(p(1-p)/n). So 0.03 = 1.96 × √(0.48 × 0.52 / n). Solving: √(0.2496/n) = 0.0153 → 0.2496/n = 0.000234 → n = 1,067. The poll surveyed about 1,067 people.Exercise 22.13 — Sensitivity of CI to outliers ⭐⭐
Consider a sample of 20 vaccination rates: [65, 72, 68, 74, 71, 69, 73, 70, 66, 75, 72, 68, 70, 71, 73, 67, 69, 74, 71, 70]
- Compute the mean, standard deviation, and 95% CI.
- Now add a single outlier: append the value 15 to the dataset. Recompute the mean, standard deviation, and 95% CI.
- How much did the CI change? Is the mean or the CI width more affected by the outlier?
- Would a bootstrap CI for the median be more resistant to this outlier? Why?
Guidance
1. Mean = 70.4, SD ≈ 2.74, SE ≈ 0.613, 95% CI ≈ (69.1, 71.7). 2. With the outlier: Mean ≈ 67.76, SD ≈ 12.44, SE ≈ 2.716, 95% CI ≈ (62.1, 73.4). Both the center and width changed dramatically. 3. The mean shifted by about 2.6 points, and the interval width went from ~2.6 to ~11.3 — a 4x increase. The width is more dramatically affected because the outlier inflates the standard deviation. 4. Yes. The median of the original data is about 70.5; adding 15 would change it to about 70. The bootstrap CI for the median would be barely affected because the median is a resistant statistic.Part C: Coding Exercises ⭐⭐–⭐⭐⭐
Exercise 22.14 — Simulate the sampling distribution ⭐⭐
Write a Python script that:
- Creates a population of 5,000 values drawn from a right-skewed distribution (e.g.,
np.random.exponential(scale=50, size=5000)) - Draws 10,000 random samples of size n = 30
- Computes the mean of each sample
- Plots: (a) the population histogram, (b) the histogram of sample means
- Annotates the plots with the population mean and the standard deviation of the sample means (the standard error)
Verify that the sampling distribution is approximately normal even though the population is skewed.
Guidance
The Central Limit Theorem guarantees that the sampling distribution of the mean will be approximately normal for n ≥ 30, regardless of the shape of the population distribution. Your histogram of sample means should look bell-shaped even though the exponential population is heavily right-skewed. The standard deviation of the sample means should be close to σ/√30.Exercise 22.15 — Bootstrap from scratch ⭐⭐
Implement the bootstrap procedure without using any library function for bootstrapping:
- Start with this sample:
sample = [23, 45, 67, 12, 89, 34, 56, 78, 90, 43, 21, 65, 77, 54, 38] - Write a function
bootstrap_ci(data, stat_func, n_boot=10000, confidence=0.95)that: - Takes a data array, a function to compute a statistic, the number of bootstrap samples, and a confidence level - Returns the bootstrap confidence interval using the percentile method - Use your function to compute 95% CIs for: the mean, the median, the standard deviation, and the interquartile range (75th percentile minus 25th percentile)
Guidance
def bootstrap_ci(data, stat_func, n_boot=10000, confidence=0.95):
data = np.array(data)
boot_stats = []
for _ in range(n_boot):
boot_sample = np.random.choice(data, size=len(data), replace=True)
boot_stats.append(stat_func(boot_sample))
boot_stats = np.array(boot_stats)
alpha = 1 - confidence
lower = np.percentile(boot_stats, 100 * alpha / 2)
upper = np.percentile(boot_stats, 100 * (1 - alpha / 2))
return (lower, upper)
For the IQR, use `stat_func=lambda x: np.percentile(x, 75) - np.percentile(x, 25)`.
Exercise 22.16 — Visualize CI coverage ⭐⭐
Create a simulation that visualizes the "coverage" property of confidence intervals:
- Create a population with known mean and standard deviation
- Draw 200 samples of size 25
- For each sample, compute a 90% confidence interval
- Plot all 200 intervals as horizontal lines, colored blue if they contain the true mean and red if they don't
- Count what percentage contain the true mean. Is it close to 90%?
- Repeat with 95% and 99% intervals. Does the coverage match the nominal level?
Guidance
You should see approximately 90%, 95%, and 99% of the intervals containing the true mean, respectively. Minor deviations are expected due to randomness. If the coverage is consistently too low (e.g., 88% for a nominal 90%), it might indicate the sample size is too small for the normal approximation — try using the t-distribution instead of z.Exercise 22.17 — Effect of sample size on CI width ⭐⭐
Write code that:
- Creates a fixed population (e.g., normally distributed with mean=100, std=20, size=10000)
- For sample sizes n = 5, 10, 20, 50, 100, 200, 500, 1000: - Draws 1,000 samples of that size - Computes the average width of the 95% CI across all 1,000 samples
- Plots sample size (x-axis) vs. average CI width (y-axis)
- On the same plot, overlay the theoretical CI width: $2 \times 1.96 \times \sigma / \sqrt{n}$
- Add a second y-axis showing the margin of error as a percentage of the mean
Describe the pattern you see. At what sample size does the CI become "usefully narrow" for practical purposes?
Guidance
The plot should show a curve that decreases steeply at first and then flattens out — the classic diminishing returns shape. The simulated points should closely follow the theoretical curve. "Usefully narrow" is subjective and depends on context, but a margin of error of about 5% of the mean is often a practical target. For mean=100 and std=20, a CI width of about 10 (MOE=5) requires n ≈ 62.Exercise 22.18 — Stratified vs. simple random sampling simulation ⭐⭐⭐
Create a simulation comparing the precision of simple random sampling vs. stratified sampling:
- Create a population of 1,000 individuals in 4 groups: - Group A (250 people): mean=40, std=5 - Group B (250 people): mean=60, std=5 - Group C (250 people): mean=80, std=5 - Group D (250 people): mean=100, std=5
- For sample size n = 40: - Draw 5,000 simple random samples and compute the sample mean each time - Draw 5,000 stratified random samples (10 from each group) and compute the sample mean each time
- Compare the standard deviations of the two sets of sample means
- Which method gives more precise estimates? Why?
Guidance
Stratified sampling will give substantially more precise estimates (smaller standard error) because the strata are very different from each other. By guaranteeing proportional representation of each group, stratified sampling eliminates the between-group variability from the sampling error. The standard error of the stratified mean should be roughly the within-group standard deviation divided by √n, while the SRS standard error includes both within- and between-group variability.Exercise 22.19 — Bootstrap for a correlation coefficient ⭐⭐⭐
Using the following data on GDP per capita and vaccination rates:
gdp = [2100, 5400, 12000, 18000, 25000, 33000, 41000, 48000, 3200, 7800,
15000, 22000, 29000, 38000, 45000, 52000, 4500, 9200, 16500, 27000]
vax = [45, 55, 62, 70, 75, 82, 88, 91, 48, 58,
65, 72, 78, 85, 89, 93, 52, 60, 68, 76]
- Compute the Pearson correlation coefficient between GDP and vaccination rate
- Use the bootstrap (10,000 resamples) to compute a 95% CI for the correlation
- Does the CI include zero? What does this tell you?
- Create a histogram of the bootstrap correlation values and mark the CI boundaries
Guidance
The correlation should be high (around 0.98-0.99). The bootstrap CI should be narrow and well above zero, indicating strong evidence of a positive relationship. When bootstrapping pairs of variables, remember to resample the (GDP, vaccination) pairs together — don't resample each variable independently! Use indices to select paired observations.Part D: Synthesis and Critical Thinking ⭐⭐⭐–⭐⭐⭐⭐
Exercise 22.20 — The paradox of precision ⭐⭐⭐
Consider these two scenarios:
- Scenario A: A carefully designed random sample of 200 people gives a 95% CI of (45%, 55%) for voter support.
- Scenario B: A convenience sample of 50,000 people from a website gives a 95% CI of (52.8%, 53.2%) for voter support.
- Which interval is narrower?
- Which result should you trust more? Why?
- Write a paragraph explaining why the formulas can produce misleadingly narrow intervals for biased samples.
- If you had to advise a newspaper editor about which poll to report, what would you say?
Guidance
Scenario B has a much narrower interval, but it should be trusted *less* because a convenience sample of website visitors is almost certainly biased. The standard error formula assumes a random sample; applied to a biased sample, it dramatically understates the true uncertainty. The "margin of error" in the formula only captures *sampling variability* (the randomness from which 50,000 people happened to visit), not *bias* (the systematic tendency for website visitors to differ from the general population). The narrow interval gives a false sense of precision. You should advise the editor to report Scenario A, with an explanation that a wider interval from a proper sample is more informative than a narrow interval from a flawed one.Exercise 22.21 — Designing a sampling plan ⭐⭐⭐
You've been hired to estimate the average amount of food waste per household in a city of 500,000 households. You have a budget of $50,000, and each household visit costs $100 (for weighing trash, conducting interviews, etc.).
- What is the maximum sample size you can afford?
- If prior research suggests the standard deviation of food waste is about 4 kg/week, what margin of error can you achieve at 95% confidence?
- Your boss wants a margin of error of 0.3 kg. What sample size would that require? Can you afford it?
- Propose a realistic sampling plan that balances cost, precision, and representativeness. What sampling method would you use? How would you address potential biases?
Guidance
1. $50,000 / $100 = 500 households maximum. 2. SE = 4/√500 = 0.179. MOE = 1.96 × 0.179 = 0.351 kg. So about ±0.35 kg. 3. n = (1.96 × 4 / 0.3)² = (26.13)² = 682.9 → 683 households. That would cost $68,300 — over budget. 4. Consider stratified sampling by neighborhood type (urban apartments, suburban houses, etc.) to reduce variability within strata. Consider multi-stage cluster sampling (randomly select neighborhoods, then randomly select households within neighborhoods) to reduce travel costs. Address non-response bias by offering incentives and making multiple visit attempts. Acknowledge that households who agree to participate may differ from those who don't.Exercise 22.22 — When CIs mislead: the issue of multiple comparisons ⭐⭐⭐
You compute 95% confidence intervals for vaccination rates in 20 different countries, each based on independent samples.
- For any single interval, what's the probability it misses the true value?
- If you compute 20 independent intervals, what's the probability that at least one misses? (Use 1 - 0.95²⁰.)
- What does this imply about looking at many CIs simultaneously?
- Look up the "Bonferroni correction." How does it address this problem?
Guidance
1. 5% (by definition of a 95% CI). 2. P(at least one miss) = 1 - 0.95²⁰ = 1 - 0.358 = 0.642. There's a 64% chance that at least one of the 20 intervals misses! 3. When you examine many intervals, some will miss by chance. This is the multiple comparisons problem. You should expect about 1 in 20 intervals to miss even if everything is working correctly. 4. The Bonferroni correction adjusts the confidence level for each individual interval. Instead of using 95% for each, you'd use 1 - 0.05/20 = 99.75% for each, so that the overall probability of *any* interval missing is still about 5%. This makes each interval wider, which is the price of maintaining overall coverage.Exercise 22.23 — Bayesian vs. frequentist confidence ⭐⭐⭐⭐
This chapter presented the frequentist interpretation of confidence intervals. There is an alternative framework called Bayesian inference that uses credible intervals.
- Research the difference between a 95% frequentist confidence interval and a 95% Bayesian credible interval.
- A Bayesian 95% credible interval can be interpreted as: "There is a 95% probability that the parameter is in this interval." Why is this different from the frequentist interpretation?
- What additional information does the Bayesian approach require (hint: a prior distribution)?
- In what situations might the Bayesian approach be more intuitive or practical?
Guidance
The key difference: a frequentist CI makes a statement about the *procedure* (95% of intervals built this way will contain the truth), while a Bayesian credible interval makes a statement about the *parameter* (given the data and our prior beliefs, there's a 95% probability the parameter is in this range). The Bayesian approach requires a prior distribution representing beliefs about the parameter before seeing the data. The Bayesian interpretation is closer to what most people intuitively want — a direct probability statement about the parameter — which is why many practitioners prefer it. However, the choice of prior can be controversial when there's genuine disagreement about pre-data beliefs.Exercise 22.24 — Project extension: Regional comparisons with CIs ⭐⭐⭐
Extend the progressive project analysis from Section 22.9:
- Load your vaccination dataset (or create a realistic simulated version)
- Compute 95% confidence intervals for the mean vaccination rate for each of the 6 WHO regions
- Create a visualization showing all 6 CIs side by side, with clear labels
- Identify which pairs of regions have non-overlapping CIs (suggesting significant differences)
- Compute bootstrap CIs for the median vaccination rate by region and compare to the mean CIs
- Write a 2-paragraph interpretation suitable for a non-technical audience
Guidance
Follow the approach in Section 22.9 of the chapter. For the bootstrap median CIs, resample within each region separately. When comparing mean and median CIs, note that they may differ substantially for skewed distributions (e.g., if a few countries have very low vaccination rates, the median will be higher than the mean, and the median CI may be narrower). Your non-technical summary should avoid jargon like "standard error" and instead say something like "we're fairly confident that the true average vaccination rate in Africa is between X% and Y%."Exercise 22.25 — The ethics of uncertainty communication ⭐⭐⭐⭐
Read this scenario: A government health agency reports that "the national vaccination rate is 72%." They do not report a confidence interval or margin of error, even though the number is based on a sample survey, not a census.
- Why might the agency choose not to report uncertainty? (Consider both practical and strategic reasons.)
- What are the risks of omitting uncertainty information?
- Design a simple, non-technical way to communicate vaccination coverage with appropriate uncertainty — something that could appear on a government dashboard or in a press release.
- Write a brief argument (3-4 sentences) for why all published statistics should include some measure of uncertainty.