This page answers one question: how many schools does a second trial need to detect an effect of a given size? No statistics background is needed to use it. Six steps, all on the Calculator tab.
- Pick the data scenario (the buttons under "Analysis"). This lets us choose whether we will get each child's absence records from before the purifiers go in, across all schools, and for how many years. Getting pre-purifier absence records increases the statistical power of the trial, but it is likely that some schools will either refuse to provide these records or simply do not have them.
- Describe the trial (four sliders under "Design"). This lets you modify the characteristics of the trial dynamically: the number of schools; classes per school in grades 1–5 (a Milan Istituto Comprensivo, the school unit that groups several primary schools, has about 19 in these grades); students per class (22 in the first trial); the share of classes that receive a purifier (50% is the most informative split). In principle, more schools, classes and children increase the statistical power of the trial.
- Say what you want to be able to see. The target effect is a percentage of the average absence rate. In our first study the average absence rate was about 5.9% (each child lost around 6 school days per 100). A 10% reduction in the average absence rate would therefore be a decrease of 0.59 percentage points (5.9% multiplied by 0.1). Power is the probability that, given the options selected in steps 1 and 2, the trial will find an effect of that pre-specified size (e.g. 10%) if it is real; 80% is the convention in the experimental economics literature and often the number funders expect. They expect a statement like "this intervention can detect an effect of 5% with 80% power." The default target is 5%: the corrected estimates from the first trial lie between 0 and 8%, so the trial should be able to see effects well below the 12.5% originally pre-registered. A trial powered only for a large effect would report "nothing" on an intervention that works.
- Read the four tiles. The tiles at the top of the calculator give the smallest effect the design can detect, the power against your target, the number of schools needed at your chosen power, and the cost.
- Read the chart. Each curve is one data scenario (a dashed curve appears when you ask for more than one prior year). Find where the curve crosses the dashed red target line: that is the number of schools you need. Hover anywhere for exact values. The hollow marker at 5 schools is the first trial's actual precision without a baseline, so you can see that the curve starts from something measured.
- Use the table and the cost sliders. The table lines up standard sizes side by side; the cost block prices each of them.
Six words you will meet
| Term | Meaning here |
|---|---|
| Percentage points vs percent | The absence rate is 5.9% of school days. A 7% effect means 7% of that, i.e. 0.41 percentage points (5.9 → 5.5). The calculator shows both. |
| Minimum detectable effect (MDE) | The smallest true effect the trial would find with the chosen power. Smaller is better. It is what the chart plots. |
| Power | If the true effect is exactly the target, the chance the trial's result is statistically significant. 80% means a one-in-five risk of a false "no effect". |
| Standard error (SE) | The typical distance between the estimate and the truth. The MDE is 2.8 standard errors at 80% power; everything on this page works by shrinking the SE. |
| Strata | School × grade blocks. The lottery is run inside each block, so every grade in every school has both treated and control classes. |
| ICC (intra-class correlation) | How alike children in the same classroom are in their absences, on a 0–1 scale. The higher it is, the less each extra child adds and the more each extra classroom matters. Measured at 0.042 here. |
Smallest detectable effect by number of schools (step 5)
Readout at standard sizes (step 6)
The two buttons in the calculator are two data situations, each with its own statistical model. They share the design and differ only in whether the schools can hand over each child's absence records from before the purifiers were installed.
Timing of the second trial. Purifiers are installed during the summer break, so the outcome is each child's absence over the whole school year that follows (September to June, about 170 school days). The first trial installed in November and observed only November to June (131 days); the calculator's noise inputs come from that window, but a child's full-year rate has the same spread (SD 0.056 against 0.054), because absence noise is persistent within a child rather than day-to-day, so the power numbers carry over to the full-year design unchanged.
Common setup
| Symbol | Meaning |
|---|---|
| i, c, s, g | student, classroom, school, grade |
| Yic | share of school days student i in classroom c was absent during the school year with the purifiers in place (September to June). A number between 0 and 1. |
| Tc | 1 if classroom c drew a purifier, 0 otherwise. Drawn by lottery inside each school × grade block. |
| αs(c),g(c) | one constant per school × grade block (strata fixed effects). Compares treated and control classes only within the same block, which is how the lottery was run. |
| Bic | the student's own absence share in the previous school year(s): the "baseline". Only scenario B has it. |
| β | the effect of the purifier on the absence share, in percentage points. Always the quantity of interest. |
| εic | everything else. Standard errors are clustered by classroom, because children who share a room share a teacher, a flu season and one lottery ticket. |
Scenario A · no pre-treatment absence data
Yic = αs(c),g(c) + β·Tc + εic
In words: the share of the year that child i in classroom c missed is explained by which school-and-grade block the classroom belongs to (α), by whether the classroom drew a purifier (β·T), and by everything else (ε). β is the average difference in the absence share between purifier and non-purifier classrooms within the same block: a negative β means purifiers reduced absences, and β / 0.06 expresses it as a percentage of the mean. Estimated by ordinary least squares on one row per child, each child weighted by their number of school days, with standard errors clustered by classroom.
What schools must provide: the attendance register for the trial year only.
Why it works: the lottery guarantees that treated and control classes are, on average, the same kind of children, so the difference in their absence rates is an unbiased estimate of β.
Why it is weak: everything that makes one child miss more school than another (a chronic condition, a family that travels, a sibling in daycare) stays in ε. The estimate is unbiased but noisy. Fixed child characteristics from the school register (sex, nationality) do not help: measured in the first trial they explain 0.06% of the within-block variation in absence and leave the standard error unchanged (0.336 against 0.337 pp). Health or socio-economic information would predict more, but whatever they do to attendance is already contained in the child's own past absences, which is what scenario B uses.
Scenario B · prior-year absence records (one year, or n years)
Statisticians call this design ANCOVA, analysis of covariance.
Yic = αs(c),g(c) + β·Tc + γ·Bic + εic, Bic = student i's average absence share over the previous n school years
In words: the same regression with one more explanatory variable, the child's own absence share in earlier years. γ measures how much of a child's past absence carries into the trial year. β keeps its meaning, the purifier effect within a block, but it is now estimated after removing the part of each child's absence that their history already predicts. Children with no history (all of grade 1, newcomers) get B = 0 and a "no baseline" indicator, so nobody is dropped.
What schools must provide: the trial year's register plus the previous year's (or several years') for the same children, linked by name or ID. The first trial obtained one year. Italian schools keep electronic registers, so earlier years are usually retrievable at no cost in purifiers, only in data-extraction effort.
Why it helps: a child's past absences predict their future absences. Including B takes that predictable part out of ε; whatever B explains no longer counts as noise. One full year explains 25% of the student-level and 48% of the classroom-level variation. Standard error 0.27 pp instead of 0.37 on the 76 classrooms that had a baseline: a 26% reduction, the same precision gain as adding about 80% more schools. Once grade 1, which has no prior year, is averaged in, the gain is about 16%, which is what the calculator shows.
What more years buy. Think of each child's yearly absence rate as a permanent tendency plus that year's luck (which infections went round). One year measures the tendency with noise; averaging n years averages the luck away. If λ is the correlation of a child's rate from one year to the next (measured: 0.50 for students, 0.69 for classrooms within strata), an n-year average explains
R²(n) = λ²·n / (n·λ + 1 − λ) → students: 25% (1 yr), 33% (2), 37% (3), 50% (∞) · classrooms: 48%, 57%, 60%, 69%
At n = 1 this is λ², which reproduces the measured 25% and 48%, so the extension is calibrated and not a free parameter. Returns fall quickly: the second year buys about a third of what the first did, and the ceiling is λ itself, because a child's own permanent tendency explains at most half of next year's rate. The calculator also respects the calendar: a grade-1 child has no prior year of primary school, a grade-2 child one and a grade-3 child two, so with n = 2 grades 3–5 get two years, grade 2 one and grade 1 none; all classes are kept.
Side by side (first trial, 5 schools)
| Scenario | Schools must provide | Baseline explains (student · class) | Standard error, realized | Standard error, formula | Smallest detectable effect, 80% power |
|---|---|---|---|---|---|
| A · none (95 classes, grades 1–5) | trial-year register | — | 0.336 pp | 0.327 pp | 0.94 pp = 16% of mean |
| B · 1 prior year (ANCOVA; 76 classes, grades 2–5, the ones with a 2022-23 record) | trial year + previous year, linked | 25% · 48% | 0.274 pp | 0.293 pp | 0.77 pp = 13% |
"Formula" is what the calculator computes at the first trial's size; it reproduces the realized numbers within 10%, which is why the curves can be trusted away from 5 schools. The scenario B row uses only grades 2–5 because grade-1 children had no 2022-23 record in the first trial; in a second trial they stay in the sample through the missing-baseline dummy, which is how the calculator treats them.
Everything the calculator does is one formula for the standard error (SE) of β, then the minimum detectable effect (MDE) is 2.8 × SE (at 80% power, two-sided 5%).
Power against a target δ is the probability that an estimate with that standard error clears significance: Φ(δ / SE − 1.96), where Φ is the normal cumulative distribution (shown only for completeness).
SE² = σ² · [ ρ·(1 − R²class) + (1 − ρ)·(1 − R²student) / m ] / ( J · π · (1 − π) )
| Symbol | Meaning | First trial |
|---|---|---|
| σ² | variance of a student's absence share | 0.0541² |
| ρ | classroom ICC within strata: the share of σ² that is common to a classroom | 0.042 |
| R²class, R²student | share of the classroom-level and student-level variation the baseline explains | 0 · 0 (A); 0.48 · 0.25 (B, one year); 0.57 · 0.33 (B, two years) |
| m | students per classroom | 21.6 |
| J | number of classrooms = schools × classes per school | 95 |
| π | share of classrooms treated | 0.45 |
In words
The noise in the estimate has two parts. The first term is classroom noise: a classroom is one lottery ticket, and its children share a teacher, a room and a flu season, so part of their absence moves together. Adding children to the room does nothing to this part; only more classrooms or a baseline shrink it. The second term is student noise, the child-to-child variation that averages out as the class gets bigger; it is already divided by m = 22. In the first trial the two parts were about equal (0.042 against 0.958 / 21.6 = 0.044), which is why the sliders behave as they do:
| Lever | What happens | Try it |
|---|---|---|
| More classrooms (J) | Both noise terms fall in proportion. Doubling J halves SE², i.e. cuts the MDE by 29%. This is the only lever with no ceiling. | Schools 35 → 70: MDE . |
| Bigger classes (m) | Only the student term falls. Doubling m removes about a quarter (scenario A) to a third (scenario B) of SE², and beyond 30 children the curve is flat. | Students 22 → 30 at 35 schools: MDE . |
| More schools at fixed classrooms | Nothing. Schools matter only through the classrooms they contain; the lottery inside each school × grade block removes school-level differences (school ICC 0.014). | 35 × 19 and 70 × 9.5 classes are the same trial. |
| Treated share (π) | π(1 − π) is largest at 0.5. A 30/70 split loses 16% of the effective sample; 20/80 loses 36%. | Share 0.5 → 0.3 at 35 schools: MDE . |
| A baseline (R²) | Acts on both terms at once. One prior year cuts the SE by about 16% (a fifth on the grades that have a baseline), the same gain as adding about 40% more classrooms (precision goes with the square of the SE: 1 / 0.84² ≈ 1.4). | Switch A → B at 35 schools: MDE . |
| More prior years (n) | Diminishing: the second year buys about a third of the first in explained variation, and less than that in precision once grades 1 and 2, which cannot have two years, are averaged in; the third year less again. | 1 → 2 → 3 years at 35 schools: MDE . |
| A larger target effect | Required schools fall with the square of the effect: detecting 10% instead of 5% needs a quarter of the schools. | Target 5% → 10% under B: schools. |
| Higher power | 90% instead of 80% multiplies the required sample by (3.24 / 2.80)² = 1.34. | Power 0.8 → 0.9 at 35 schools: MDE . |
The "Try it" column is computed live at 19 classes per school, 22 students, 50% treated, measured ICC, scenario B with one prior year unless stated.
A power calculation is only as good as its inputs, and the usual ones (a Bernoulli variance, a textbook ICC) are wrong for this outcome. Everything below is computed on the first trial's own panel, so the second trial is planned on the population it will actually sample.
| Quantity | Value | Why it matters |
|---|---|---|
| Mean absence rate | 5.88% | The mean every "% reduction" is a share of. A 7% effect is 0.41 pp. |
| SD of a student's post-period absence rate | 0.0541 | The right noise level. |
| Students per class and classes per school | 21.6 students and 19 classes | Cluster size and how many clusters a school buys. |
| Classroom intra-class correlation (ICC) | 0.042 within strata | How alike children in the same classroom are. Randomisation is within school × grade, so the between-strata part of the variance never enters the comparison and the within-strata value is the one the design faces. The calculator's 0.069 (raw) and 0.10 (control arm only) buttons are pessimistic alternatives. |
| School ICC | 0.014 | Absorbed by stratification; shown to confirm there is little of it. |
| Baseline R², prior-year absence rate | student 0.25 · class 0.48 (within strata) | What one prior year of records buys. The regression slope on the prior year is 0.49. |
| Year-to-year correlation λ of a student's / classroom's rate | 0.50 for a student, 0.69 for a classroom | Drives how much a second or third baseline year adds; λ² is the one-year R². |
| Realized SE, first trial, no baseline (scenario A) | 0.00336 (95 classes) · 0.00372 (76 classes) | The yardstick. The formula with the inputs above gives 0.00327 and 0.00366. |
| Realized SE, first trial, one prior year (scenario B) | 0.00274 | Formula: 0.00293 (+7%). |
| Effect on indoor PM2.5 (log scale) | −0.413 (SE 0.034), twelve times its standard error, 30 classes | Why the pollution effect is precise and the absence effect is not: minute-level readings give an outcome with enormous within-class variation that the purifier moves a lot; absence is rare, sticky, and moved a little. |
What is held fixed. Mean, SD, ICC and R² are those of Milan primary schools in 2023-24. Grade 1 is included throughout: its absence rate (5.85%) and spread match the other grades, and it adds a quarter more classrooms per school. A different city, grade range, or a year with a different flu season will move them; the ICC buttons bracket the plausible range. Standard large-sample critical values are used throughout (the smallest design on the slider has 20 classrooms). Cost excludes researcher time, installation and data extraction, which the first trial did not pay for. Subgroup effects are not sized: detecting the effect in the high-baseline half of students alone needs roughly the sample shown for half the effect.