16/32
Part 4 of 6 · The worked exampleLearn and do
Every number for 200 of 2,000 against 250 of 2,000
Control converts 200 of 2,000 users and treatment 250 of 2,000. These are the practice problem's known-result numbers, so your function should reproduce every row.
| Step | Calculation | Value |
|---|---|---|
| Rates | 200 / 2,000 and 250 / 2,000 | 0.100 and 0.125 |
| Difference | 0.125 - 0.100 | 0.025 |
| Pooled rate | 450 / 4,000 | 0.1125 |
| Pooled SE | √(0.1125 × 0.8875 × 0.001) | 0.009992 |
| z | 0.025 / 0.009992 | 2.5020 |
| p-value | 2 × (1 - Φ(2.5020)) | 0.01235 |
| Unpooled SE | √(0.1 × 0.9 / 2,000 + 0.125 × 0.875 / 2,000) | 0.009984 |
| Multiplier | inv_cdf(0.975) | 1.95996 |
| Half-width | 1.95996 × 0.009984 | 0.01957 |
| 95% interval | 0.025 ± 0.01957 | (0.00543, 0.04457) |
The 0.001 in the pooled row is .
Read the result like this. Treatment converted 2.5 points better. If the pages were equally good, a gap that big in either direction would turn up about 1.2% of the time, so it's significant at 5%. The plausible range for the true lift runs from about 0.5 to 4.5 points.
In the editor, write pooled_rate and half_width, two rows of the table, and check them against its values.