Chapter 12 — Probability and statistics
Lesson map
Lesson 12 published. Map, example, EX034.
flowchart TD
N0["Learning outcomes"]
N1["12.1 The parent survey"]
N2["12.2 Comparing schools"]
N3["12.3 Response bias"]
N4["12.4 Protecting respondents"]
N5["Lab — Parent awareness with Wilson intervals"]
N6["Synthesis"]
N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> N6
N6 --> EX["Worked example"]
EX --> Q["Exercise EX034"]
Logical drawing
flowchart LR
N0["Learning outcomes"]
N1["12.1 The parent survey"]
N2["12.2 Comparing schools"]
N3["12.3 Response bias"]
N4["12.4 Protecting respondents"]
N5["Lab — Parent awareness with Wilson intervals"]
N6["Synthesis"]
N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> N6 --> Q["EX034"]
[Learning outcomes]
|
v
[12.1 The parent survey]
|
v
[12.2 Comparing schools]
|
v
[12.3 Response bias]
|
v
[12.4 Protecting respondents]
|
v
[Lab — Parent awareness with Wilson intervals]
|
v
[Synthesis]
|
v
[Worked example] --> [Exercise EX034]
Learning outcomes
You will (1) estimate a proportion from a survey with uncertainty; (2) compare groups carefully; (3) report survey results without identifying respondents.
12.1 The parent survey
The trust surveys parents about privacy awareness. One question asks whether parents know which apps receive their child's data. Elena analyses the synthetic results. Across twelve schools, 131 of 520 respondents say yes, 25%. She computes a Wilson 95% interval, which behaves well for proportions near zero or one and for small samples, and finds 22% to 29%. She reports the interval because a single percentage hides how uncertain the estimate is, especially for individual schools. The Wilson interval works well for proportions near zero or with small samples.
12.2 Comparing schools
Elena compares two schools. At Ashby Primary 9 of 40 parents say yes, 22%, with an interval from 12% to 38%. At Kelso Primary 22 of 48 say yes, 46%, with an interval from 33% to 60%. The intervals barely overlap, suggesting a real difference. She investigates and finds that Kelso sends parents a yearly letter listing apps. She cautions that the survey cannot prove the letter caused the difference, but the pattern supports trying the letter elsewhere. Other differences between schools could also explain the gap. Only an experiment could show causation.
12.3 Response bias
Not all parents respond. Elena notes that parents interested in privacy may be more likely to answer, which could make awareness look higher than it is. She reports the response rate for each school and recommends caution in interpreting low-response schools. She explains that statistics about people depend on who is counted, and that a careful analyst always asks who is missing from the data before drawing conclusions about everyone. Parents who answer surveys may differ from those who do not.
12.4 Protecting respondents
The survey includes a free-text comment field. Some comments mention children's names and conditions. Elena removes identifying details before sharing comments with the trust's leadership and reports school-level figures only where at least twenty parents responded. She explains that a survey about privacy must itself protect privacy, and that small groups and free text are the most common ways survey reports accidentally identify people. She suppresses results for groups smaller than ten and removes free-text answers that mention children's names or classes.
Lab — Parent awareness with Wilson intervals
# Wilson 95% intervals for a synthetic parent survey: "I know which apps receive my child's data".
import math
def wilson(k, n, z=1.96):
p = k / n; d = 1 + z * z / n
c = (p + z * z / (2 * n)) / d; h = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / d
return c - h, c + h
for school, k, n in [("Ashby Primary", 9, 40), ("Kelso Primary", 22, 48), ("all 12 schools", 131, 520)]:
lo, hi = wilson(k, n); print(f"{school:15s} {k}/{n} = {k/n:.0%} 95% CI {lo:.0%}-{hi:.0%}")
Run with python3 lab_wilson.py. Verified output:
Ashby Primary 9/40 = 22% 95% CI 12%-38%
Kelso Primary 22/48 = 46% 95% CI 33%-60%
all 12 schools 131/520 = 25% 95% CI 22%-29%
Worked example
Elena estimates trust-wide awareness at 25% (95% interval 22% to 29%), finds Ashby 22% versus Kelso 46% with barely overlapping intervals, notes response bias and redacts comments.
Synthetic case. Survey data are synthetic.
Errors and limits
Barely overlapping intervals are suggestive, not a formal test; a test of difference would be more precise.
Exercises
- EX034 — Trust-wide interval. What is the 95% interval for trust-wide awareness? Rubric: 3 = 22% to 29%;; 2 = approximately right;; 1 = wrong;; 0 = none.
- EX035 — Kelso difference. What might explain Kelso's higher awareness? Rubric: 3 = a yearly letter listing apps, though causation is not proven;; 2 = mentions letter;; 1 = vague;; 0 = none.
- EX036 — Respondent protection. How does Elena protect survey respondents? Rubric: 3 = redacts free text and reports schools only with at least twenty responses;; 2 = one part;; 1 = vague;; 0 = none.
Synthesis
Chapter 12 measures awareness. Chapter 13 covers identity and access.
Continue studying — chapter 12 of 40
← Chapter 11 (draft) · Course chapter index · Chapter 13 (draft) →