
choose an appropriate inference procedure from the structure of a question and its data, and write a clear, reproducible statistical report.
Instruction
You now have about a dozen procedures. The hard part in real work is choosing one, not computing it. Ask four questions in order.
- What is the goal? To estimate a parameter (confidence interval) or to test a claim (significance test)? Usually report both: a test for the evidence, an interval for the size.
- What type of variable? Categorical (proportions, counts) or quantitative (means, slopes)?
- How many groups or variables, and how are they structured? One group; two independent groups; paired data; several groups or categories; two quantitative variables.
- How were the data produced? Random sampling, random assignment, or neither. This decides the scope, and whether inference is meaningful at all.
The map.
| Data structure | Procedure |
|---|---|
| One proportion | One-proportion z-interval / z-test |
| Two proportions (independent groups) | Two-proportion z-interval / z-test |
| One categorical variable, several categories, against a model | χ2 goodness of fit |
| Two categorical variables (or one across several groups) | χ2 independence / homogeneity |
| One mean | One-sample t-interval / t-test |
| Paired measurements | Paired t on the differences |
| Two independent means | Two-sample t-interval / t-test |
| Two quantitative variables, linear relationship | t-interval / t-test for the regression slope |
| Small randomized experiment, doubtful conditions | Randomization test |
Worked choices.
- Is the proportion of rainy days at St. Louis different in 2013-2024 from 2000-2012? Two groups of days, categorical response: two-proportion z. Days are not independent draws, so note that.
- Do St. Louis and Springfield differ in annual temperature? Same years at both stations: paired t, not two-sample.
- Is the CDC cancer death rate in Missouri declining? Rate against year: slope inference, with the residual checks from Lesson 4.3.
- Is the distribution of rainy days across seasons the same at St. Louis and Kansas City? Several categories, two groups: χ2 homogeneity.
When not to do inference. If you have the entire population (all 9,132 St. Louis days, when your question is about those days), the parameter is simply computed. There is nothing to infer. Inference is for generalizing beyond the data to a population or a process. And if the data are a convenience sample, a P-value measures nothing meaningful about any population. Say so, and describe instead.
Writing it up (A2.DS.A.7). A report that another person can check has these parts: Question; Data (source, URL, retrieval date, station or table IDs, how the data were produced, cleaning steps and missing values); Exploration (displays and summaries); Method (procedure, why, conditions with evidence); Results (statistic, P-value, interval, all in context units); Conclusion (in plain language, with scope); Limitations; and a reproducibility appendix listing every step, from download to final number, so that a careful reader can reproduce your numbers exactly. In a spreadsheet, keep raw data on one sheet and formulas on another. In Python, a notebook is itself the appendix.
Plain language. Write the conclusion for a reader who has never taken statistics, then give the technical support. “Winter rain in St. Louis is much more likely the day after a rainy day (43% versus 25%)” comes first. “χ2 = 68.8, df = 1” comes second.
📖 Read for this lesson
The reading opens over the lesson; close it to come back to exactly where you were. The checks below draw on it.
Formative check
Work through these before moving on. They are not graded — they tell you whether the standard below has landed yet.
A student records the same 25 volunteers’ reaction times before and after a caffeine-free energy drink. Which procedure fits?
Two categorical variables
Tap to revealχ² test of independence / homogeneity.
Same units measured twice
Tap to revealPaired t on differences.
Trend in y against x
Tap to revealt-test / interval for the slope.
Counts against a model
Tap to revealχ² goodness of fit.
Whole population in hand
Tap to revealCompute the parameter; no inference needed.
Simulation & tools
Optional: a reproducible analysis notebook
Open JupyterLite (runs in the browser; nothing to install) and create a Python notebook.
- Load a small data table: paste the St. Louis winter persistence counts [[294, 394], [396, 1172]] into a list.
- Write code that computes the row and column totals, the expected counts, χ2 and the conditional proportions, using only basic Python (loops and arithmetic). This is the kind of work the PCEP exam covers. Print each result with a label.
- If
scipyis available in your JupyterLite session, confirm withscipy.stats.chi2_contingency; if not, get the P-value from CHISQ.DIST.RT in a spreadsheet. - Add a Markdown cell stating the data source, retrieval date and each step, so your notebook serves as a reproducibility appendix.
Spreadsheet route (equally valid): one sheet of raw data, one of formulas, with a notes cell documenting each step.
Open JupyterLite ↗ · JupyterLite, Project Jupyter · BSD-3-Clause
For each of these, name the procedure (or say that no inference is needed) and give one condition to check: (a) the mean July high in Springfield in 2024, from all 31 days; (b) whether a random sample of 60 students’ sleep hours averages less than 8; (c) whether the proportion of hot days differs between Kansas City and St. Louis in 2023; (d) whether Missouri’s unintentional-injury death rate trended upward from 2010 to 2017; (e) whether student survey answers about preferred study time differ by grade level.
How confident are you that you can choose the right inference procedure for a question and write a report someone else could reproduce?
Practice
Work these on paper or in your notebook, then open Check your answer. Aim for all of Fluency and Application; try at least one Challenge.
Printable version: this unit’s practice workbook (PDF)
Fluency
Build speed and accuracy with the core skill.
- Choose the procedure: estimate the proportion of St. Louis days with rain from a random sample of 200 days.
Check your answer
Answer: One-proportion z-interval. - Choose the procedure: do Springfield and Joplin differ in annual mean temperature over the same 30 years?
Check your answer
Answer: Paired t (on the 30 yearly differences). - Choose the procedure: is rainfall at a station spread evenly over the days of the week?
Check your answer
Answer: Chi-square goodness of fit. - Choose the procedure: is the number of 90°F days per year at Kansas City trending upward?
Check your answer
Answer: t-test (and interval) for the regression slope. - Choose the procedure: in a randomized experiment, do two groups of 12 differ in mean reaction time?
Check your answer
Answer: Two-sample t-test (or a randomization test). - Choose the procedure: is preferred study time associated with grade level in a random sample of students?
Check your answer
Answer: Chi-square test of independence. - Choose the procedure: what fraction of all 9,132 days in the St. Louis file were rainy?
Check your answer
Answer: None: this is the whole population; compute the proportion directly. - Choose the procedure: do two independent random samples of households differ in the proportion with solar panels?
Check your answer
Answer: Two-proportion z-test (and interval).
Application
Use the skill in context. Show your reasoning.
- A student wants to know whether heat waves in Kansas City have become longer. Propose a variable, a procedure and one condition that will be hard to meet.
Check your answer
Answer: For example: the longest run of consecutive 90°F days in each year from NOAA daily data, regressed on year (slope t-test). Independence of residuals from year to year is the hard condition; check the lag-1 correlation of the residuals. - A report states: ‘We surveyed 400 visitors to our website; 62% support the plan (95% CI 57% to 67%).’ Critique the choice of procedure.
Check your answer
Answer: The interval formula assumes a random sample from a defined population. Website visitors who choose to respond are a voluntary-response sample, so the interval’s 95% claim does not apply; the result describes only those respondents. - Write the reproducibility steps a careful reader would need to recompute your St. Louis weekday chi-square test.
Check your answer
Answer: Data source (NOAA GHCN-Daily, station USW00013994, 2000-01-01 to 2024-12-31, PRCP, retrieval date); define a rainy day as PRCP ≥ 0.01 in; count rainy days by weekday; expected = total/7; compute Σ(O − E)²/E and CHISQ.DIST.RT(χ², 6), recording each formula.
Challenge
Stretch problems. Expect to think before you write.
- Two analysts study the same question: ‘Is Springfield warmer than it used to be?’ One uses a two-sample t-test on 1950-1979 against 1995-2024; the other uses a slope test on all 75 years. Compare the two approaches.
Check your answer
Answer: The two-era test ignores the middle years and the order within eras, but it needs no linear-form assumption. The slope test uses all the data and estimates a rate, but it assumes a linear trend and independent residuals. Both treat years as random variation around a process, not a random sample. Agreement between them strengthens the conclusion.
Review
Keep earlier skills sharp.
- (Unit 2) Find the 95% interval for p with 66 successes in 200.
Check your answer
Answer: 0.330 ± 0.065: (0.265, 0.395). - (Unit 1) Find the SD of p̂ for n = 100 when p = 0.3117.
Check your answer
Answer: ≈ 0.0463.
A Report Someone Else Can Check: A Complete Short Example, with Its Appendix
Model report written for this course on NOAA NCEI Global Summary of the Year PRCP, stations USW00013995 (Springfield) and USW00003947 (Kansas City), 1995-2024; retrieved 2026-11-10 · SLS original, with public domain NOAA data
Why this reading. The lesson lists the eight parts of a report someone else can check and asks you to write one for the capstone. It does not show one. Here is a complete short report, written to the lesson’s structure on real data from this course, with the reproducibility appendix that is the point of the exercise. It is about 500 words of report; a capstone is three to four times longer because its exploration, limitations and appendix are fuller. After the report, three more scenarios for the procedure-selection workshop.
A model report (SLS original; real data)
Question. Over 1995–2024, did Springfield-Branson National Airport record more annual precipitation than Kansas City International Airport, and by how much?
Data. NOAA NCEI Global Summary of the Year, element PRCP (calendar-year total, inches), stations USW00013995 (Springfield) and USW00003947 (Kansas City), 1995–2024, retrieved 2026-11-10 through the NCEI Access Data Service (query in the appendix). Thirty years, no missing values at either station. The data are instrument records, not samples: every year in the period is present. No cleaning was needed beyond confirming the year column matched at both stations.
| Year | SGF | KCI | d | Year | SGF | KCI | d |
|---|---|---|---|---|---|---|---|
| 1995 | 41.87 | 34.65 | +7.22 | 2010 | 46.18 | 41.92 | +4.26 |
| 1996 | 44.89 | 40.46 | +4.43 | 2011 | 40.62 | 36.94 | +3.68 |
| 1997 | 38.50 | 33.10 | +5.40 | 2012 | 30.97 | 22.31 | +8.66 |
| 1998 | 48.49 | 49.57 | −1.08 | 2013 | 51.89 | 34.50 | +17.39 |
| 1999 | 41.54 | 40.11 | +1.43 | 2014 | 38.63 | 40.10 | −1.47 |
| 2000 | 35.39 | 35.01 | +0.38 | 2015 | 59.76 | 46.61 | +13.15 |
| 2001 | 45.32 | 53.51 | −8.19 | 2016 | 36.26 | 48.67 | −12.41 |
| 2002 | 37.87 | 24.80 | +13.07 | 2017 | 47.56 | 46.04 | +1.52 |
| 2003 | 42.63 | 27.98 | +14.65 | 2018 | 44.89 | 40.78 | +4.11 |
| 2004 | 43.25 | 37.60 | +5.65 | 2019 | 54.49 | 53.22 | +1.27 |
| 2005 | 35.33 | 44.15 | −8.82 | 2020 | 49.71 | 34.10 | +15.61 |
| 2006 | 38.90 | 30.90 | +8.00 | 2021 | 46.97 | 41.26 | +5.71 |
| 2007 | 44.30 | 33.05 | +11.25 | 2022 | 43.28 | 34.57 | +8.71 |
| 2008 | 60.15 | 44.69 | +15.46 | 2023 | 43.08 | 37.40 | +5.68 |
| 2009 | 51.88 | 44.96 | +6.92 | 2024 | 43.21 | 34.67 | +8.54 |
Exploration. Springfield: mean 44.26 in, SD 6.83, range 30.97 (2012) to 60.15 (2008). Kansas City: mean 38.92 in, SD 7.67. The two series tend to rise and fall together. The 30 paired differences d = SGF − KCI have mean 5.339 and SD 7.204; 25 of 30 are positive; a dot plot is roughly symmetric, with one low value (−12.41, 2016) and one high (+17.39, 2013); plotted against year there is no obvious trend.
Method. Because each year yields one value at each station, the data are paired, and a paired t-test on the differences is the procedure (a two-sample test would discard the pairing). H0: μd = 0; Ha: μd ≠ 0; α = 0.05. Conditions: the years are not a random sample, so the test is interpreted as asking whether the average difference exceeds what year-to-year variation would produce if the two stations’ long-run totals were equal; the differences are roughly symmetric with no outlier; consecutive years are not independent, which makes the P-value an approximation.
Results. d̄ = 5.339 in, sd = 7.204, SE = 1.315, t = 4.06, df = 29, two-sided P = 0.0003. 95% interval for μd: 2.65 to 8.03 in.
Conclusion. In the same thirty years, Springfield recorded more rain than Kansas City, on average about 5.3 inches a year more, and the difference is convincingly larger than year-to-year variation would produce by chance (P = 0.0003). The plausible range for the average gap is roughly 2.6 to 8.0 inches, a sizable fraction of Kansas City’s annual total of about 39 inches. The data are observational records from two fixed stations, so the result describes these locations over this period and says nothing about why they differ.
Limitations. Two instruments at two airports; possible equipment or siting changes over thirty years; year-to-year dependence not modeled; calendar-year totals split the winter season across two years, and water-year totals would be a natural robustness check.
Reproducibility appendix.
- Retrieve the CSV from https://www.ncei.noaa.gov/access/services/data/v1?dataset=global-summary-of-the-year&stations=USW00013995,USW00003947&startDate=1995-01-01&endDate=2024-12-31&dataTypes=PRCP&units=standard&format=csv (2026-11-10). Save as gsoy_prcp.csv; expect 60 data rows.
- Spreadsheet, sheet raw: paste the CSV unchanged. Sheet analysis: column A years 1995–2024; B = Springfield PRCP looked up by year; C = Kansas City PRCP; D = B − C.
- Check: =COUNT(B2:B31) and =COUNT(C2:C31) both 30. =AVERAGE(B2:B31) = 44.260; =AVERAGE(C2:C31) = 38.921.
- =AVERAGE(D2:D31) = 5.3393; =STDEV.S(D2:D31) = 7.2041; SE = STDEV.S/SQRT(30) = 1.3153; t = AVERAGE/SE = 4.059.
- P-value: =T.DIST.2T(4.059, 29) = 0.0003. Cross-check: =T.TEST(B2:B31, C2:C31, 2, 1) gives the same.
- Interval: =T.INV.2T(0.05, 29) = 2.0452; bounds AVERAGE ± 2.0452 × SE = 2.649, 8.029.
- Plots: dot plot of D; scatter of D against A. Both saved as images with the sheet.
A reader following these seven steps gets every number in the Results paragraph to the decimals shown. That is the test the appendix must pass.
Three more scenarios, to make eight
The lesson’s open question gives five. Name the procedure, or say that none is needed, and give one condition to check:
(f) Of 2,846 rainy days at St. Louis, are the counts by weekday consistent with an even spread? (g) Two hundred randomly chosen St. Louis days, of which 66 were rainy: estimate the proportion of rainy days in 2000–2024 with 95% confidence. (h) Among the 17 Missouri counties in the ACS 1-year file, does the percent of households with broadband differ between the 8 largest and the 8 smallest counties? (Think carefully: these counties are not a random sample of anything, and the 1-year file leaves out all of the state’s smaller counties.)
For every scenario, the last of the lesson’s four questions is the one students skip: how were the data produced? A procedure chosen without answering it is a calculation, not an inference.
Sources: NOAA NCEI, Global Summary of the Year data search (ncei.noaa.gov); NOAA NCEI Access Data Service (the query used here) (ncei.noaa.gov)
Nineteen Years of Missouri Death Rates: The CDC Table Behind Three Lessons
CDC NCHS, NCHS – Leading Causes of Death: United States, data.cdc.gov dataset bi63-dtpu, Missouri rows, 1999-2017, age-adjusted death rates per 100,000 and deaths; retrieved 2026-11-10 · Public domain (works of the United States government), with SLS original worked computation
Why this reading. Three lessons point at one CDC dataset. The significance-test investigation offers “a CDC comparison” of yearly changes in two causes of death, paired by year; the procedure workshop asks whether Missouri’s unintentional-injury death rate trended upward from 2010 to 2017; and the capstone lists the same table as a health data source. The lessons name the dataset (data.cdc.gov, bi63-dtpu) and never print it. Here it is for Missouri: eight series over nineteen years, with two of the analyses worked so that yours can be checked.
What the numbers are
The National Center for Health Statistics compiles death certificates from every state. This dataset gives, for each state and year from 1999 to 2017, the number of deaths from each of the leading causes and the age-adjusted death rate per 100,000 population. Age adjustment matters: Missouri’s population aged over these years, and an older population dies more often from most causes whatever else is happening. The rate is what the state’s deaths would be if its age mix matched a fixed standard population, so rates from different years can be compared. The dataset also holds chronic lower respiratory disease, influenza and pneumonia, and kidney disease; they are in the source and not printed here. Retrieved 2026-11-10.
Table 1. Missouri, age-adjusted deaths per 100,000, 1999–2017
| Year | All causes | Heart disease | Cancer | Stroke | Unintentional injuries | Alzheimer’s | Diabetes | Suicide |
|---|---|---|---|---|---|---|---|---|
| 1999 | 945.0 | 300.5 | 207.9 | 65.6 | 43.2 | 15.0 | 26.3 | 12.6 |
| 2000 | 920.8 | 286.0 | 205.9 | 65.1 | 41.9 | 17.8 | 24.6 | 12.5 |
| 2001 | 913.4 | 273.4 | 207.1 | 62.0 | 42.5 | 17.8 | 25.6 | 12.8 |
| 2002 | 922.3 | 272.7 | 204.1 | 63.1 | 45.6 | 19.0 | 26.8 | 12.1 |
| 2003 | 907.0 | 264.9 | 202.1 | 57.7 | 47.6 | 20.6 | 27.1 | 11.8 |
| 2004 | 872.7 | 248.5 | 201.1 | 56.1 | 46.4 | 21.9 | 23.6 | 12.4 |
| 2005 | 873.3 | 236.8 | 198.0 | 52.9 | 47.8 | 25.6 | 24.8 | 12.5 |
| 2006 | 859.0 | 228.8 | 195.8 | 50.5 | 50.1 | 25.1 | 23.5 | 13.5 |
| 2007 | 837.7 | 218.9 | 190.9 | 49.4 | 48.8 | 25.5 | 22.4 | 13.5 |
| 2008 | 861.3 | 219.8 | 189.5 | 49.2 | 48.9 | 30.0 | 20.4 | 13.0 |
| 2009 | 815.3 | 206.1 | 185.7 | 44.9 | 47.5 | 25.5 | 19.8 | 14.3 |
| 2010 | 819.5 | 201.8 | 185.6 | 44.0 | 47.9 | 28.8 | 21.2 | 14.0 |
| 2011 | 812.0 | 197.4 | 179.4 | 43.4 | 50.5 | 27.4 | 20.8 | 15.3 |
| 2012 | 803.0 | 193.4 | 182.3 | 42.2 | 47.8 | 25.9 | 19.6 | 14.9 |
| 2013 | 807.7 | 194.7 | 179.4 | 40.6 | 47.0 | 27.5 | 20.5 | 15.6 |
| 2014 | 807.0 | 194.7 | 177.7 | 41.0 | 48.7 | 27.4 | 19.4 | 16.3 |
| 2015 | 816.9 | 197.9 | 173.4 | 40.8 | 50.9 | 28.7 | 19.7 | 17.1 |
| 2016 | 808.2 | 192.1 | 167.0 | 40.4 | 57.0 | 30.0 | 20.1 | 18.4 |
| 2017 | 820.1 | 191.1 | 167.3 | 41.0 | 58.8 | 32.3 | 21.0 | 18.5 |
For scale, the 2017 counts behind the rates:
| Cause (2017) | All causes | Heart disease | Cancer | Stroke | Unintentional injuries | Alzheimer’s disease | Diabetes | Suicide |
|---|---|---|---|---|---|---|---|---|
| Deaths | 61,876 | 14,820 | 12,971 | 3,159 | 3,776 | 2,545 | 1,605 | 1,151 |
| Age-adjusted rate | 820.1 | 191.1 | 167.3 | 41.0 | 58.8 | 32.3 | 21.0 | 18.5 |
Worked: do two causes decline at different rates? (paired by year)
Cancer and heart disease both fell over these 19 years (heart disease from 300.5 to 191.1, cancer from 207.9 to 167.3). The question is whether the yearly change differs between them. Compute each cause’s change from one year to the next (18 changes), then the difference between the two changes for the same interval, which pairs them by year:
| Interval | Cancer change | Heart disease change | Difference (cancer − heart) |
|---|---|---|---|
| 1999–2000 | −2.0 | −14.5 | +12.5 |
| 2000–2001 | +1.2 | −12.6 | +13.8 |
| 2001–2002 | −3.0 | −0.7 | −2.3 |
| 2002–2003 | −2.0 | −7.8 | +5.8 |
| 2003–2004 | −1.0 | −16.4 | +15.4 |
| 2004–2005 | −3.1 | −11.7 | +8.6 |
| 2005–2006 | −2.2 | −8.0 | +5.8 |
| 2006–2007 | −4.9 | −9.9 | +5.0 |
| 2007–2008 | −1.4 | +0.9 | −2.3 |
| 2008–2009 | −3.8 | −13.7 | +9.9 |
| 2009–2010 | −0.1 | −4.3 | +4.2 |
| 2010–2011 | −6.2 | −4.4 | −1.8 |
| 2011–2012 | +2.9 | −4.0 | +6.9 |
| 2012–2013 | −2.9 | +1.3 | −4.2 |
| 2013–2014 | −1.7 | +0.0 | −1.7 |
| 2014–2015 | −4.3 | +3.2 | −7.5 |
| 2015–2016 | −6.4 | −5.8 | −0.6 |
| 2016–2017 | +0.3 | −1.0 | +1.3 |
The 18 paired differences have mean d̄ = 3.822 and sd = 6.611. H0: μd = 0. SE = 6.611/√18 = 1.558; t = 3.822/1.558 = 2.45, df = 17. From the df-17 row of the critical-values reading, the tail beyond 2.0 is 0.0309 and beyond 2.5 is 0.0115, so 0.023 < P < 0.062, and technology gives 0.0253. Interval: 3.82 ± 2.110(1.558) = 0.53 to 7.11 deaths per 100,000 per year. Heart disease fell faster than cancer by about 3.8 deaths per 100,000 each year, on average.
Now the conditions, honestly. The changes are not a random sample; they are the entire record. The heart-disease changes are more variable than the cancer changes (sd 6.0 against 2.4), and a dot plot of the differences shows large values at 2003–2004 and 2000–2001 that drive the result. Consecutive changes may be related (a big drop is often followed by a small one). All of that makes the P-value an approximation. The size of the interval is the more reliable part of the answer.
Worked: did the unintentional-injury rate trend upward, 2010–2017?
Eight points: 47.9, 50.5, 47.8, 47.0, 48.7, 50.9, 57.0, 58.8. Least squares against year gives slope b = 1.426 per 100,000 per year, SEb = 0.458, t = 3.12 on 6 df, P = 0.0207, r = 0.786. The rate rose by about 1.4 deaths per 100,000 each year. Lesson 4.3 gives the method and its conditions; with eight consecutive years the residuals are not independent, so treat the P-value as an approximation and the direction as the finding. (The national rise in these deaths over the same years is documented by CDC; this table lets you compare Missouri’s rate with the United States rate by downloading the “United States” rows of the same dataset.)
When is inference meaningful here at all?
These are essentially complete counts of a whole state, not samples. Lesson 4.4 says: if the question is about these years in this state, compute and describe; there is nothing to infer. Inference becomes meaningful when the question is about a process: is the underlying risk changing, as opposed to the recorded rate wobbling? A test then treats each year’s rate as the process plus year-to-year noise, and asks whether the trend or difference is larger than that noise. State which question you are asking before you choose a procedure.
Sources: CDC NCHS, Leading Causes of Death: United States (dataset bi63-dtpu) (data.cdc.gov); data.cdc.gov API (the query used here) (data.cdc.gov)