A/B tests · ResultsSRM check: sample ratio mismatch

Did the traffic in your A/B test split fairly: a chi-square test of the actual split against the plan, any shares from 50/50 to 20/80 and up to ten groups. Expected against actual per group, a checklist of eight causes, a day-by-day mode, and Python and R code.

Your numbers stay in the browser and are never sent anywhere

01Check02Expected vs actual03Causes04By day05Code06Examples07Questions08Related
01

Check

VisitorsPlan, %
A
B

Shares can be in percent or any units: 1 / 1 / 1 is the same as equal.

p threshold

0.001 is the industry standard: the check runs on every test, and a strict threshold guards against false alarms.

There is a mismatch.
With a fair split, a mismatch like this would occur with a probability of 4.2·10⁻⁷. Do not trust the test results until you find the cause.
Chi-square statistic
25.60
χ², df = 1
Probability of chance
4.2·10⁻⁷
p
Total · plan
100,000
50 / 50%
02Expected and actualexpectedactual
Aexpected 50,000actual 50,800 (+1.60 %)
Bexpected 50,000actual 49,200 (−1.60 %)
χ² = Σ (actual − expected)² / expected = (50,800 − 50,000)² / 50,000 + (49,200 − 50,000)² / 50,000 = 25.60
03Checklist of mismatch causes0 of 8 checked
04

Mismatch by day

Paste rows “date · visitors per group” from a report or Excel — 2 numbers after the date, one per group on the left. Shares and threshold are the same as in the check.

What was recognised
Empty for now — paste a table or press “Example”.
05

Check in Python / R

Check in Python / R
from scipy.stats import chisquare

chisquare([50800, 49200], f_exp=[50000, 50000])
# χ² = 25.6, p = 4.20e-7
06

Examples

07

Frequently asked questions

Sample ratio mismatch: the actual traffic split differs from the planned one. With a 50/50 plan and 50,800 against 49,200 the gap looks small, yet under a fair split it happens with a probability of 4·10⁻⁷. It signals a technical fault: some visitors of one group were lost or counted differently. The check is a chi-square test of the actual counts against those expected from the plan.

Updated