…
…
Read a signup button A/B test on its planned last day, after the dashboard was checked every morning. Measure the false alarm risk of stopping early and of looking at three metrics at once with simulation and Bonferroni, and write a decision that goes only as far as the data.
LearnBridge is a fictional learning site that publishes free short video lessons. The gray "Sign up" button (A) on the signup page was tested against an orange "Start free" button (B): visitors who came to the signup page between October 5 and 18, 2026 were randomly split into two groups. The plan, written before the test started: the primary metric is the signup rate (signups / visits), the secondary measures are button clicks and the first lesson rate, the duration is 14 days, and α = 0.05. The product manager looked at the dashboard every morning. On the morning of October 11 he saw the p-value for signups below 0.05 and said, "B won, let's stop the test." The analyst insisted on waiting for the planned 14 days. The test is over, and the question is yours: did B increase signups, and would stopping on October 11 have been right?
Data: trial_daily.csv (fictional sample data), each row holds the counts for one day, one group and one device (14 days × 2 groups × 2 devices = 56 rows):
| Column | Description |
|---|---|
day, date | The day of the test (1-14) and its date |
group | A (gray "Sign up") or B (orange "Start free") |
device | mobile or desktop |
visits | The number of people who opened the signup page that day |
clicks | The number of people who clicked the button |
signups | The number of people who completed the signup form |
first_lesson | The number of people who signed up and opened the first lesson the same day |
Lessons used: pivot tables (8), testing a claim and the p-value (27-28), proportions with formulas: the two-proportion z-test and the interval for the difference (31), errors, power and effect (33), the funnel (40), A/B testing: split check and early peeking (42), fallacies: multiple comparisons and Bonferroni (43).
Cells share one session; each step uses the variables of the one before. The simulation is seeded with np.random.default_rng(42), so when you run the cell again you see the same numbers.
What you'll do
trial_daily.csvDownload file
Reading file…
Code cells are for members
You can read the steps. Sign up free to run the code, complete the steps and save your progress.
Before looking at the results, check that the assignment is sound. In trial_daily.csv, each row holds the counts for one day, one group and one device; most of the analysis will use the 14-day totals of the two groups.
Collect the totals of the two groups in a table called total. Then ask two questions: were the visitors split in half as planned (sample ratio mismatch)? Is the device, a trait fixed before the test, similar in the two groups?
This step's code cell is for members.Sign up free
Every morning the product manager looked at the dashboard and compared the signup rates of the two groups using all visitors up to that day. Rebuild this dashboard: for each day, print the cumulative signup rates and the p-value of the two-proportion z-test side by side.
Then find the most dangerous row of the dashboard: on which day did p first drop below 0.05? The morning after that day, the product manager said "B won, let's stop." Also look at how p moved after that day.
The vis and sig tables are ready: days in the rows, A and B in the columns, and the values are the totals up to that day (cumsum).
This step's code cell is for members.
Code cells are for members
You can read the steps. Sign up free to run the code, complete the steps and save your progress.
The analyst who stuck to the plan makes the decision at the end of day 14, with all the data. Write the difference in the signup rate, the primary metric (B − A), in percentage points and as a relative difference, with the p-value and the 95% confidence interval.
Then read the same difference from the dashboard of day 6. Is the difference seen on day 6 the same size as the one on day 14? Which number would a team that stopped early put in the report?
This step's code cell is for members.Sign up free
Before the test started, the team had written this: in past months the signup rate was about 7.5%, and we want to detect an increase of at least 2 points from the button (to 9.5%), with 80% power and α = 0.05. How many visitors per group did this goal need?
Then compare two moments: with the number of visitors in the groups at the end of day 6 and at the end of day 14, with what probability would the test detect a real increase of 2 points? The groups are not the same size; use the smaller group for power.
This step's code cell is for members.Sign up free
The product manager says, "p came out 0.039, it would not be this low by chance." But he did not see that p once. He saw it after looking every day for 14 mornings. Measure the cost of that: generate 10,000 experiments in which both groups see the same button (the true difference is zero). Each group has 248 visitors per day, and the signup rate is 7.5% in both groups.
Compare three analysts: one who looks only on the planned day 14, one who looks once a week (days 7 and 14), and one who looks every day from day 3 and stops on the first "significant" day. In what share of the experiments with no difference does each one say "B won"?
When the true difference is zero, in roughly what share of the experiments does an analyst who looks every day from day 3 to day 14 and stops on the first day with p < 0.05 raise a false alarm?
The p-values are in the pz array: the rows are the 10,000 experiments and the columns are the 14 days (column 0 = day 1).
This step's code cell is for members.Sign up free
The dashboard did not show only signups: the team was also tracking clicks on the button and the share of people who sign up and open the first lesson the same day. Test each of the three metrics (all are rates per visitor) twice: with the data up to the end of day 6 and with all 14 days.
Looking at three tests together and saying "we will report whichever is significant" raises the chance of a false alarm once more (lesson 43, multiple comparisons). Compute the Bonferroni threshold and list the metrics that pass the threshold on both days.
Note: the plan named signup rate as the single primary metric. When the decision is made on the one metric named in the plan, no correction is needed; the correction is needed when you look at "one of the three".
This step's code cell is for members.Sign up free
The difference in clicks is clear, the difference in signups is not. To understand this, open the path step by step: what share of visitors clicked the button, what share of the people who clicked completed the signup form, and what share of the people who signed up opened the first lesson? Put the three rates side by side for the two groups in a table called funnel.
Then test whether the signup rate among people who clicked is different in the two groups.
This step's code cell is for members.Sign up free
Six sentences were proposed in the meeting. Test each one against what you found: random assignment, the interval on day 14, the A/A simulation, Bonferroni and the funnel. Write the letters of the sentences the data supports in the list allows, and the ones it does not support in the list does_not_allow.
Then choose the decision and write its letter in the variable decision:
This step's code cell is for members.Sign up free