CalculatorVilla

Sample Ratio Mismatch (SRM) Diagnostic Analyzer

Diagnose Sample Ratio Mismatch (SRM)—a fundamental experimental integrity flaw where observed traffic splits differ significantly from intended allocation ratios, invalidating test conclusions.

SRM Diagnostic Result: Borderline Warning

Actual count of visitors or users assigned to control

Actual count of visitors or users assigned to treatment

Relative expected weight for Control (e.g. 1 for 50/50 split)

Relative expected weight for Variant (e.g. 1 for 50/50 split)

SRM Diagnostic Result
Borderline Warning

How to Use This Calculator

  1. Enter the actual user count in the Control group.
  2. Enter the actual user count in the Variant group.
  3. Confirm target allocation ratio (1:1 is default 50/50).
  4. Review the SRM status and chi-square p-value.

Formula & Calculation Methodology

χ² = Σ [(Observed − Expected)² ÷ Expected] | df = 1

Performs Pearson’s Chi-Square goodness-of-fit test against theoretical allocations. A p-value below 0.001 signals overwhelming evidence of a systemic assignment malfunction.

χ²Chi-Square test statistic
ObservedActual count of users routed to branch
ExpectedTheoretical allocation based on target ratio
dfDegrees of freedom (2 branches − 1 = 1)

Worked Example

Evaluating 50,450 Control vs 49,550 Variant (100k total, 50/50 target)

controlCount: 50450
variantCount: 49550
ratioA: 1
ratioB: 1
Result: p = 0.004392 (χ² = 8.1000, Borderline Warning, not severe SRM)

Severe mismatch: 52,000 Control vs 48,000 Variant (100k total)

controlCount: 52000
variantCount: 48000
ratioA: 1
ratioB: 1
Result: Critical SRM (p < 0.000001, χ² = 160.0000, Experiment invalid)

Frequently Asked Questions

Why does SRM invalidate an entire A/B test?↓

If users are systematically missing from one branch, the two groups are no longer comparable (e.g. ad blockers or safari users might be crashing in variant B). Concluding anything about conversion differences is deeply compromised.

Why use p < 0.001 instead of p < 0.05 for SRM?↓

With huge online sample sizes (hundreds of thousands of users), tiny inconsequential routing jitter can cross p = 0.05. Industry consensus (Microsoft, Google) uses p < 0.001 to flag genuine engineering defects.

What causes Sample Ratio Mismatch in production?↓

Common causes include redirect latency discrepancies, bot filters acting unevenly on one variant, tracking tag placement bugs, or client-side JavaScript crashes before the logging beacon fires.

Can SRM be fixed by re-weighting or normalizing data?↓

No. You cannot normalize away missing users because you do not know the unobserved characteristics of the dropped cohort. The test must be fixed and re-run.

Related Calculators

Source Citation & Disclaimer

Informational tool only; not licensed tax, legal, or financial advice.