Chapter 8 of 11
Course Progress0 of 11 completed (0%)

Data Analytics & Business Intelligence · Chapter 8 · ~15 min · Intermediate

Applied Business Statistics & A/B Testing: Significance & MDE

Frame testable hypotheses, calculate p-values and minimum detectable effect (MDE), and avoid sample ratio mismatch.

  • Formulate rigorous null and alternative hypotheses for business experiments
  • Understand p-values, alpha thresholds (0.05), and statistical power (80%)
  • Calculate Minimum Detectable Effect (MDE) and required sample sizes before launch
  • Detect Sample Ratio Mismatch (SRM) and avoid peeking bias in production tests

Applied Business Statistics & A/B Testing: Significance & MDE: learn it visually

Frame testable hypotheses, calculate p-values and minimum detectable effect (MDE), and avoid sample ratio mismatch.

Applied Business Statistics & A/B Testing: Significance & MDEFrame testable hypotheses, calculate p-values and minimum detectable effect (MDE), and avoid sample ratio mismatch.UNDERSTANDApplied BusinessStatisticsFOLLOW THE FLOWA/B TestingAPPLY ITSignificanceApplied Business Statistics & A/B Testing: Significance & MDEFrame testable hypotheses, calculate p-values and minimum detectable effect (MDE), and avoid sample ratio mismatch.UNDERSTANDApplied BusinessStatisticsFOLLOW THE FLOWA/B TestingAPPLY ITSignificance

1The Scientific Method in Business: H0 vs. H1

Every quarter, product managers and marketers propose hundreds of ideas: "Make the checkout button green," "Simplify sign-up into 2 steps," or "Add customer review badges." Without rigorous testing, the loudest voice in the room (the HiPPO — Highest Paid Person's Opinion) wins.

Controlled randomized experimentation (A/B Testing) protects companies from making costly mistakes. Before deploying any code to 100% of customers, we partition incoming traffic randomly and test two formal statistical hypotheses:

Null Hypothesis (H0)

The Status Quo

"The new variation has no effect on conversion. Any observed difference in checkout rate between Version A and Version B is pure random sampling noise."

Alternative Hypothesis (H1)

The Challenger Effect

"The new variation produces a statistically significant increase in checkout rate compared to the baseline control."

In classical hypothesis testing, H0 is assumed true until proven guilty beyond a reasonable doubt. That threshold of doubt is the Significance Level (α), universally set at α = 0.05 (5%).

Concept Check

An e-commerce team tests a 1-click checkout feature against the multi-page checkout. What is the correct formulation of the Null Hypothesis (H0)?

2P-Values, Power & Avoiding False Wins

When you run an experiment, you face two fundamental statistical error risks:

Type I Error (α = 0.05) · False Positive

Crying Wolf

Concluding the new button won when it actually made no difference. Controlled strictly by your alpha threshold (≤ 5%).

Type II Error (β = 0.20) · False Negative

Missing a Real Win

Concluding the feature had no effect when it actually would have driven millions. Controlled by Statistical Power (1 - β = 80%).

Wrong idea: P-value is the probability that Variant B is truly better

p = 0.03 → "97% chance B is superior!"Flaw: Inverts conditional probability (Bayesian fallacy)

Assuming p = 0.03 means there is a 97% probability the new checkout page beats the original.

Real system: P-value is the probability of seeing this data by pure random chance

P(Data | H0 is true) = 0.03 ≤ 0.05 → Reject H0Standard frequentist interpretation: Evidence against pure luck

Assuming the null hypothesis is true (no real difference exists), p is the probability of observing an effect this extreme or more.

Here is how a senior data analyst calculates the two-proportion z-statistic and 95% confidence interval in Python:

import math

def two_proportion_z_test(c_vis, c_conv, t_vis, t_conv, alpha=0.05):
    # Proportions
    p_c = c_conv / c_vis
    p_t = t_conv / t_vis
    
    # Pooled conversion rate under H0
    p_pooled = (c_conv + t_conv) / (c_vis + t_vis)
    
    # Standard Error
    se = math.sqrt(p_pooled * (1 - p_pooled) * (1/c_vis + 1/t_vis))
    z_score = (p_t - p_c) / se
    
    # Critical threshold for two-sided alpha=0.05 is 1.96
    is_significant = abs(z_score) >= 1.96
    relative_lift = (p_t - p_c) / p_c
    
    return {
        "z_score": round(z_score, 3),
        "significant": is_significant,
        "relative_lift_pct": round(relative_lift * 100, 2)
    }

3Interactive Simulator: Power, MDE & SRM Diagnostics

The Minimum Detectable Effect (MDE) is the smallest relative lift your test is powered to detect. Detecting tiny improvements (+1% lift) requires enormous sample sizes (hundreds of thousands of visitors). Explore how changing baseline rates and expected lift affects sample size and duration below:

Interactive A/B Test Power, MDE & SRM Simulator

Traffic Split: 50 / 50 Clean
Baseline Conv. Rate:4.0%

Historical conversion rate of current page

Expected Relative Lift (MDE):+15%

Smallest improvement worth detecting

Daily Traffic / Arm:1,500

Visitors assigned to each variation per day

Required Sample Size / Arm

17,922

Target needed for 80% statistical power at α = 0.05

Estimated Duration

12 Days

✅ Feasible business testing cycle (< 4 weeks)

Absolute Target Rate

4.60%

Variant must hit this to detect effect (+0.60% absolute)

Null Hypothesis (H0) vs. Alternative Hypothesis (H1) Power Curveα = 0.05 (Two-sided rejection ±1.96σ)
Critical Z (1.96)H0 (No Lift)H1 (MDE +15%)Statistical Power (80%)

The green dashed curve shows the alternative hypothesis. To reach 80% power, 80% of its area must sit to the right of the red critical Z threshold line.

Sample Ratio Mismatch (SRM) Health Check

Test whether your randomization engine delivered a true 50/50 allocation.

Control Group (Original):

10,000 users (49.9%)

Variant Group (New Feature):

10,040 users (50.1%)

Concept Check

You launch a 50/50 test. After 5 days, Control has 50,200 visitors, but Variant B has only 39,800 visitors. The conversion rate for Variant B is 25% higher. What should you do?

4Bug Hunt: A/B Test Significance & SRM Validator

A junior data analyst wrote an automated script to evaluate company A/B tests. However, the function has three dangerous flaws: it checks conversion lift without verifying Sample Ratio Mismatch, lacks a minimum sample size guardrail, and skips pooled proportion standard error calculations.

Refactor the validator function below, then click Run & verify:

Python Bug Hunt · A/B Test Significance & SRM Validator
Python

🎯 Find and fix the bugs in the code above, then press Run & verify to test your solution.

Need a hint?
  • Add an SRM balance check: compare control_visitors and test_visitors. If traffic ratio deviates significantly from 50/50, flag srm_detected: True.
  • Enforce a minimum visitor threshold (e.g. control_visitors < 1000 or test_visitors < 1000).
  • Calculate pooled conversion rate p_pooled = (control_conversions + test_conversions) / (control_visitors + test_visitors) and verify significance using standard error.

5Chapter Knowledge Challenge

Solidify your experimentation principles before moving to visual analytics:

Concept Check 1 of 2
1

Why does detecting a smaller Minimum Detectable Effect (e.g., +2% lift vs +20% lift) require a vastly larger sample size?

Concept Check 2 of 2
2

What is the primary danger of running an A/B test with an underpowered sample size (e.g., 30% statistical power instead of 80%)?

6Recap

  • The Null Hypothesis (H0) assumes zero difference between variants; the Alternative Hypothesis (H1) claims a measurable impact.
  • The P-value measures the likelihood of observing experimental differences by pure chance assuming H0 is true.
  • Standard testing uses α = 0.05 (5% Type I false positive risk) and Power = 80% (20% Type II false negative risk).
  • Always pre-calculate required sample size using Minimum Detectable Effect (MDE) and test for Sample Ratio Mismatch (SRM) to guard against telemetry corruption.

Ready for Chapter 9? Mark this chapter as complete to proceed:

Enjoying this free lesson? Your support helps us build more free animated chapters.

Support Us