…
…
Evaluate a personalized notification test with a balance check, primary and guardrail metrics, subgroups and a power analysis, then write the decision with its reasons.
CampusPocket is a mobile app that shows students their class schedule, club events and the dining hall menu. Every morning the app sent everyone the same notification: "What's on campus today?" The product team wanted to test whether a personalized notification, based on the student's classes and clubs, brings users back to the app more often. They ran an A/B test from September 1 to 14, 2026. Users (people who had just installed the app and existing users) were randomly split into two groups.
The plan, written before the test started:
returned).muted_notifications); it can rise if personalization feels intrusive.session_min).Data: experiment.csv, each row is one user: user_id, assigned_date, group (control / personalized), device (android / ios), new_user (1 for people who installed the app for the first time), returned, session_min, muted_notifications.
Lessons used: confidence intervals (28), hypothesis testing (29), errors, power and effect (30), comparing two groups (31), A/B testing (39).
What you'll do
experiment.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 worked. Do the group sizes match a 50/50 split (sample ratio mismatch, SRM)? Are traits that existed before the test (share of new users, device) similar in the two groups?
Small differences are normal in random assignment. What matters is that there is no systematic and significant imbalance.
This step's code cell is for members.Sign up free
Compute the 7-day return rate of each group and compare them with a two-proportion z-test. The groups are in alphabetical order (control, personalized), so a negative z means the personalized group's rate is higher.
This step's code cell is for members.Sign up free
The p-value says the difference is hard to explain by chance, but it does not say how big the difference is. Write the difference in rates in percentage points, with a 95% confidence interval, and as a relative increase.
confint_proportions_2indep
Code cells are for members
You can read the steps. Sign up free to run the code, complete the steps and save your progress.
This step's code cell is for members.Sign up free
The primary metric improved, but does it have a cost? A user who mutes notifications can no longer be brought back to the app by a notification. Compare the mute rates and turn the two effects into the same unit: out of every 1,000 users, how many more returned, and how many more muted notifications?
This step's code cell is for members.Sign up free
Do returning users stay longer in the app? Session times are right-skewed, so apply both a test based on the mean (Welch t) and a test based on ranks (Mann-Whitney). Look only at users who returned. The session time of users who did not return is zero anyway.
This step's code cell is for members.Sign up free
The team asks whether the effect changes by device. Test the primary metric separately on each device.
Warning: a result that is significant in one subgroup and not significant in the other does not mean "the effect exists only on Android". Subgroups are smaller, so the power of the tests drops. Running two tests also raises the risk of a false alarm (Bonferroni threshold 0.025). Subgroup results are not a firm finding, they are a hypothesis for a new test.
This step's code cell is for members.Sign up free
Was the test strong enough to detect an increase of 4 points (from 30% to 34%)? Compute the power with the number of users in the groups, and the number needed for 80% power.
Finally, write the decision in three lines: what happened to the primary metric, what happened to the guardrail metric, and what do you recommend?
This step's code cell is for members.Sign up free