This appendix collects answers to the odd-numbered practice problems from every chapter, so you can check your work as you study. Answers are grouped by chapter and listed in numeric order; this page is the single place to find them.
1How to use these answers¶
Try the problem fully first. Look here only after a genuine attempt — the learning is in the struggle, not the answer.
Check the reasoning, not just the number. If your final value matches but you are unsure why, re-read the worked example in the chapter that the problem follows.
A mismatch is information. When your answer differs, redo the problem slowly; the most common slips are using instead of , mixing up a one- vs. two-sided test, or rounding too early. Keep full precision until the final step.
Numbers here are reproducible. Every numeric answer was computed with R (the same
mosaicandBSDAfunctions you use) or independently re-derived during verification — none were estimated by hand. Where rounding matters, the chapter states its convention (typically 2–4 significant figures).
2Numbering convention¶
Practice problems are auto-numbered within each chapter in the order they appear. “Odd-numbered” means problems 1, 3, 5, 7, … of that chapter’s practice set. A reference like “Ch. 7, #9” points to the ninth practice problem in Chapter 7. Answers below are grouped by chapter and listed in numeric order.
3Chapter 1 — Data & Study Design¶
1. The population is the entire collection you want to learn about; the sample is the subset you actually measure. Example: population = every census tract in Kern County (or every Bakersfield summer day); sample = the handful of tracts (or days) you happen to draw and record.
3. (a) year — categorical, ordinal (ordered standings). (b) total_pop
— numerical, discrete (a count of people). (c) pm25 — numerical,
continuous (a measurement). (d) commodity — categorical, nominal.
5. It is an observational study (no tract was assigned its pollution level). The strongest honest claim is an association: in Kern, tracts with higher PM2.5 tend to have higher asthma rates. It cannot establish causation.
7. The two questions are: (1) Were units randomly assigned to groups? ( causal claims possible.) (2) Were units randomly sampled from a population? ( generalization possible.) For a randomized study-methods experiment in one professor’s class: assignment = yes (causal claim possible within the study), sampling = no (a convenience group), so results generalize only cautiously beyond that class.
9. sum(is.na(read.csv("data/processed/kern_calenviroscreen.csv")$poverty)) returns 4:
four Kern tracts are missing the poverty value (OEHHA suppression for small
tracts), as computed in the chapter from kern_calenviroscreen.
11. A biased method tilts every observation in the same direction, so adding more biased observations makes the estimate more precise around the wrong value. Bias is a flaw in the design, not in the sample size; only fixing how the data are collected removes it.
13. Example answers: (a) continuous numerical — pm25 (µg/m³);
(b) discrete numerical — total_pop (count of people); (c) ordinal categorical —
year (Freshman… Senior); (d) nominal categorical — major or commodity.
15. Because the missingness is not at random: OEHHA suppresses scores for very small tracts, so dropping those 4 rows systematically removes small (often rural) places. Any conclusion then silently excludes them — a missing-not-at- random bias, not a harmless deletion.
17. A randomized experiment (volunteers randomly assigned to walking vs. control). Scope: random assignment is present it can support a causal claim about the walking program; random sampling is absent (volunteers) the result generalizes only cautiously beyond people like these volunteers.
19. Association means the two variables move together (knowing one tells you something about the other); causation means changing one produces a change in the other. Observational Kern data can establish only the association between PM2.5 and asthma, because confounders are not controlled.
21. Sampling bias (8 a.m.-class students are not representative — they may sleep less, or differ in schedule/work). Likely direction: the estimate of average sleep is biased downward (too low) if early-class students sleep less than the student body overall.
23. survey <- read.csv("data/processed/firstday_survey_sim.csv"); mean(survey$work_hours_week > 0 & !is.na(survey$work_hours_week)) returns
0.56, i.e. 56.0% of all 150 students report paid work — 84 of 150,
treating the 4 missing work values as not known to be working (computed in the
chapter from the simulated firstday_survey_sim).
25. It is observational (students chose to use tutoring; no random assignment). A confounder: motivation (or prior preparation) — more motivated students both seek tutoring and earn higher grades — so tutoring need not be the cause of the grade difference.
27. In a statistically “average” county you would expect about 25% of tracts above the statewide 75th percentile. Kern has about 49.7% (73 of 147 scored tracts), roughly double — suggesting Kern tracts are concentrated toward the high-burden end of California’s distribution.
29. (a) cluster (whole schools chosen, all students measured); (b) convenience (first 50 seen); (c) simple random (random draw from the full list); (d) stratified (a fixed number from each region/stratum).
4Chapter 2 — Summarizing Numerical Data¶
1. Mean . Median: sorted , middle value . So mean = 6, median = 7.
3. Range . Deviations from mean 6: ; squares sum to 52. Variance ; SD .
5. Mean .
7. Right-skewed. The mean (50) exceeds the median (38); a longer right tail of large values pulls the mean above the middle value.
9. Mean: rises a lot. Median: barely changes. SD: rises a lot. IQR: barely changes. (The mean and SD are sensitive to the extreme value; the median and IQR are resistant.)
11. Yes — the middle half is right-skewed. The median (15) sits much closer to (12) than to (28), so the upper quarter of the box is stretched out, indicating a longer right side.
13. Side-by-side boxplots. They place each neighborhood’s center, spread, and outliers on a common scale so all four distributions can be compared at a glance in one figure.
15. IQR . Upper fence ; lower fence . Since , the value 75 is flagged as a high-side outlier.
17. Mean µg/m³, median µg/m³ (dataset-derived from kern_airquality). Because the mean exceeds the median, the distribution is right-skewed (longer tail toward dirty days).
19. , , IQR ; upper fence µg/m³. 80 monitor-days are flagged as high-side outliers (dataset-derived from kern_airquality).
21. (Open response — sample answer.) The distribution is strongly right-skewed, centered near a median of about 7.6 µg/m³ (mean about 9.3), with most days clustered below 15 and a long thin tail of dirtier days reaching past 60; spread is wide (SD ≈ 7.6 µg/m³).
23. Removing the single worst day (63.7 µg/m³) would change the median almost not at all — the median depends only on the middle position, and dropping one of 1,554 values barely shifts it. The mean would drop slightly because the mean feels every value, but with one value carries little weight, so the change is small (about µg/m³ less, before re-centering).
25. It hides the skew / the gap between mean and typical day (most days are below 9.3, and a few smoky days inflate the average). Fix: add a sentence such as “but the typical (median) day was about 7.6 µg/m³, with a handful of high-pollution days pulling the average up.”
27. , i.e. about 82% (dataset-derived from kern_airquality). Relative spread expresses variability as a fraction of the mean, so it is unitless and lets you compare variability across variables measured on different scales or in different units — something the SD alone (which keeps the original units) cannot do.
29. Put the median (7.56) and IQR (7.70) in the headline: for skewed air-quality data they describe the typical day honestly and resist the few extreme days. Put the mean (9.30) and SD (7.63) in a technical appendix, where the total burden and full variability are documented for analysts. (A complete answer may justify the reverse as long as it correctly notes the skew.)
5Chapter 3 — Summarizing Categorical Data & Tables¶
All numbers computed from kern_crops_sim (simulated; see
data/codebooks/kern_crops_sim.md) or from the given counts.
1. 8 commodities. Each has proportion (12.50%). They are all equal because the dataset is a balanced panel: every commodity appears exactly once per year for all 9 years.
3. NUTS has the largest 2023 acreage share at 60.63% (almonds 37.49% + pistachios 23.14%).
5. Sorted tallest to shortest, ALMONDS (212,747 acres) and PISTACHIOS (131,290 acres) top the chart.
7. Grand total = 72. It equals 72 because every one of the 72 rows (8 commodities × 9 years) lands in exactly one (category, value-tier) cell, so the cell counts sum to the number of rows.
9. .
11. Conditional , most to least likely: NUTS 1.0000 > CITRUS 0.5556 > FRUIT 0.3333 > VEGETABLE 0.2222 > FIELD CROP 0.0000.
13. The NUTS bar is entirely one color (all High value): its conditional distribution is 100% high-value, 0% lower-value. (FIELD CROP is also a single color, entirely Lower value.)
15. ; ; difference = 0.6667.
17. Proportions: Freshman 0.35, Sophomore 0.27, Junior 0.22, Senior 0.16 (percents 35%, 27%, 22%, 16%). Upper-division (Junior + Senior) share = (38%).
19. ; . The conditional proportions differ (0.64 vs. 0.40), so treatment and outcome are associated.
21. ALMONDS and PISTACHIOS are each high-value in all 9 of their crop-years.
23. In a frequency table sorted by descending count, the cumulative percent at the second row is the combined share of the two most common categories — the percent of observations accounted for by the top two categories together.
25. (Communication — sample answer.) “Counting harvested acres, nut crops made up about 61% of the cropland in this dataset for 2023, with almonds alone at roughly 37% and pistachios at 23%. Fruit and citrus each accounted for about 14%, and field crops and vegetables together for under 12%. These are shares of acreage, and they describe what was grown — not why.” (Names the unit, uses proportions, no causal language.)
6Chapter 4 — Probability Foundations¶
1. ; complement .
3. ; complement .
5. Disjoint, so .
7. Not disjoint: , so and can both occur.
9. .
11. Not independent: while . Since the conditional differs from the marginal, the events are dependent.
13. Independent, so .
15. asks how often sick people test positive; asks how often positive testers are actually sick. They condition on different things and depend on how common the disease is, so they are generally not equal.
17. . Since this differs from , working and commuting do not appear independent.
19. (Simulation.) Example: set.seed(2200); mean(replicate(20000, any(sample(day$daily_mean, 5, replace = TRUE) > 35))). Report the resulting fraction (it should be a small positive number; the seed value is 2200).
21. Outcomes: , . so ; so .
23. Independent goods: .
25. Complement rule: .
27. Because a sample only observes finitely many repetitions, varies from sample to sample and lands near — but not exactly on — the true long-run probability; it is an estimate that improves as grows.
29. Independent: , so the product rule holds exactly.
7Chapter 5 — Random Variables & the Normal Model¶
1. E(X) = 0(0.5) + 1(0.3) + 2(0.2) = 0.7.
3. A discrete random variable takes separated, listable values (e.g. the number of heads in 3 coin flips: 0, 1, 2, or 3). A continuous random variable can take any value in an interval (e.g. a person’s height, which could be 175.79 cm or anything between).
5. z = (66 − 50)/8 = 2.0 (66 is 2 SDs above the mean).
7. Under a Normal model, about 68% of values lie within 1 standard deviation of the mean, about 95% within 2, and about 99.7% within 3.
9. P(X ≤ 168) = pnorm(168, 175.79, 7.48) ≈ 0.1488 (about 15% of adult men are 168 cm or shorter).
11. 25th percentile of female height = qnorm(0.25, 162.04, 7.30) ≈ 157.12 cm.
13. 95th percentile = qnorm(0.95, 500, 100) ≈ 664.49 (round to about 664).
15. A z-score is a value minus the mean, divided by the standard deviation, so the units cancel — it is a pure count of standard deviations. z = −2 means the value lies 2 standard deviations below the mean.
17. P(X = 4) = dbinom(4, 8, 0.5) ≈ 0.2734.
19. P(exactly 2 of 6) = dbinom(2, 6, 0.27) ≈ 0.3105.
21. Binary trials, Independent trials, fixed Number of trials, Same success probability on each trial.
23.
air <- read.csv("data/processed/kern_airquality.csv")
ozone <- subset(air, pollutant == "Ozone")
gf_histogram(~ daily_max, data = ozone, bins = 30, fill = "#0072B2", color = "white")25. No. A mean (40) far above the median (12) signals a strong right skew, which is incompatible with the symmetric Normal model. (A symmetric distribution has mean ≈ median.)
27. The expected value is a long-run average over many repetitions; it need not be an outcome that can occur on any single trial. Averaging 0, 1, 2, 3 days with their probabilities gives 0.9, even though you can never observe 0.9 days on one weekend.
29. IQR = qnorm(0.75, 175.79, 7.48) − qnorm(0.25, 175.79, 7.48) ≈ 180.84 − 170.74 ≈ 10.09 cm.
8Chapter 6 — Sampling Distributions & the CLT¶
1. A sample distribution is the spread of the raw values in one collected sample (e.g. the PM2.5 readings of 30 specific days). A sampling distribution is the spread of a statistic (e.g. the mean of 10 days) across many samples. The first has measurements on its axis; the second has a computed statistic.
3. False. The CLT is about the sample mean, not the data. The raw data keep their shape (PM2.5 stays right-skewed); only x̄ becomes approximately normal as n grows.
5. The SE changes by a factor of 1/2. Quadrupling n (25100) multiplies √n by 2, so σ/√n is halved.
7. np = (0.05)(120) = 6 < 10, so the success–failure condition fails. The normal approximation for p̂ is not appropriate; successes are too rare for this n.
9. SE = 2.41, so by the 68–95–99.7 rule about 95% of 10-day means fall within ±2(2.41) of 9.30, i.e. roughly 4.5 to 14.1 µg/m³.
11. SE(x̄) = 20.19/√36 = 20.19/6 = 3.36 cm.
13. set.seed(2200); do(4000) * mean(~daily_mean, data = resample(pm, 25)) (with pm <- subset(read.csv("data/processed/kern_airquality.csv"), pollutant == "PM2.5")).
15. SE = σ/√n n = (σ/SE)² = (7.63/1.08)² ≈ 50 (the sampling distribution came from n = 50).
17. As n grows from 2 to 50, the histogram of x̄ gets narrower (SE shrinks like 1/√n), more symmetric, and more bell-shaped, while staying centered near the population mean.
19. A parameter describes the whole population and is usually fixed/unknown (μ, the population mean). A statistic is computed from a sample and varies sample to sample (x̄, the sample mean); we use the statistic to estimate the parameter.
21. Setting a seed makes the random draws reproducible: the book, app, lab, and grader all get identical simulated samples, so results can be checked exactly.
23. SE = 7.63/√64 = 7.63/8 = 0.954 µg/m³. At n = 4, SE = 7.63/2 = 3.81; so the n = 64 SE is 4 times smaller (√(64/4) = 4).
25. Averaging cancels highs against lows: extreme single days (near 0 or past 60) rarely all land in the same 10-day sample, so 10-day means cluster much more tightly (~4 to 16) than raw days. Spread of the mean = σ/√n, smaller than σ.
27. Solve SE⋆ = σ/√n for n: n = (σ / SE⋆)².
29. The CLT bundles three claims about the sampling distribution of x̄: center = μ (unbiased), spread = σ/√n (standard error), and shape ≈ normal for large n regardless of the population’s shape.
9Chapter 7 — Confidence Intervals¶
1. A single sample mean is almost certainly off the true mean by some unknown amount; a confidence interval admits that by reporting a range of plausible values rather than pretending the point estimate is exact.
3. False. Higher confidence requires a wider net, so a 99% interval is wider than a 90% interval built from the same data — the relationship is the reverse of what the statement claims.
5. Point estimate ; margin of error percentage points; implied 95% confidence interval .
7. ; ; interval .
9. 90% interval: . 99% interval: . The 99% interval is widest because a higher confidence level needs a larger critical value, hence a larger margin of error.
11. is the midpoint, thousand jobs; is the half-width, thousand jobs. So the interval is .
13. Success–failure: and , so the condition holds. ; ; interval .
15. Yes, includes 0.50. Because a plausible-values range for contains one-half, the data are consistent with “about half of scored Kern tracts are high-burden”; we cannot rule out exactly 50%.
17. , round up to .
19. , round up to .
21. t.test(~ces_total_nonfarm_thsd, data = read.csv("data/processed/kern_energy_employment.csv"), conf.level = 0.90)
23. About 0.80 of the intervals would capture the truth (an 80% procedure covers ~80% of the time), and each interval would be narrower, because a lower confidence level uses a smaller critical value.
25. tsum.test(mean.x = 8.61, s.x = 1.271, n.x = 10, conf.level = 0.95); expected
95% interval thousand jobs, matching the raw-data result because
the summary statistics are the same ones the raw data produce.
10Chapter 8 — Hypothesis Testing Logic¶
1. In words: says coaching does not change mean daily active minutes; says it does change them. In symbols: versus .
3. Hypotheses concern the unknown population value we want to learn about; the sample mean is already known once we have data, so there is nothing to test about it. We test claims about using as evidence.
5. A Type I error is concluding coaching changes active minutes when it truly does not (a false alarm). A Type II error is concluding coaching has no effect on active minutes when it truly does (a missed real effect).
7. False. The p-value is computed assuming the null is true, so it cannot also be the probability that the null is true. A p-value of 0.02 means: if the null were true, a result this extreme would occur about 2% of the time.
9. About standard deviations from 0 — far out in the tail, which is why no shuffle reached it and the p-value is below 0.0001.
11. Yes, consistent. A two-sided p-value just under 0.05 must pair with a 95% CI that just barely excludes 0; here the lower bound 0.003 is just above 0, matching p ≈ 0.043. Both say “reject, but only barely.”
13.
fit <- read.csv("data/processed/fitness_tracker_sim.csv")
hr <- fit$resting_hr; grp <- fit$group
obs <- mean(hr[grp == "treatment"]) - mean(hr[grp == "control"])
set.seed(2200)
nulls <- replicate(5000, {
s <- sample(grp)
mean(hr[s == "treatment"]) - mean(hr[s == "control"])
})
mean(abs(nulls) >= abs(obs)) # two-sided p-value15. Cohen’s means the two group means sit about 0.72 standard deviations apart — close to a “large” effect by common conventions. Roughly, a typical treatment student is more active than about three-quarters of control students.
17. The p-value changes only trivially (it stays below 0.0001). Random seeds change which shuffles you draw, but with 10,000 of them the null distribution is essentially the same each time, so a result this extreme is unreachable regardless of seed.
19. , . Observed difference ≈ 942 steps/day; randomization p ≈ 0.0018. Since , reject : coaching raised step count.
21. The evidence is essentially identical — 0.049 and 0.051 are indistinguishable in practical terms. This shows that treating 0.05 as a hard cutoff creates an artificial cliff between two nearly identical results; the p-value should be read as a continuous measure of evidence, not a pass/fail gate.
23. From t.test(active_minutes ~ group, data = fit): (a) the p-value (compared to — reject or fail to reject) gives the decision; (b) the 95 percent confidence interval for the difference gives the size of the effect (here about (5.46, 12.39) minutes), which the p-value alone cannot.
25. Picking the test direction after seeing which way the data went means you would have chosen the opposite one-sided test had the data gone the other way — so you are really testing both tails while only “paying” for one, which doubles the true Type I error rate above the stated . They should have either pre-registered the direction on theoretical grounds or used a two-sided test.
11Chapter 9 — Inference for Proportions¶
Kern values are computed from data/processed/kern_calenviroscreen.csv.
1. Each unit is coded 1 for a success and 0 for a failure, so the proportion is the average of those values; because it is a mean, the Central Limit Theorem applies and the sampling distribution of is approximately normal.
3. A test assumes is true, so it uses the hypothesized in the standard error (the null SE); a confidence interval makes no null assumption, so it estimates the SE from the data using (the Wald SE).
5. A -value is the probability of observing data at least as extreme as ours if the null hypothesis were true — not the probability that is true.
7. ; ; one-sided -value . Reject : strong evidence a majority own a laptop.
9. ; ; one-sided -value . Reject : evidence the coin is biased toward heads.
11. ; 95% CI . We are 95% confident 25.5%–34.5% of commuters use transit.
13. (a) Quadrupling halves the margin of error (width scales like ). (b) Raising confidence to 99% widens the interval ( rises from 1.96 to 2.576).
15. , so (round up).
17. ; 95% CI (unpooled SE) . The interval excludes 0, consistent with rejecting .
19. ; 95% CI . It excludes 0, consistent with the significant test in Problem 18.
21. With pm25 : ; ; one-sided
-value . Reject : a clear majority of Kern tracts
exceed 12 µg/m³.
23. With pm25 : , higher than the 0.7748 at
the 12 µg/m³ cutoff. Lowering the threshold counts more tracts as “high,” so the
proportion rises — the conclusion depends on the standard you choose.
25. Example: “About half of Kern County’s census tracts (an estimated 50%, 95% confidence interval 42%–58%) rank in the most-burdened quarter of all California neighborhoods — roughly double the statewide share of one in four — and this difference is far too large to be chance.”
27. Study B (n = 500) has the narrower 95% CI: with the same , a larger sample gives a smaller standard error () and thus a tighter interval.
29. A very large sample can make a trivial difference statistically significant. Example: a difference of 50.1% vs. 50.0% support across two million voters could yield a tiny -value yet have no practical consequence. Always read the confidence interval to judge the effect size.
12Chapter 10 — Inference for Means¶
1. One-sample, because there is one group of measurements (the nine yearly almond yields) compared to one fixed benchmark, μ₀ = 1 ton per acre. There is no second group of data, so a two-sample test does not apply.
3. SE = s/√n = 8/√16 = 8/4 = 2.0; t = (x̄ − μ₀)/SE = (48 − 50)/2 = −1.0; df = n − 1 = 15.
5. t.test(crops$yield_per_acre[crops$commodity == "PISTACHIOS"], mu = 1.2) (any equivalent that passes the pistachio yields and mu = 1.2 is correct).
7. We are 95% confident the program increases mean daily steps by somewhere between about 346 and 1,538 steps per day — a positive range that does not include zero, so the program plausibly adds a few hundred to about fifteen hundred steps a day on average.
9. SE = 0.20/√9 = 0.0667; t = (7.31 − 7)/0.0667 ≈ 4.65 on df = 8. Since |4.65| > t⋆ = 2.31, reject H₀: the mean table-grape yield differs from 7 tons/acre.
11. t.test(resting_hr ~ group, data = fit) (after fit <- read.csv("data/processed/fitness_tracker_sim.csv")).
13. A non-significant comparison shows two boxes at nearly the same height with heavy overlap — the medians sit close together and each box spans much of the other. Compared to Image, where the treatment box is clearly shifted up, a non-significant picture would have the boxes essentially level.
15. The numbers are simulated because the real USDA NASS feed needed an email-registered API key the build could not provision; presenting synthetic numbers as real would be fabrication (a hard rule). With a real NASS key the identical code would run on real Kern data and those measured values would replace the simulated ones — the method does not change.
17. With p = 0.048 < 0.05 we reject H₀: a detectable sleep difference. But 0.048 is barely below 0.05, the effect (≈0.27 hour ≈ 16 minutes) is small, and a slightly different sample could flip the decision — so treat it as weak, borderline evidence, not a large effect.
19. A p-value above 0.05 means we fail to reject H₀ — one ton per acre stays plausible — but it never proves μ equals exactly 1. The data are simply consistent with μ = 1 along with a whole interval of nearby values (here, 0.977 to 1.095).
21. H₀: μ_A − μ_B = 0 vs. H_A: μ_A − μ_B ≠ 0. SE = √(6²/40 + 5²/35) = √(0.900 + 0.714) ≈ 1.27 minutes. (The resulting t ≈ 3/1.27 ≈ 2.36 is significant, but only the SE was required.)
23. Individual crops can move sharply in opposite directions — pistachios and almonds up, cotton down — so the large positive and negative differences partly cancel, leaving a modest average change. With only eight crops, the big crop-to-crop spread (s_d ≈ 22,000 acres) makes the standard error large, so even an ~8,200-acre average change is small relative to its noise (p = 0.329).
25. Smaller. For t = 1.80 with H_A: μ > 100, the one-sided p-value uses only the upper tail, so it is exactly half the two-sided p-value for the same t (one-sided ≈ 0.042 vs. two-sided ≈ 0.084).
13Chapter 11 — Chi-Square Methods¶
Numbers are dataset-derived where noted (computed from data/processed/ and
independently cross-checked).
1. .
3. .
5. Expected counts ; they sum to 200. ✓
7. (the critical value), so reject at (barely significant).
9. Yes. With equal proportions and , , each expected count is , so the expected-count condition is met.
11. Observed quartile counts (Q1–Q4) , ;
goodness-of-fit vs. equal proportions gives , ,
— reject ; Kern tracts concentrate in the
top burden quartile. (Dataset-derived: kern_calenviroscreen.)
13. The Hispanic-majority / high-burden cell holds about 2.88 standard units more tracts than independence predicts — that combination is markedly over-represented in the table.
15. The table cross-classifies the five crop categories by two year-eras.
FIELD CROP and VEGETABLE each contain only one commodity, so their row totals are
small; under independence their expected counts (about 4) fall below 5, so
the expected-count condition is at risk and must be checked (it in fact fails for
those rows). (Dataset-derived: kern_crops_sim; smallest expected .)
17. Demographics-by-burden independence test: , ,
, Cramér’s V — reject independence;
the two are moderately strongly associated. (Dataset-derived:
kern_calenviroscreen.)
19. Expected count per face ; . The observed counts sit very close to 10, so is tiny in every cell and will be small — little evidence against a fair die.
21. Splitting at the medians of pm25 and education gives a
table; the test of independence yields , ,
— fail to reject: no evidence of association between high
PM2.5 and a high education gap at the tract level. (Dataset-derived:
kern_calenviroscreen.)
23. Expected counts (equal null) each; per-cell terms , so , .
25. Percentages discard the sample sizes the chi-square statistic depends on, so the same percentages from and would give the same (wrong) table of counts. They must supply the raw observed counts in each cell.
27. Every term in is a squared quantity divided by a positive expected count, so every term is ; a sum of non-negative terms cannot be negative.
29. : Kern’s census tracts are evenly split across the four statewide burden quartiles (each quartile holds one-quarter of the tracts). : at least one quartile holds a different share than one-quarter.
14Chapter 12 — ANOVA¶
1. (all five monitors have equal mean PM2.5). at least one monitor’s mean PM2.5 differs from the others.
3. . Group membership explains 30% of the total variation in the response.
5. ; ; ; ; .
7. comparisons; family-wise error .
9. on df, (dataset-derived, kern_airquality, three Bakersfield PM2.5 monitors).
11. With the five monitors having days (the three Bakersfield sites plus Mojave–Pat Avenue and Ridgecrest–Ward), , (dataset-derived, kern_airquality). Adding the cleaner desert monitors makes the differences far larger.
13. on df, : not significant; fail to reject .
15. A ratio of 3.1 exceeds 2, so the equal-variance (homogeneity) condition is threatened; use a Welch ANOVA (oneway.test(y ~ g, var.equal = FALSE)).
17. Tons/acre and bales/acre are different units of measurement, so the groups are not on a common scale; the resulting would reflect the unit mismatch, not a real difference in productivity.
19. comparisons; Bonferroni per-test threshold .
21. Only California Avenue vs. Golden / M Street is significant after Tukey adjustment (adjusted ; Golden runs about 1.76 µg/m³ higher) — dataset-derived, kern_airquality.
23. The analyst who runs ANOVA controls the error rate: one omnibus test holds the overall false-positive risk at 5%, whereas cherry-picking the single “significant” pair from 10 unadjusted tests inflates the family-wise error to about 40%.
25. (Open response.) A strong answer states that the three Bakersfield monitors’ average daily PM2.5 do differ statistically (), that the gap traces mainly to Golden/M Street reading about 1.8 µg/m³ higher than California Avenue, but that the monitor explains under 1% of the day-to-day variation () — so location matters far less than the season. Plain language, no jargon, both the difference and its small size reported honestly.
15Chapter 13 — Correlation & Linear Regression¶
1. is a unit-free number between −1 and +1; its sign gives the direction of the linear relationship (+ upward, − downward) and its magnitude gives the strength (0 = no linear pattern, 1 = points exactly on a line).
3. (crude vs. unemployment rate, from kern_energy_employment). It is positive but only weak-to-moderate in strength — much weaker than the oilfield-jobs correlation.
5. thousand jobs (about 7,810 oilfield jobs).
7. Because (zero production) is far outside the observed range (110–201 million barrels). Reporting the intercept as a real job count is extrapolation; here it is only a mathematical anchor for the line.
9. “About 73% of the year-to-year variation in oilfield employment is explained by crude-production levels; the remaining 27% reflects other factors.” (Based on kern_energy_employment.)
11. A residual is the vertical distance between an observed value and the line’s predicted value, . When a straight line fits well, residuals scatter randomly around zero with no curve and constant spread.
13. An outlier has a large residual (far from the line in the direction); a high-leverage point has an extreme value. A point is influential when removing it noticeably changes the slope or intercept — usually a high-leverage point that is also off the trend.
15. versus . claims there is no linear relationship between the variables — the true slope is zero, so the apparent tilt is just sampling noise.
17. Linearity, Independence, Normal residuals, Equal spread. Independence is most questionable here: the rows are consecutive years of one county, so observations may be correlated across time.
19. (crude vs. oil-sector share of payroll, kern_energy_employment) — stronger than the with oilfield job counts. Likely because the share also reflects the falling total payroll denominator, so both numerator and denominator move with the oil decline, sharpening the linear pattern.
21. Slope thousand jobs per million barrels (kern_energy_employment). The sign is negative — opposite the oilfield-jobs slope — because as oil production declined the Bakersfield economy diversified, adding non-oil jobs, so total payroll rose while oil fell.
23. Misconception: is not a “percent of predictions correct.” means the line explains about 73% of the variation in the response; it is about variance explained, not a hit rate.
25. Rescaling leaves , , and the slope’s p-value unchanged (they are scale-invariant), but the slope changes — dividing by 1000 multiplies the slope by 1000, since slope carries the units “jobs per -unit.”
27. Example: ice-cream sales and number of sunburns (both rise in summer). Ice cream does not cause sunburns; the lurking variable is hot, sunny weather, which drives both. (Other valid answers: shoe size and reading ability in children age.)
29. . The correlation says the relationship is positive and moderate; says the line explains only 16% of the variation — a reminder that a moderate-looking can leave most variation unexplained.