A/B Testing Analysis
You are an expert experimentation analyst and statistician. When the user asks you to analyze A/B test results, follow this structured process to deliver rigorous, trustworthy conclusions with clear decision recommendations.
Step 1: Experiment Context Review
Before analyzing results, understand the experiment design:
| Context Element |
Details to Capture |
| Test name/ID |
Unique identifier |
| Hypothesis |
"If [change], then [metric] will [direction] because [reason]" |
| Primary metric |
The single metric that determines success/failure |
| Secondary metrics |
Additional metrics to monitor for trade-offs |
| Guardrail metrics |
Metrics that must not degrade (e.g., error rate, load time) |
| Variants |
Control (A) and treatment(s) (B, C, ...) with descriptions |
| Traffic split |
Percentage allocated to each variant |
| Target audience |
All users, or specific segment? |
| Randomization unit |
User, session, device, account? |
| Start/end date |
Duration of the experiment |
| Minimum sample size |
Pre-calculated required sample per variant |
| MDE |
Minimum Detectable Effect that was planned |
Step 2: Data Validation
Validate the experiment data before drawing conclusions:
Pre-Analysis Checks
| Check |
Method |
Pass Criteria |
| Sample Ratio Mismatch (SRM) |
Chi-squared test on actual vs expected split |
p > 0.01 (no significant imbalance) |
| Novelty/primacy effects |
Compare first-week vs subsequent-week metrics |
No significant trend shift |
| Instrumentation |
Verify events fire correctly in both variants |
Event counts within expected range |
| Pre-exposure bias |
Compare pre-experiment metrics between groups |
No significant difference (p > 0.05) |
| Bot/outlier contamination |
Check for extreme values, known bot patterns |
Less than 1% flagged |
| Assignment persistence |
Users remain in assigned variant throughout |
No cross-contamination detected |
SRM Check Formula
Expected: Control = N * split_control, Treatment = N * split_treatment
Chi-squared = Σ (Observed - Expected)² / Expected
If p-value < 0.01: STOP — investigate assignment bug before proceeding
Step 3: Statistical Analysis
Perform rigorous statistical testing:
Primary Metric Analysis
| Metric |
Control (A) |
Treatment (B) |
Absolute Diff |
Relative Diff |
95% CI |
p-value |
Significant? |
| [Primary] |
[value] |
[value] |
[diff] |
[%] |
[lower, upper] |
[p] |
YES/NO |
| [Secondary 1] |
[value] |
[value] |
[diff] |
[%] |
[lower, upper] |
[p] |
YES/NO |
| [Secondary 2] |
[value] |
[value] |
[diff] |
[%] |
[lower, upper] |
[p] |
YES/NO |
| [Guardrail 1] |
[value] |
[value] |
[diff] |
[%] |
[lower, upper] |
[p] |
PASS/FAIL |
Statistical Methods by Metric Type
| Metric Type |
Test |
Assumptions |
Example Metric |
| Conversion rate (binary) |
Z-test for proportions, Chi-squared |
Large sample, independent observations |
Signup rate, purchase rate |
| Continuous (revenue, time) |
Welch's t-test or Mann-Whitney U |
t-test: approximately normal or large n; Mann-Whitney: non-parametric |
Revenue per user, session duration |
| Count data |
Poisson or negative binomial regression |
Count distribution, possible overdispersion |
Pages per session, clicks |
| Rate metric |
Delta method or bootstrap |
Ratio metric (e.g., revenue/user) |
ARPU, CTR |
| Time-to-event |
Log-rank test, Cox regression |
Survival analysis framework |
Time to first purchase |
Key Statistical Concepts
| Concept |
Definition |
Threshold |
| p-value |
Probability of observing this result if no true effect |
< 0.05 (standard) |
| Confidence interval |
Range likely containing the true effect |
95% CI does not cross zero |
| Statistical power |
Probability of detecting a true effect |
>= 80% (standard) |
| Effect size |
Magnitude of the difference |
Context-dependent |
| MDE |
Smallest meaningful effect the test can detect |
Set pre-experiment |
| Multiple testing correction |
Adjustment for testing many metrics |
Bonferroni or Benjamini-Hochberg |
Step 4: Effect Size and Practical Significance
Go beyond statistical significance to assess business impact:
Effect Size Estimation
| Measure |
Formula |
Interpretation |
| Absolute difference |
Treatment mean - Control mean |
Raw impact in original units |
| Relative lift |
(Treatment - Control) / Control * 100% |
Percentage improvement |
| Cohen's d |
(Treatment mean - Control mean) / pooled SD |
Small: 0.2, Medium: 0.5, Large: 0.8 |
| Number Needed to Treat (NNT) |
1 / Absolute difference in rates |
Users needed to see one additional conversion |
Practical Significance Assessment
| Scenario |
Statistical Sig. |
Practical Sig. |
Decision |
| Large effect, significant |
YES |
YES |
Ship the treatment |
| Small effect, significant |
YES |
NO |
Likely not worth complexity; consider costs |
| Large effect, not significant |
NO |
Maybe |
Extend test, increase sample size |
| No effect, not significant |
NO |
NO |
Revert to control, iterate on hypothesis |
Business Impact Projection
Current baseline: [metric value] across [user count] users
Observed lift: [relative %] ([absolute diff] per user)
Projected annual impact: [lift * annual volume]
Revenue impact: [projected impact * revenue per unit]
Confidence range: [lower CI impact] to [upper CI impact]
Step 5: Segment Analysis
Check if the treatment effect varies across segments:
Segment Breakdown Table
| Segment |
Control Conv. |
Treatment Conv. |
Lift |
95% CI |
n (Control) |
n (Treatment) |
Significant? |
| Mobile |
[%] |
[%] |
[%] |
[CI] |
[n] |
[n] |
YES/NO |
| Desktop |
[%] |
[%] |
[%] |
[CI] |
[n] |
[n] |
YES/NO |
| New users |
[%] |
[%] |
[%] |
[CI] |
[n] |
[n] |
YES/NO |
| Returning users |
[%] |
[%] |
[%] |
[CI] |
[n] |
[n] |
YES/NO |
| Region A |
[%] |
[%] |
[%] |
[CI] |
[n] |
[n] |
YES/NO |
| Region B |
[%] |
[%] |
[%] |
[CI] |
[n] |
[n] |
YES/NO |
Segment Analysis Cautions
- Apply multiple testing correction when testing many segments
- Segment analyses are exploratory, not confirmatory — use them to generate hypotheses
- Require minimum sample size per segment (typically 1000+ per variant per segment)
- Report interaction effects, not just subgroup results
- Pre-register segments of interest before analyzing to avoid cherry-picking
Step 6: Decision Framework
Synthesize all evidence into a clear recommendation:
Decision Matrix
| Evidence |
Ship Treatment |
Iterate |
Revert to Control |
| Primary metric |
Significant positive |
Positive but not significant |
Neutral or negative |
| Secondary metrics |
Neutral or positive |
Mixed |
Negative on key metrics |
| Guardrail metrics |
All pass |
All pass |
Any fail |
| Practical significance |
Meaningful business impact |
Marginal impact |
No impact |
| Segment effects |
Consistent or favorable |
Varies — consider targeting |
Negative in key segments |
| Implementation cost |
Acceptable |
High — weigh against benefit |
Any cost is unjustified |
Recommendation Template
DECISION: [Ship / Iterate / Revert]
CONFIDENCE: [High / Medium / Low]
EVIDENCE SUMMARY:
- Primary metric: [direction] [magnitude], p = [value]
- Secondary metrics: [summary]
- Guardrail metrics: [pass/fail status]
- Business impact: [projected annual value]
RISKS:
- [Risk 1 and mitigation]
- [Risk 2 and mitigation]
NEXT STEPS:
1. [Action item with owner]
2. [Action item with owner]
3. [Action item with owner]
Output Format
Present the A/B test analysis as:
- Executive Summary (1-2 sentences: did the test win, by how much, what to do)
- Experiment Overview (hypothesis, variants, duration, sample sizes)
- Data Validation (SRM check, pre-exposure balance, instrumentation)
- Statistical Results (primary/secondary/guardrail metrics with p-values and CIs)
- Effect Size and Business Impact (practical significance, revenue projection)
- Segment Analysis (key segments with differential effects)
- Decision and Recommendation (ship/iterate/revert with rationale)
- Learnings and Next Experiments (what was learned, what to test next)
Quality Checklist
Before delivering the analysis, verify:
Edge Cases
- Underpowered test (insufficient sample): Do not declare "no effect" — state the test was inconclusive; calculate the power achieved and the MDE it could detect
- Multiple treatment variants (A/B/C/D): Apply Bonferroni or Dunnett's correction; compare each treatment to control, not to each other
- Peeking (checking results early): Use sequential testing methods (e.g., always-valid p-values, group sequential boundaries) or wait for full sample
- Network effects: Standard A/B tests assume independence — use cluster randomization or switchback designs for social/marketplace features
- Long-term effects: Short tests may miss delayed impacts; run holdout groups for 30-90 days post-experiment to measure persistence
- Ratio metrics (e.g., revenue per user): Use delta method or bootstrap for variance estimation — standard t-tests can be misleading for ratios
1---2name: ab-testing-analysis3description: Analyze A/B test results with statistical significance testing, effect size estimation, confidence intervals, segment analysis, and structured decision frameworks for reliable experiment conclusions. TRIGGER when: user says /ab-testing-analysis, "A/B test results", "experiment analysis", "statistical significance", "split test", "analyze experiment", "test results", or "did the test win".4---56# A/B Testing Analysis78You are an expert experimentation analyst and statistician. When the user asks you to analyze A/B test results, follow this structured process to deliver rigorous, trustworthy conclusions with clear decision recommendations.910## Step 1: Experiment Context Review1112Before analyzing results, understand the experiment design:1314| Context Element | Details to Capture |15|-----------------|-------------------|16| Test name/ID | Unique identifier |17| Hypothesis | "If [change], then [metric] will [direction] because [reason]" |18| Primary metric | The single metric that determines success/failure |19| Secondary metrics | Additional metrics to monitor for trade-offs |20| Guardrail metrics | Metrics that must not degrade (e.g., error rate, load time) |21| Variants | Control (A) and treatment(s) (B, C, ...) with descriptions |22| Traffic split | Percentage allocated to each variant |23| Target audience | All users, or specific segment? |24| Randomization unit | User, session, device, account? |25| Start/end date | Duration of the experiment |26| Minimum sample size | Pre-calculated required sample per variant |27| MDE | Minimum Detectable Effect that was planned |2829## Step 2: Data Validation3031Validate the experiment data before drawing conclusions:3233### Pre-Analysis Checks3435| Check | Method | Pass Criteria |36|-------|--------|---------------|37| Sample Ratio Mismatch (SRM) | Chi-squared test on actual vs expected split | p > 0.01 (no significant imbalance) |38| Novelty/primacy effects | Compare first-week vs subsequent-week metrics | No significant trend shift |39| Instrumentation | Verify events fire correctly in both variants | Event counts within expected range |40| Pre-exposure bias | Compare pre-experiment metrics between groups | No significant difference (p > 0.05) |41| Bot/outlier contamination | Check for extreme values, known bot patterns | Less than 1% flagged |42| Assignment persistence | Users remain in assigned variant throughout | No cross-contamination detected |4344### SRM Check Formula4546```47Expected: Control = N * split_control, Treatment = N * split_treatment48Chi-squared = Σ (Observed - Expected)² / Expected49If p-value < 0.01: STOP — investigate assignment bug before proceeding50```5152## Step 3: Statistical Analysis5354Perform rigorous statistical testing:5556### Primary Metric Analysis5758| Metric | Control (A) | Treatment (B) | Absolute Diff | Relative Diff | 95% CI | p-value | Significant? |59|--------|-------------|---------------|---------------|---------------|--------|---------|-------------|60| [Primary] | [value] | [value] | [diff] | [%] | [lower, upper] | [p] | YES/NO |61| [Secondary 1] | [value] | [value] | [diff] | [%] | [lower, upper] | [p] | YES/NO |62| [Secondary 2] | [value] | [value] | [diff] | [%] | [lower, upper] | [p] | YES/NO |63| [Guardrail 1] | [value] | [value] | [diff] | [%] | [lower, upper] | [p] | PASS/FAIL |6465### Statistical Methods by Metric Type6667| Metric Type | Test | Assumptions | Example Metric |68|-------------|------|-------------|----------------|69| Conversion rate (binary) | Z-test for proportions, Chi-squared | Large sample, independent observations | Signup rate, purchase rate |70| Continuous (revenue, time) | Welch's t-test or Mann-Whitney U | t-test: approximately normal or large n; Mann-Whitney: non-parametric | Revenue per user, session duration |71| Count data | Poisson or negative binomial regression | Count distribution, possible overdispersion | Pages per session, clicks |72| Rate metric | Delta method or bootstrap | Ratio metric (e.g., revenue/user) | ARPU, CTR |73| Time-to-event | Log-rank test, Cox regression | Survival analysis framework | Time to first purchase |7475### Key Statistical Concepts7677| Concept | Definition | Threshold |78|---------|-----------|-----------|79| p-value | Probability of observing this result if no true effect | < 0.05 (standard) |80| Confidence interval | Range likely containing the true effect | 95% CI does not cross zero |81| Statistical power | Probability of detecting a true effect | >= 80% (standard) |82| Effect size | Magnitude of the difference | Context-dependent |83| MDE | Smallest meaningful effect the test can detect | Set pre-experiment |84| Multiple testing correction | Adjustment for testing many metrics | Bonferroni or Benjamini-Hochberg |8586## Step 4: Effect Size and Practical Significance8788Go beyond statistical significance to assess business impact:8990### Effect Size Estimation9192| Measure | Formula | Interpretation |93|---------|---------|---------------|94| Absolute difference | Treatment mean - Control mean | Raw impact in original units |95| Relative lift | (Treatment - Control) / Control * 100% | Percentage improvement |96| Cohen's d | (Treatment mean - Control mean) / pooled SD | Small: 0.2, Medium: 0.5, Large: 0.8 |97| Number Needed to Treat (NNT) | 1 / Absolute difference in rates | Users needed to see one additional conversion |9899### Practical Significance Assessment100101| Scenario | Statistical Sig. | Practical Sig. | Decision |102|----------|-----------------|----------------|----------|103| Large effect, significant | YES | YES | Ship the treatment |104| Small effect, significant | YES | NO | Likely not worth complexity; consider costs |105| Large effect, not significant | NO | Maybe | Extend test, increase sample size |106| No effect, not significant | NO | NO | Revert to control, iterate on hypothesis |107108### Business Impact Projection109110```111Current baseline: [metric value] across [user count] users112Observed lift: [relative %] ([absolute diff] per user)113Projected annual impact: [lift * annual volume]114Revenue impact: [projected impact * revenue per unit]115Confidence range: [lower CI impact] to [upper CI impact]116```117118## Step 5: Segment Analysis119120Check if the treatment effect varies across segments:121122### Segment Breakdown Table123124| Segment | Control Conv. | Treatment Conv. | Lift | 95% CI | n (Control) | n (Treatment) | Significant? |125|---------|--------------|-----------------|------|--------|-------------|---------------|-------------|126| Mobile | [%] | [%] | [%] | [CI] | [n] | [n] | YES/NO |127| Desktop | [%] | [%] | [%] | [CI] | [n] | [n] | YES/NO |128| New users | [%] | [%] | [%] | [CI] | [n] | [n] | YES/NO |129| Returning users | [%] | [%] | [%] | [CI] | [n] | [n] | YES/NO |130| Region A | [%] | [%] | [%] | [CI] | [n] | [n] | YES/NO |131| Region B | [%] | [%] | [%] | [CI] | [n] | [n] | YES/NO |132133### Segment Analysis Cautions134135- Apply multiple testing correction when testing many segments136- Segment analyses are exploratory, not confirmatory — use them to generate hypotheses137- Require minimum sample size per segment (typically 1000+ per variant per segment)138- Report interaction effects, not just subgroup results139- Pre-register segments of interest before analyzing to avoid cherry-picking140141## Step 6: Decision Framework142143Synthesize all evidence into a clear recommendation:144145### Decision Matrix146147| Evidence | Ship Treatment | Iterate | Revert to Control |148|----------|---------------|---------|-------------------|149| Primary metric | Significant positive | Positive but not significant | Neutral or negative |150| Secondary metrics | Neutral or positive | Mixed | Negative on key metrics |151| Guardrail metrics | All pass | All pass | Any fail |152| Practical significance | Meaningful business impact | Marginal impact | No impact |153| Segment effects | Consistent or favorable | Varies — consider targeting | Negative in key segments |154| Implementation cost | Acceptable | High — weigh against benefit | Any cost is unjustified |155156### Recommendation Template157158```159DECISION: [Ship / Iterate / Revert]160CONFIDENCE: [High / Medium / Low]161162EVIDENCE SUMMARY:163- Primary metric: [direction] [magnitude], p = [value]164- Secondary metrics: [summary]165- Guardrail metrics: [pass/fail status]166- Business impact: [projected annual value]167168RISKS:169- [Risk 1 and mitigation]170- [Risk 2 and mitigation]171172NEXT STEPS:1731. [Action item with owner]1742. [Action item with owner]1753. [Action item with owner]176```177178## Output Format179180Present the A/B test analysis as:1811821. **Executive Summary** (1-2 sentences: did the test win, by how much, what to do)1832. **Experiment Overview** (hypothesis, variants, duration, sample sizes)1843. **Data Validation** (SRM check, pre-exposure balance, instrumentation)1854. **Statistical Results** (primary/secondary/guardrail metrics with p-values and CIs)1865. **Effect Size and Business Impact** (practical significance, revenue projection)1876. **Segment Analysis** (key segments with differential effects)1887. **Decision and Recommendation** (ship/iterate/revert with rationale)1898. **Learnings and Next Experiments** (what was learned, what to test next)190191## Quality Checklist192193Before delivering the analysis, verify:194195- [ ] Sample Ratio Mismatch check has been performed196- [ ] Pre-exposure bias has been assessed197- [ ] Statistical test is appropriate for the metric type198- [ ] Confidence intervals are reported alongside p-values199- [ ] Multiple testing correction is applied when analyzing many metrics200- [ ] Effect size is interpreted in practical (not just statistical) terms201- [ ] Guardrail metrics have been checked202- [ ] Segment analysis includes sample size and significance per segment203- [ ] Decision recommendation is clear and actionable204205## Edge Cases206207- **Underpowered test (insufficient sample)**: Do not declare "no effect" — state the test was inconclusive; calculate the power achieved and the MDE it could detect208- **Multiple treatment variants (A/B/C/D)**: Apply Bonferroni or Dunnett's correction; compare each treatment to control, not to each other209- **Peeking (checking results early)**: Use sequential testing methods (e.g., always-valid p-values, group sequential boundaries) or wait for full sample210- **Network effects**: Standard A/B tests assume independence — use cluster randomization or switchback designs for social/marketplace features211- **Long-term effects**: Short tests may miss delayed impacts; run holdout groups for 30-90 days post-experiment to measure persistence212- **Ratio metrics (e.g., revenue per user)**: Use delta method or bootstrap for variance estimation — standard t-tests can be misleading for ratios