# Statistics Worked Problem: [Your problem or assignment question]

> A structured worksheet for solving one statistics problem from question to plain-language explanation, in eight
> steps: restate the question, identify variables and design, choose the method, check assumptions, compute in R or
> Python, interpret, explain it to a non-statistician (the Feynman check) and reflect on what would change the answer.
> It is for students doing homework or exam practice, thesis writers analysing one research question, and analysts
> who want a repeatable routine. It speeds up learning by making the decision order explicit, by giving a fully worked
> example, a half-worked example and an unsolved exercise (worked examples with fading), and by ending with
> self-explanation and reflection. The worked examples use fictional data; replace them with your own.
> Source basis: problem-solving steps after Pólya (1945), worked-example fading after Renkl and Atkinson (2003), and
> standard methods (Welch 1947, Pearson 1900) checked in R 4.5.1 and Python 3.14.

<!--
Guidance: How to use this template
- Use one copy of this worksheet per problem. Duplicate the "Blank worksheet" section for each new problem.
- Do the eight steps in order. Do not open R or Python before steps 1 to 4 are written down: choosing the method is the skill that exams and supervisors test most.
- Study Example A once, then complete Example B (fill the [ ] gaps) without looking back, then solve Exercise C and check the Answer key.
- In step 7, explain the result in plain words as if to a friend who never took statistics. If you cannot, go back to step 6.
- When something goes wrong, log it in academic/stats-error-log with its error type.
- Related templates: academic/stats-test-selector, academic/stats-assumption-checklist, academic/stats-effect-sizes, academic/stats-results-reporting, academic/stats-t-tests, academic/stats-contingency-tables, academic/stats-formula-sheet, academic/stats-error-log, academic/stats-practice-which-test, academic/stats-learning-roadmap, academic/study-guide
-->

## Document control

<!-- Guidance: Record where the problem comes from and which software you used, so that a tutor or supervisor can reproduce your numbers. -->

| Field | Value |
|---|---|
| Course or project | [STAT 201 Problem set 4, Lakemoor University (fictional)] |
| Learner or analyst | [Your name] |
| Data set | [Problem data; the examples use fictional data typed into the code] |
| Software and versions | R 4.5.1 (base `stats`); Python 3.14 with numpy 2.5.4, pandas 3.1.0, scipy 1.18.1, statsmodels 0.15.0 |
| Date | YYYY-MM-DD |
| Version | [0.1] |

## How the worksheet works

<!-- Guidance: Read the eight steps once. The diagram is the routine you will repeat until it becomes automatic. -->

Most mistakes in statistics happen before any calculation: the question was misread, the design was misidentified
(paired data analysed as independent), or the method was chosen because it was the last one taught. This worksheet
slows down the first four steps and speeds up the rest. Each step has a short prompt and a check you can tick.

The eight steps follow a loop. If the assumption check in step 4 fails, you return to step 3 and choose another
method. If you cannot explain the result simply in step 7, you return to step 6 and re-read your output. Step 8 asks
what would change the answer: this is where you learn the most, because it makes you see the problem from the side.

Structure aligned with Pólya's four phases of problem solving (understand, plan, carry out, look back), expanded for
statistics with the four-component statistical problem-solving process of the GAISE Pre-K-12 framework (Franklin et
al. 2007) and GAISE II (Bargagliotti et al. 2020): formulate questions, collect or consider data, analyse data,
interpret results. The GAISE College Report (ASA 2016) recommends teaching statistics as this kind of investigative
process.

```mermaid
flowchart TD
  S1["1 Restate the question"] --> S2["2 Variables and design"]
  S2 --> S3["3 Choose the method"]
  S3 --> S4{"4 Assumptions hold?"}
  S4 -- "No" --> S3
  S4 -- "Yes" --> S5["5 Compute in R or Python"]
  S5 --> S6["6 Interpret: estimate, CI, effect size, p"]
  S6 --> S7{"7 Can you explain it simply?"}
  S7 -- "No" --> S6
  S7 -- "Yes" --> S8["8 Reflect: what would change the answer?"]
```

## The eight steps explained

<!-- Guidance: Use these prompts as the checklist for every problem. Copy the prompts into the blank worksheet if you print it. -->

**Step 1, restate the question.** Write the question in one sentence using the words "compare", "estimate",
"predict" or "associate". Name the population, the outcome and the comparison. A good restatement already hints at
the method: "Compare the mean delayed-test score between two independent groups" points to a two-sample comparison of
means. Check: could someone else write the null hypothesis from your sentence?

**Step 2, identify variables and design.** List each variable with its role (outcome, grouping factor, covariate)
and its measurement level (nominal, ordinal, interval, ratio). Decide whether observations are independent, paired
or repeated, whether the study is an experiment (random assignment) or observational, and what the unit of analysis
is. Check: count the units. If each of 9 students per group gives one score, n = 9 per group; if 8 library branches are
measured twice, n = 8 pairs, not 16 observations.

**Step 3, choose the method.** Use academic/stats-test-selector. The outcome type and the design from step 2 decide
the family: means (t-tests, ANOVA, regression), proportions or counts (z-tests, chi-square, logistic or Poisson
regression), associations (correlation, regression). Write the method and one sentence of reason. Also name the
fallback you will use if assumptions fail. Check: does the method answer the question from step 1, or only a
nearby one?

**Step 4, check assumptions.** List each assumption of the chosen method with how you will check it (see
academic/stats-assumption-checklist). Prefer plots and design reasoning over formal tests: with small samples a
normality test has little power, and with large samples it flags trivial departures. Check: for each assumption,
write "met", "doubtful" or "violated", and what you will do about the doubtful ones.

**Step 5, compute.** Type the data into R or Python, run the method, and paste the output. Compute the key statistic
by hand once from the summary numbers; this is the single best check that you understand what the software did.
Check: do R and Python agree, and if not, which default differs?

**Step 6, interpret.** Report four things: the estimate in the units of the data, its 95% CI, an effect size, and
the test statistic with df and p-value. State the conclusion in the words of the question, without causal language
unless the design was a randomised experiment. Check: does your sentence say how big the effect is, not only whether
p is below 0.05?

**Step 7, explain to a non-statistician (Feynman check).** Write three to five sentences with no jargon: no "p",
"significant" or "null". If you need a technical word, define it in everyday terms. This step is elaboration and
self-explanation, which strengthen memory and expose gaps. Check: read it aloud. Would a friend be able to tell
you what was found and how sure we are?

**Step 8, reflect.** Answer three questions. What would change the answer (a different design, an outlier, a
one-sided test, a larger sample)? What did I almost get wrong? What is the general rule I will reuse? Write the rule
in your error log or flashcards. Check: the rule is short enough to fit on a flashcard.

## Worked example A (fully solved)

<!-- Guidance: Read each step and ask yourself why it was done this way before reading the reason. Then cover the solution and redo the hand calculation. -->

**Problem.** At Lakemoor University (fictional), 18 students in an introductory statistics course were randomly
assigned to two study methods for one week: weekly practice quizzes (retrieval practice) or re-reading the notes.
A delayed test one week later was scored out of 30. Does the study method affect the delayed-test score?

| Student | Group | Score | Student | Group | Score |
|---|---|---|---|---|---|
| Q1 | Quiz | 22 | R1 | Reread | 17 |
| Q2 | Quiz | 25 | R2 | Reread | 21 |
| Q3 | Quiz | 19 | R3 | Reread | 16 |
| Q4 | Quiz | 27 | R4 | Reread | 24 |
| Q5 | Quiz | 24 | R5 | Reread | 19 |
| Q6 | Quiz | 21 | R6 | Reread | 18 |
| Q7 | Quiz | 26 | R7 | Reread | 20 |
| Q8 | Quiz | 23 | R8 | Reread | 14 |
| Q9 | Quiz | 20 | R9 | Reread | 22 |

**Step 1, restate.** Compare the mean delayed-test score of students who used practice quizzes with that of students
who re-read, and estimate the difference. $H_0: \mu_Q = \mu_R$; $H_1: \mu_Q \neq \mu_R$ (two-sided).

**Step 2, variables and design.** Outcome: delayed-test score (0 to 30, treated as interval). Factor: study method
(nominal, two levels). Design: randomised experiment, two independent groups of $n = 9$, one score per student. The
unit of analysis is the student.

**Step 3, method.** Two independent groups, numeric outcome: Welch two-sample t-test (does not assume equal
variances; it is the default here and in R). Fallback if the distributions are strongly skewed or have outliers:
Mann-Whitney U test (Wilcoxon rank-sum).

**Step 4, assumptions.**

| Assumption | Check | Result |
|---|---|---|
| Independent observations | design: random assignment, one score each | met |
| Roughly normal within each group, or no strong skew or outliers | dot plot below; Shapiro-Wilk as a weak check | met (no outliers; Shapiro p = 0.914 and 1.000, the second is 0.9999 rounded) |
| Equal variances | not needed for Welch; SDs 2.74 and 3.12 | not required |

```vega-lite
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Delayed-test scores by study method, fictional Lakemoor University data.",
  "width": 360,
  "height": 140,
  "data": {"values": [
    {"group": "Quiz", "score": 22}, {"group": "Quiz", "score": 25}, {"group": "Quiz", "score": 19},
    {"group": "Quiz", "score": 27}, {"group": "Quiz", "score": 24}, {"group": "Quiz", "score": 21},
    {"group": "Quiz", "score": 26}, {"group": "Quiz", "score": 23}, {"group": "Quiz", "score": 20},
    {"group": "Reread", "score": 17}, {"group": "Reread", "score": 21}, {"group": "Reread", "score": 16},
    {"group": "Reread", "score": 24}, {"group": "Reread", "score": 19}, {"group": "Reread", "score": 18},
    {"group": "Reread", "score": 20}, {"group": "Reread", "score": 14}, {"group": "Reread", "score": 22}
  ]},
  "layer": [
    {"mark": {"type": "point", "filled": true, "size": 70, "opacity": 0.7},
     "encoding": {
       "x": {"field": "score", "type": "quantitative", "scale": {"domain": [12, 30]}, "title": "Delayed-test score (out of 30)"},
       "y": {"field": "group", "type": "nominal", "title": null}}},
    {"mark": {"type": "tick", "thickness": 3, "size": 30, "color": "black"},
     "encoding": {
       "x": {"aggregate": "mean", "field": "score", "type": "quantitative"},
       "y": {"field": "group", "type": "nominal"}}}
  ]
}
```

The plot (dots are students, black ticks are group means) shows two overlapping but shifted clouds, no outliers and
similar spread. With $n = 9$ per group the Shapiro-Wilk test can detect only gross departures, so the plot carries
more weight than the p-values. The re-read p-value of 1.000 is real (W = 0.996, p = 0.9999): those nine scores are
almost evenly spaced and symmetric around 19, which matches a normal shape almost perfectly. It does not prove the
population is normal; a non-significant test never does.

**Step 5, compute.**

```r
quiz   <- c(22, 25, 19, 27, 24, 21, 26, 23, 20)
reread <- c(17, 21, 16, 24, 19, 18, 20, 14, 22)
round(c(mean_q = mean(quiz), sd_q = sd(quiz), mean_r = mean(reread), sd_r = sd(reread)), 3)
round(c(shapiro_q = shapiro.test(quiz)$p.value, shapiro_r = shapiro.test(reread)$p.value), 3)
t.test(quiz, reread)                      # Welch is the R default
sp <- sqrt((8 * var(quiz) + 8 * var(reread)) / 16)
d  <- (mean(quiz) - mean(reread)) / sp
round(c(d = d, g = d * (1 - 3 / (4 * 16 - 1))), 3)
```

```text
mean_q   sd_q mean_r   sd_r
23.000  2.739 19.000  3.122
shapiro_q shapiro_r
    0.914     1.000

	Welch Two Sample t-test
t = 2.8893, df = 15.732, p-value = 0.01082
95 percent confidence interval:
 1.061061 6.938939
sample estimates:
mean of x mean of y
       23        19
    d     g
1.362 1.297
```

```python
import numpy as np
from scipy import stats

quiz = np.array([22, 25, 19, 27, 24, 21, 26, 23, 20])
reread = np.array([17, 21, 16, 24, 19, 18, 20, 14, 22])
print("Shapiro p:", round(stats.shapiro(quiz).pvalue, 3), round(stats.shapiro(reread).pvalue, 3))
res = stats.ttest_ind(quiz, reread, equal_var=False)   # Welch: not the scipy default
ci = res.confidence_interval()
print(f"t = {res.statistic:.3f}, df = {res.df:.2f}, p = {res.pvalue:.4f}")
print(f"95% CI [{ci.low:.2f}, {ci.high:.2f}]")
sp = np.sqrt((8 * quiz.var(ddof=1) + 8 * reread.var(ddof=1)) / 16)
d = (quiz.mean() - reread.mean()) / sp
print(f"d = {d:.3f}, g = {d * (1 - 3 / (4 * 16 - 1)):.3f}")
print("pooled p:", round(stats.ttest_ind(quiz, reread).pvalue, 4))
```

```text
Shapiro p: 0.914 1.0
t = 2.889, df = 15.73, p = 0.0108
95% CI [1.06, 6.94]
d = 1.362, g = 1.297
pooled p: 0.0107
```

R and Python agree once Python is told `equal_var=False`. The last line shows the pooled-variance result (scipy's
default): here it is almost the same (p = .0107) because the SDs are similar, but with unequal SDs and unequal group
sizes the two can differ a lot.

**Hand check of the key statistic.** The variances are $s_Q^2 = 7.5$ and $s_R^2 = 9.75$.

$$
SE = \sqrt{\frac{7.5}{9} + \frac{9.75}{9}} = \sqrt{0.833 + 1.083} = \sqrt{1.917} = 1.384
\qquad t = \frac{23 - 19}{1.384} = 2.89
$$

$$
\nu = \frac{1.917^2}{\dfrac{0.833^2}{8} + \dfrac{1.083^2}{8}} = \frac{3.674}{0.2335} = 15.73
$$

**Step 6, interpret.** The quiz group scored on average 4.0 points higher (23.0 vs 19.0 out of 30). The 95% CI for
the difference is [1.06, 6.94] points, so the data are compatible with an advantage between about 1 and 7 points.
The standardised effect is large by conventional benchmarks, *g* = 1.30, but the CI shows that the size is estimated
imprecisely with only 9 students per group. Because students were randomly assigned, a causal reading is justified
for this sample and setting.

APA-style report: Students who used practice quizzes scored higher on the delayed test (*M* = 23.0, *SD* = 2.74)
than students who re-read (*M* = 19.0, *SD* = 3.12), Welch *t*(15.73) = 2.89, *p* = .011, mean difference 4.0 points,
95% CI [1.06, 6.94], *g* = 1.30.

**Step 7, Feynman check.** "We split 18 students into two groups by chance. One group tested themselves with short
quizzes, the other re-read their notes. A week later the quiz group scored about 4 points higher out of 30. Because
the groups were formed by chance, the study method is the most likely reason for the gap. The true advantage could be
as small as 1 point or as large as 7 points: a small study gives a rough estimate."

**Step 8, reflect.** What would change the answer: one extreme score in the small groups (check with the
Mann-Whitney test, which gives W = 67.5, p = .019 in R with `wilcox.test(quiz, reread)`, using the normal
approximation because of tied scores: the same conclusion); a non-random allocation (then only an
association could be claimed); a one-sided test chosen after seeing the data (not allowed). What I almost got wrong:
scipy's default pooled test. General rule for my flashcards: "Two independent groups, numeric outcome: Welch t; in
Python set `equal_var=False`."

## Worked example B (half solved)

<!-- Guidance: Fill every [ ] gap without looking at Example A. Then check the Answer key. The gaps target the steps learners most often skip. -->

**Problem.** Brightwell Bakery (fictional) bakes sourdough in three ovens. Quality control inspected 50 loaves from
each oven and recorded whether each loaf had a defect (burnt base or underbaked centre). Is the defect rate related to
the oven?

| Oven | Defect | No defect | Total |
|---|---|---|---|
| A | 6 | 44 | 50 |
| B | 14 | 36 | 50 |
| C | 4 | 46 | 50 |
| Total | 24 | 126 | 150 |

**Step 1, restate.** Test whether the proportion of defective loaves differs between [ ] ovens.
$H_0$: defect status and oven are [ ]; $H_1$: they are associated.

**Step 2, variables and design.** Outcome: defect (nominal, two levels). Factor: oven (nominal, [ ] levels). Design:
observational, 150 independent loaves. The unit of analysis is the [ ].

**Step 3, method.** Counts in a 2 x 3 table of two categorical variables: chi-square test of [ ], effect size
Cramér's V. Fallback if expected counts are small: [ ].

**Step 4, assumptions.** Independence: each loaf counted once. Expected counts: each expected count is
$E = (\text{row total} \times \text{column total})/N = (24 \times 50)/150 =$ [ ] for the defect row and [ ] for the
no-defect row, so all expected counts are [ ] 5.

**Step 5, compute.**

```r
ovens <- matrix(c(6, 44, 14, 36, 4, 46), nrow = 2,
                dimnames = list(c("defect", "ok"), c("A", "B", "C")))
res <- chisq.test(ovens)
res
res$expected
sqrt(unname(res$statistic) / (sum(ovens) * (min(dim(ovens)) - 1)))   # Cramer's V
```

```text
	Pearson's Chi-squared test
data:  ovens
X-squared = 8.3333, df = 2, p-value = 0.0155
        A  B  C
defect  8  8  8
ok     42 42 42
[1] 0.2357023
```

```python
import numpy as np
from scipy import stats

ovens = np.array([[6, 14, 4], [44, 36, 46]])
chi = stats.chi2_contingency(ovens)
print(f"chi2 = {chi.statistic:.3f}, df = {chi.dof}, p = {chi.pvalue:.4f}")
print(chi.expected_freq)
print(f"V = {np.sqrt(chi.statistic / (ovens.sum() * (min(ovens.shape) - 1))):.3f}")
```

```text
chi2 = 8.333, df = 2, p = 0.0155
[[ 8.  8.  8.]
 [42. 42. 42.]]
V = 0.236
```

Hand check: the defect row contributes $(6-8)^2/8 + (14-8)^2/8 + (4-8)^2/8 =$ [ ]; the no-defect row contributes
$(44-42)^2/42 + (36-42)^2/42 + (46-42)^2/42 = 1.333$; total $\chi^2 =$ [ ] with $df = (2-1)(3-1) =$ [ ].

**Step 6, interpret.** Defect rates were 12% (A), [ ]% (B) and 8% (C). The association is [ ] (*p* = .016) and of
small to moderate size, *V* = [ ]. The test does not say which oven differs: the largest contribution to $\chi^2$ comes from
oven [ ].

**Step 7, Feynman check.** [Write three to five plain sentences.]

**Step 8, reflect.** What would change the answer: [ ]. General rule: [ ].

## Exercise C (unsolved)

<!-- Guidance: Solve all eight steps on your own, including the hand check and the Feynman explanation. Only then open the Answer key. -->

**Problem.** Harbour City Library (fictional) extended opening hours at its eight branches. Weekly visits were
counted in the same week of the month before and after the change.

| Branch | Before | After |
|---|---|---|
| Central | 410 | 432 |
| Northgate | 385 | 401 |
| Riverside | 520 | 515 |
| Eastfield | 298 | 321 |
| Old Town | 450 | 478 |
| Westpark | 372 | 380 |
| Harbourfront | 605 | 640 |
| Hillcrest | 330 | 352 |

Did weekly visits change after the extension? Work through steps 1 to 8. Hints for self-checking only: the design is
the key decision, and you should be able to say why a two-sample test would be the wrong choice. Use the code below
once you have chosen the method.

```r
before <- c(410, 385, 520, 298, 450, 372, 605, 330)
after  <- c(432, 401, 515, 321, 478, 380, 640, 352)
# your method here
```

## Blank worksheet

<!-- Guidance: Copy this whole section for each new problem. Keep the step headings so you can compare worksheets across weeks. -->

**Problem source:** [Course, problem set, question number, or thesis research question]

**Step 1, restate the question.** [One sentence: compare, estimate, predict or associate. Population, outcome,
comparison.] $H_0$: [ ]. $H_1$: [ ].

**Step 2, variables and design.**

| Variable | Role | Measurement level | Values or units |
|---|---|---|---|
| [Outcome] | outcome | [interval] | [0 to 30 points] |
| [Factor] | grouping factor | [nominal] | [levels] |

Design: [experiment or observational]; [independent, paired or repeated]; unit of analysis [ ]; sample size [ ].

**Step 3, method.** [Method] because [reason]. Fallback: [method if assumptions fail]. Checked with
academic/stats-test-selector: [Y/N].

**Step 4, assumptions.**

| Assumption | How I checked | Result (met, doubtful, violated) | Action |
|---|---|---|---|
| [Independence] | [design] | [ ] | [ ] |
| [Distribution shape] | [plot] | [ ] | [ ] |

**Step 5, compute.** [Paste R or Python code and trimmed output. Write the hand check of the key statistic.]

**Step 6, interpret.** Estimate [ ], 95% CI [ ], effect size [ ], test statistic [ ], *p* = [ ]. Report sentence: [ ].

**Step 7, Feynman check.** [Three to five sentences without jargon.]

**Step 8, reflect.** What would change the answer: [ ]. What I almost got wrong: [ ]. Rule for my flashcards: [ ].

## Common mistakes in solving statistics problems

<!-- Guidance: Before submitting, scan this list. Each mistake maps to an error type in academic/stats-error-log. -->

| Mistake | Why it is wrong | Fix |
|---|---|---|
| Choosing the method from the chapter title | the design, not the chapter, decides the method | do steps 1 and 2 first, then the selector |
| Analysing paired data as two independent groups | ignores the pairing, inflates the SE, usually loses power | compute within-unit differences |
| Counting observations instead of units | 8 branches measured twice are 8 pairs, not 16 cases | name the unit in step 2 |
| Running a normality test and nothing else | small samples: low power; large samples: trivial departures flagged | look at a plot, think about the design |
| Reporting only "p < .05" | hides size and precision | estimate, CI, effect size, statistic, df, p |
| Writing "p = .011 means a 1.1% chance the result is due to chance" | p is computed assuming $H_0$ is true; it is not the probability that $H_0$ is true | "data this extreme would be unusual if there were no difference" |
| Causal language for observational data | confounding is possible | say "associated with" unless randomised |
| Changing to a one-sided test after seeing the result | picking the direction after the fact lets either direction count at $\alpha$, so the real false-positive rate is $2\alpha$ (0.10 instead of 0.05) | decide sidedness before looking at data |
| Trusting the software default | Welch vs pooled, Yates correction, type of sums of squares | read the output heading, set options explicitly |

## Self-test questions

<!-- Guidance: Answer from memory, then check. Retest the ones you miss after three days. -->

1. Name the eight steps of the worksheet in order.
2. Why must you identify the design (independent, paired, repeated) before choosing a method?
3. In Example A, why is the Welch test preferred, and what single line in Python changes the result to the pooled
   test?
4. What four quantities should step 6 always report?
5. In Example B, the chi-square test is significant. What does it not tell you, and how would you find out?
6. Rewrite this sentence for a non-statistician: "The difference was statistically significant, t(15.73) = 2.89,
   p = .011."

## My notes and next steps

<!-- Guidance: Rate your confidence and plan the next problem. Interleave: the next problem should use a different method. -->

| Problem | Method I chose | Correct? | Step where I struggled | Confidence (1-5) |
|---|---|---|---|---|
| *Example:* Example A | Welch t | Y | step 4 (what counts as a check) | 4 |
| *Example:* Exercise C | [ ] | [ ] | [ ] | [ ] |
| [Problem] | [Method] | [ ] | [ ] | [ ] |

Open questions for the tutor or supervisor: [Your questions]. Next problem (different method, for interleaving):
[pick one from academic/stats-practice-which-test]. Mistakes logged in academic/stats-error-log: [Y/N].

## Sources and further reading

<!-- Guidance: The learning design and the methods each have a source. Cite the methods in your own reports. -->

- Pólya, G. (1945). *How to Solve It*. Princeton University Press.
- Sweller, J., and Cooper, G. A. (1985). The use of worked examples as a substitute for problem solving in learning algebra. *Cognition and Instruction*, 2(1), 59–89.
- Renkl, A., and Atkinson, R. K. (2003). Structuring the transition from example study to problem solving in cognitive skill acquisition: a cognitive load perspective. *Educational Psychologist*, 38(1), 15–22.
- Chi, M. T. H., Bassok, M., Lewis, M. W., Reimann, P., and Glaser, R. (1989). Self-explanations: how students study and use examples in learning to solve problems. *Cognitive Science*, 13(2), 145–182.
- Dunlosky, J., Rawson, K. A., Marsh, E. J., Nathan, M. J., and Willingham, D. T. (2013). Improving students' learning with effective learning techniques. *Psychological Science in the Public Interest*, 14(1), 4–58.
- GAISE College Report ASA Revision Committee (2016). *Guidelines for Assessment and Instruction in Statistics Education College Report 2016*. American Statistical Association.
- Franklin, C., Kader, G., Mewborn, D., Moreno, J., Peck, R., Perry, M., and Scheaffer, R. (2007). *Guidelines for
  Assessment and Instruction in Statistics Education (GAISE) Report: A Pre-K-12 Curriculum Framework*. American
  Statistical Association.
- Bargagliotti, A., Franklin, C., Arnold, P., Gould, R., Johnson, S., Perez, L., and Spangler, D. A. (2020). *Pre-K-12 Guidelines for Assessment and Instruction in Statistics Education II (GAISE II): A Framework for Statistics and Data Science Education*. American Statistical Association.
- Pearson, K. (1900). On the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling. *Philosophical Magazine*, Series 5, 50(302), 157–175.
- Wasserstein, R. L., and Lazar, N. A. (2016). The ASA statement on p-values: context, process, and purpose. *The American Statistician*, 70(2), 129–133.
- Welch, B. L. (1947). The generalization of "Student's" problem when several different population variances are involved. *Biometrika*, 34(1–2), 28–35.
- Hedges, L. V. (1981). Distribution theory for Glass's estimator of effect size and related estimators. *Journal of Educational Statistics*, 6(2), 107–128.
- NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5 Quantitative Techniques, https://www.itl.nist.gov/div898/handbook/ (accessed 2026-10-25). Public domain.
- Further reading (names only): de Smith, M. J., *Statistical Analysis Handbook* (2024 edition, statsref.com); *OpenIntro Statistics*.

## Answer key

<!-- Guidance: Compare step by step. If your method choice differed, write down why in your error log before reading on. -->

**Example B gaps.** Step 1: three ovens; independent. Step 2: three levels; unit of analysis the loaf. Step 3:
chi-square test of independence; fallback Fisher's exact test (or merge categories). Step 4: $E = 8$ for the defect
row and $E = 42$ for the no-defect row, all at least 5. Hand check: defect row $0.5 + 4.5 + 2.0 = 7.0$; total
$\chi^2 = 7.0 + 1.333 = 8.333$ with $df = 2$. Step 6: defect rates 12%, 28%, 8%; the association is statistically
significant at $\alpha = 0.05$; $V = 0.236$; the largest contribution comes from oven B (14 observed vs 8 expected).
Step 7, a model answer: "Oven B produced about one defective loaf in four, the other two about one in ten. A gap this
large would be unusual if all ovens were equally reliable, so oven B deserves a look. We only watched the ovens, we
did not run an experiment, so the cause could be the oven or something linked to it, such as the bakers on that
shift." Step 8: a different allocation of bakers or shifts to ovens (confounding); small expected counts; pairwise
follow-up comparisons with a multiplicity correction. Rule: "Two categorical variables, counts: chi-square of
independence, check expected counts, report V and the cell that drives it."

**Exercise C.** Step 1: estimate the mean change in weekly visits per branch after the extension. Step 2: the same 8
branches measured twice, so the design is paired; the unit is the branch; outcome visits per week (ratio).
Step 3: paired t-test on the differences (after minus before); fallback Wilcoxon signed-rank. A two-sample test would
ignore that big branches stay big, which adds the large between-branch variation to the SE. Step 4: differences are
22, 16, -5, 23, 28, 8, 35, 22, with no extreme value; branches independent of each other. Step 5:

```r
t.test(after, before, paired = TRUE)
d <- after - before; round(c(mean = mean(d), sd = sd(d), dz = mean(d) / sd(d)), 3)
```

```text
	Paired t-test
t = 4.2492, df = 7, p-value = 0.003797
95 percent confidence interval:
  8.260484 28.989516
mean difference
         18.625
  mean     sd     dz
18.625 12.397  1.502
```

Hand check: $SE = 12.397/\sqrt{8} = 4.383$, $t = 18.625/4.383 = 4.25$. In Python, `stats.ttest_rel(after, before)`
gives the same result. Step 6: weekly visits rose by 18.6 on average, 95% CI [8.3, 29.0], *t*(7) = 4.25, *p* = .004,
$d_z = 1.50$. Step 7: "Seven of the eight branches had more visitors after opening longer, on average about 19 more a
week. The rise is too consistent to be a fluke, but it is a before-and-after comparison: something else that changed
that month, such as the weather or school holidays, could also explain part of it." Step 8: a comparison group of
libraries without the change would strengthen the causal claim; a single branch with a large drop would matter a lot
with only 8 pairs.

**Self-test.**

1. Restate the question; variables and design; choose the method; check assumptions; compute; interpret; explain to
   a non-statistician; reflect.
2. The design determines the dependence structure and therefore the correct SE: the same data analysed as paired or
   independent give different answers.
3. Welch does not assume equal variances and loses little when they are equal. `stats.ttest_ind(quiz, reread)`
   without `equal_var=False` runs the pooled test.
4. The estimate in data units, its 95% CI, an effect size, and the test statistic with df and p-value.
5. It does not say which ovens differ or in which direction. Look at observed minus expected counts or standardised
   residuals, or run pairwise comparisons with a multiplicity correction.
6. A model answer: "Students who quizzed themselves scored about 4 points higher out of 30. A gap this size would be
   unlikely if the two study methods worked equally well."

## Revision history

<!-- Guidance: Add a row each time you reuse the worksheet for a new problem set or change the steps. -->

| Version | Date | Author | Change |
|---|---|---|---|
| 0.1 | YYYY-MM-DD | [Name] | First version from template |
| [0.2] | YYYY-MM-DD | [Name] | [Added problem set 5 worksheets] |
