Statistics · medium

How long should an A/B test run, and what are novelty and seasonality effects?

Asked in Data Scientist interviews, in the Statistics round.

Short answer

Run for the sample size the power calculation requires and for whole weeks, at least one and usually two, so weekday and weekend behavior are both covered. Novelty effects fade as users get used to a change, so check whether the lift holds for later cohorts before you trust it.

How to answer it

Definition

Long enough to reach the pre-computed sample size, AND long enough to cover the business cycle and outlast novelty. Whichever is longer governs, and the second condition is the one people forget.

The three constraints

1. Statistical    reach the sample size you computed in advance

2. Seasonality    at least one full week, ideally two
                  weekday and weekend users behave differently, and a test
                  run Monday to Thursday measures a biased slice

3. Novelty        long enough for the reaction to the CHANGE to fade
                  from the effect of the change itself

Novelty and primacy

Both are strongest for existing users and mostly absent for new ones, which gives you the diagnostic: split the result by new against returning users. If the effect lives only in returning users and decays week over week, you are looking at novelty rather than a durable improvement.

Key points

FAQ

The 30-second answer

Long enough to hit the sample size I computed beforehand, and long enough to cover a full business cycle, which usually means at least one and preferably two complete weeks. Whichever is longer wins.
The reason for whole weeks is that weekday and weekend users behave differently, so a test running Monday to Thursday measures a biased slice.
Novelty is when existing users engage with something simply because it is new, so the lift is real in week one and gone by week three. Primacy is the reverse, where people are slower because they knew the old flow. I separate either from a genuine effect by splitting on new against returning users and watching the effect over time. If it only exists for returning users and decays, it is novelty rather than something worth shipping.

In the interview

Practice this for real