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.

StepCalculationValue
Rates200 / 2,000 and 250 / 2,0000.100 and 0.125
Difference0.125 - 0.1000.025
Pooled rate450 / 4,0000.1125
Pooled SE√(0.1125 × 0.8875 × 0.001)0.009992
z0.025 / 0.0099922.5020
p-value2 × (1 - Φ(2.5020))0.01235
Unpooled SE√(0.1 × 0.9 / 2,000 + 0.125 × 0.875 / 2,000)0.009984
Multiplierinv_cdf(0.975)1.95996
Half-width1.95996 × 0.0099840.01957
95% interval0.025 ± 0.01957(0.00543, 0.04457)

The 0.001 in the pooled row is 1/2000+1/20001/2000 + 1/2000.

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.