Use allocation imbalance to investigate the observation process
Calculate an SRM diagnostic and distinguish detection, root cause, and causal validity.
On this page
The question for today
What you’ll understand
- Compare distinct-unit counts with the actual configured probabilities.
- Calculate a simple chi-square allocation statistic.
- Explain why SRM failure is diagnostic and SRM success is not causal proof.
Sample ratio mismatch asks whether the units appearing in an analysis are distributed across arms as the design predicts. An unexpected imbalance can reveal broken assignment, missing logs, identifier problems, or treatment-dependent filtering. It is a diagnostic of the experiment’s observation pipeline, not a direct test that the model improves an outcome. A severe mismatch deserves investigation before interpreting lift, while a clean ratio leaves many other threats untouched. The useful workflow is to locate where the population changed, rather than repair a suspicious count by deleting whichever rows make it look balanced.
Compare with the design that actually ran
Start from distinct randomization units and the correct allocation probabilities for the cohort and configuration epoch. A planned 70/30 experiment should not be tested against 50/50. If allocation changes over time, expected counts must account for those changes and enrollment rules rather than applying the final setting to the entire history. Fixed-size constrained assignment has a different count distribution from independent Bernoulli assignment, so the test must match the mechanism.
For a simple independent multinomial allocation with fixed probabilities and sufficiently large expected cell counts, Pearson’s chi-square statistic compares observed and expected counts. With two arms and no fitted probability parameters, its large-sample reference distribution has one degree of freedom. An exact binomial procedure can be appropriate for small two-arm counts. Configure diagnostic thresholds and repeated-check behavior deliberately; a familiar p-value cutoff is not universal across platforms or monitoring frequencies.
Find the stage that changed the ratio
Compare enrollment, assignment, intervention logs, joined outcome tables, and analysis filters in sequence. If the raw assignment ledger is balanced but the exposed subset is not, the cause may be exposure behavior, telemetry loss, or a treatment-dependent trigger. If a join duplicates only one arm’s high-activity users, the mismatch can arise after assignment even though the bucketing service is correct. Segment by stable pre-treatment attributes and time to locate the first divergence.
An SRM alert is evidence inconsistent with the specified counting model at its calibrated error level; it does not name the root cause or prove the direction of outcome bias. A highly engaging treatment can cause a bot filter to remove more treated users, for example, but another incident can remove low-engagement users instead. Reweighting counts to the intended ratio without understanding that selection does not generally recover the missing outcomes or the randomized estimand.
Passing the check is necessary evidence, not a certificate
Equal counts can coexist with systematic contamination, swapped labels, wrong model versions, outcome duplication in both arms, or interference. A passing SRM check therefore cannot establish causal identification or measurement correctness. Combine it with identity, exposure, timing, and metric-quality diagnostics. Likewise, a failed check should lead to a documented resolution or a clearly limited analysis rather than a claim that a chosen outcome must be false.
Keep the diagnostic separate from the outcome stopping rule. Repeatedly searching many segments for tiny SRM p-values creates its own multiplicity and triage problem, while a single global aggregate can hide offsetting local failures. Record the configured expectation, population boundary, test, threshold, and investigative evidence. If a pipeline fix changes the analyzed population, recompute the relevant result from traceable source data and disclose the corrected cohort instead of patching only the final dashboard ratio.
Work it through
A 55/45 count split has a sample-size-dependent warning
A fixed 50/50 independent assignment design produces an analyzed cohort of 1,000 distinct units: 550 treatment and 450 control. Use a two-arm Pearson count check with no fitted allocation parameters.
Expected counts are 1,000×0.5=500 in each arm. Deviations are +50 and −50, so X²=50²/500+50²/500=5+5=10. The result depends on both the ratio and the cohort size.
The standardized treatment-count deviation is 50/√250≈3.16228. Its square is 10, agreeing with the two-arm Pearson statistic. Under the one-degree-of-freedom chi-square approximation, the two-sided count p-value is about 0.001565.
At a predeclared diagnostic threshold 0.01 this would trigger investigation. It does not establish which stage lost or duplicated units, whether treatment helped the outcome, or how to correct selection bias; those require ledger and pipeline evidence.
The count model flags the cohort for investigation. The p-value is a diagnostic tail probability under the specified assignment/counting assumptions, not the probability the treatment is harmful.
The living notebook
Explore the model
Interactive lab · probability
Allocation expectations come from the configured probability
Reset, set Success probability p to 0.5 and Trials n to 10. Predict count mean 5 and variance 2.5 before Step. Reset, set p to 0.8 and n to 10, predict mean 8 and variance 1.6 before Step. Playback highlights the exact binomial distribution, not an SRM test or newly sampled cohorts.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forAn observed count must be compared with the configured allocation, not with an assumed universal 50/50 split.
Pause & reason
Check your understanding
Your turn
Try it yourself
A 50/50 independent design has N=200 analyzed units, with 120 treatment and 80 control. Compute Pearson X² and the treatment-count standardized deviation.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Expected counts are 100 each, and binomial count variance is 200×0.5×0.5.
Compare with the solution
X²=20²/100+(−20)²/100=4+4=8. The standardized count deviation is 20/√50≈2.82843, whose square is 8. These are imbalance diagnostics for the stated unit population and design; they do not calculate an outcome effect or identify a missing-data mechanism.
Keep the idea
Take it with you
- Use configured probabilities and distinct units from the actual design.
- Locate where assignment-to-analysis counts diverge.
- Neither an SRM alert nor a passing check establishes the outcome’s causal story alone.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.