srm-check

Detect Sample Ratio Mismatch in experiment data using a chi-squared goodness-of-fit test.

16|7|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/ai-analyst-lab/ai-analyst-plus --skill srm-check
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: srm-check
Source: https://github.com/ai-analyst-lab/ai-analyst-plus/tree/main/.claude/skills/srm-check
Command: npx skills add https://github.com/ai-analyst-lab/ai-analyst-plus --skill srm-check

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SRM is a critical randomization integrity check — if the treatment/control split deviates significantly from the designed ratio, results cannot be trusted. This skill acts as a safety gate that blocks analysis when randomization is broken.

Core Features & Use Cases

  • Auto-fire on detection of experiment data and common assignment columns (e.g., variant, group, treatment, arm, experiment_group) to guard downstream analyses.
  • Executes a chi-squared goodness-of-fit test against the designed or default ratio to decide PASS, WARNING, or BLOCK.
  • Provides per-segment and temporal SRM diagnostics to identify when randomization integrity breaks.
  • Halts all downstream analysis when BLOCK is reported and offers actionable investigation directions.

Quick Start

Load your experiment data and let SRM Check automatically verify randomization before any outcome analysis.

Frequently Asked Questions about srm-check

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check for sample ratio mismatch before running A/B test analysis?

To check for sample ratio mismatch (SRM), apply a chi-squared goodness-of-fit test against your designed or default ratios to verify randomization integrity before proceeding with outcome analysis.

What is SRM and why does it invalidate experiment results?

SRM occurs when the treatment and control split deviates significantly from the designed ratio, indicating broken randomization. When SRM is detected, treatment-effect calculations cannot be trusted and analysis must be halted.

Can I automatically validate experiment data randomization without manual setup?

Yes, SRM detection can auto-fire when experiment data is loaded, automatically identifying common assignment columns like variant, group, treatment, and arm to guard downstream analyses without manual intervention.

How do I diagnose where randomization integrity breaks in my A/B test data?

You can run per-segment and time-based SRM diagnostics on your experiment data to identify specific segments or temporal windows where randomization integrity breaks and investigate the root cause.

What happens when a chi-squared test detects a significant sample ratio mismatch?

When the chi-squared test yields a p-value of 0.01 or lower, the system reports a BLOCK status, halts all downstream analysis, and offers actionable investigation directions to resolve the randomization failure.

Does SRM detection work with custom treatment assignment ratios?

Yes, SRM detection executes a chi-squared goodness-of-fit test against your designed ratios. If custom ratios are not provided, it defaults to standard assumptions to evaluate the experiment data split.