Sample ratio mismatch (SRM)
A chi-square goodness-of-fit check that the numbers of units assigned to each variant match the planned split; a mismatch signals a broken assignment or logging pipeline.
- units actually observed in variant
- planned share of traffic for variant (e.g. 0.5 and 0.5)
- total units in the experiment
- number of variants
When to use
- At the start of every A/B analysis, and in A/A tests that validate the experimentation pipeline.
- A strict threshold such as α = 0.001 is common practice, because the check is run on every experiment and a true SRM is usually large.
Assumptions
- Units are assigned independently with the planned probabilities; counts are of the randomisation unit (users, not events).
- Expected counts are large (they nearly always are).
How to interpret
- A tiny p-value means the observed split is very unlikely under correct randomisation: some units were lost, duplicated or misassigned (bots filtered in one arm, a redirect that drops slow users, a logging bug).
- With an SRM the arms are no longer comparable, so the treatment effect estimate is not trustworthy, however significant. Find the cause before analysing outcomes.
- A non-significant SRM check does not prove the pipeline is correct; it only fails to detect an imbalance.
Common mistakes
- Ignoring a "small" imbalance such as 51/49: with large N it can be overwhelming evidence of a bug.
- Fixing an SRM by discarding units until the split looks right.
- Checking the split on events (page views) when users were randomised.
Example
Planned 50/50, N = 10 000, observed 5 210 vs 4 790. Expected 5 000 each; on 1 df, p = 0.000027 < 0.001: an SRM. (5 130 vs 4 870 would give , p = 0.0093 — worth a look, but not flagged at 0.001.)