Home/Blog/A/B Testing Statistics: Significance, Sample Size, Peeking and Sequential Tests
Back to Blog

A/B Testing Statistics: Significance, Sample Size, Peeking and Sequential Tests

August 22, 2026
24 min read
By DSTechnoverse
Statistics & Data Science

A/B testing statistics worked through by hand: the two-proportion z-test on 400/10,000 vs 460/10,000, a sample-size calculation for a minimum detectable lift, why peeking inflates false positives, sequential designs and Bayesian vs frequentist analysis.

A/B Testing Statistics: Significance, Sample Size, Peeking and Sequential Tests

Quick answer: A/B testing statistics is the set of methods that tells you whether a difference between two versions of a page, email or product feature is real or just chance. For conversion rates, the standard tool is the two-proportion z-test: pool the conversions, compute a standard error, divide the observed difference by it, and read a p-value and a confidence interval. The arithmetic is easy. What makes a test trustworthy is fixing the sample size in advance, not stopping the moment the dashboard turns green, and reporting the interval as well as the p-value.

A/B testing statistics is hypothesis testing applied to a product or marketing decision. The statistics are not complicated; the discipline is. Most tests that mislead do so because of how they were run, not because the maths was wrong. This guide covers a conversion rate test end to end: design, sample size for an A/B test, the two-proportion z-test by hand, the peeking problem, sequential testing, and Bayesian vs frequentist analysis.

It assumes you know what a null hypothesis is. If you need that foundation, start with hypothesis testing in data science and the p-value explained without the jargon, then come back.

What A/B Testing Statistics Actually Answers

An A/B test compares a control (A) against a variant (B) on one primary metric, with users randomly assigned to each. Randomisation is what buys you a causal interpretation. It is the only reason you can say the change caused the difference rather than merely accompanying it, because every other influence is spread across both arms by chance.

The statistical question is narrow: if the two versions truly performed identically, how surprising would a gap this large be? That is the question a p-value answers. Stakeholders usually want something else: "how likely is B better, and by how much?" Keeping those questions apart is half of reading an experiment correctly.

ElementWhat it must be
Unit of randomisationConsistent, usually the user rather than the session or page view
Primary metricOne, defined in writing before launch
Guardrail metricsMetrics that must not degrade, such as page load time, refunds or unsubscribes
Minimum detectable effectThe smallest lift worth acting on, agreed with the decision-maker
Sample sizeFixed in advance from a power calculation
DurationAt least one full business cycle, usually one to two weeks
Stopping ruleFixed horizon or a named sequential design, chosen before launch
Analysis planWritten before any data arrives, including any segments

If the primary metric is chosen after seeing the results, the test has become an exploratory analysis and its p-value no longer means what it claims. The same is true of segments chosen after the fact. This is the experimental version of a mistake covered in common statistical mistakes in research.

Which Test for Which Metric

Most A/B testing tools default to a conversion rate test, but not every metric is a proportion. Matching the test to the metric matters as much as the sample size.

Metric typeExampleUsual test
Binary per userConverted or not, clicked or notTwo-proportion z-test, or chi-square test on a 2 x 2 table
Continuous per userRevenue per user, time on pageWelch's t-test, often on a capped or transformed value
Count per userOrders per user, sessions per usert-test on per-user counts, or a Poisson or negative binomial model
Ratio of totalsRevenue per order, clicks per page viewDelta method or bootstrap, because the denominator is random too
Three or more variantsA, B, C, DPairwise tests against control with a multiplicity correction

For the general decision of which test fits which data, see how to choose the right statistical test. The rest of this guide uses a binary conversion metric.

The Two-Proportion Z-Test, Worked by Hand

This is the calculation behind most "significant at 95%" badges in experimentation dashboards.

Illustrative data (invented for this example): a checkout page test runs until each arm has 10,000 users.

ArmUsers (n)Conversions (x)Conversion rate (p)
A (control)10,0004000.0400 (4.0%)
B (variant)10,0004600.0460 (4.6%)

The hypotheses are H0: pA = pB and H1: pA ≠ pB. The test is two-sided, because you need to know if the variant is worse as well as if it is better.

Step 1: The Observed Difference

Difference = pB − pA = 0.0460 − 0.0400 = 0.0060, or 0.6 percentage points.

The relative lift is 0.0060 / 0.0400 = 15%. Report both. A "15% lift" sounds large; "0.6 points" tells the reader what it means in orders.

Step 2: The Pooled Proportion

Under the null hypothesis both arms share one true conversion rate, so the best estimate of it combines both arms:

p̂ = (xA + xB) / (nA + nB) = (400 + 460) / (10,000 + 10,000) = 860 / 20,000 = 0.0430

Step 3: The Standard Error Under the Null

SE0 = √[ p̂ (1 − p̂) × (1/nA + 1/nB) ]

  • p̂ (1 − p̂) = 0.043 × 0.957 = 0.041151
  • 1/nA + 1/nB = 1/10,000 + 1/10,000 = 0.0002
  • Product = 0.041151 × 0.0002 = 0.0000082302
  • SE0 = √0.0000082302 = 0.0028688

Step 4: The Z Statistic

z = (pB − pA) / SE0 = 0.0060 / 0.0028688 = 2.09

Step 5: The P-Value

For a two-sided test, p = 2 × P(Z > 2.0914). The upper-tail area beyond 2.0914 on the standard normal curve is 0.0182, so:

p = 2 × 0.0182 = 0.036

At α = 0.05 the result is statistically significant: if the two versions truly converted at the same rate, a gap of 0.6 points or more in either direction would turn up in about 3.6% of tests this size.

Step 6: The Confidence Interval for the Difference

The interval does not assume the null is true, so it uses the unpooled standard error, with each arm's own rate:

SE = √[ pA(1 − pA)/nA + pB(1 − pB)/nB ]

  • pA(1 − pA)/nA = 0.04 × 0.96 / 10,000 = 0.00000384
  • pB(1 − pB)/nB = 0.046 × 0.954 / 10,000 = 0.0000043884
  • Sum = 0.0000082284, so SE = 0.0028685

95% CI = 0.0060 ± 1.96 × 0.0028685 = 0.0060 ± 0.0056 = 0.0004 to 0.0116

In plain terms, the variant's true advantage is plausibly anywhere from 0.04 points to 1.16 points. In relative terms that is roughly a 1% to 29% lift. The interval excludes zero, which agrees with p < 0.05, but its lower end is tiny.

What the Worked Example Teaches

The test "won", yet the honest summary is: the variant very probably helps, by an amount the data cannot pin down. Whether to ship depends on whether a lift as small as 0.04 points would still justify the change. That is a business judgement the p-value cannot make for you.

There is a second lesson hiding here. As the next section shows, detecting a lift from 4.0% to 4.6% with 80% power needs about 18,000 users per arm. With 10,000 per arm this test had only about 55% power: a true 15% lift of exactly this size would be missed almost half the time. Significant results from underpowered tests also overstate the effect, because only lucky high draws cross the line. A result that only just clears the threshold in an underpowered test deserves a confirmatory run before anyone builds a forecast on "15%".

A chi-square test on the same 2 x 2 table, without continuity correction, gives χ² = z² ≈ 4.37 and the identical p-value.

Sample Size for an A/B Test

The single most valuable calculation in A/B testing statistics happens before any traffic is allocated. Sizing the test sets what it can and cannot detect.

You need four inputs:

  1. Baseline conversion rate (p1), measured from recent historical data, not guessed.
  2. Minimum detectable effect (MDE): the smallest change worth acting on, stated in absolute terms so p2 = p1 + MDE.
  3. Significance level α, usually 0.05 two-sided, giving z(α/2) = 1.96.
  4. Power (1 − β), usually 80%, giving z(β) = 0.84; for 90% power use 1.28.

The standard formula for users per arm is:

n = [ z(α/2) × √(2 p̄ (1 − p̄)) + z(β) × √(p1(1 − p1) + p2(1 − p2)) ]² / (p2 − p1)²

where p̄ = (p1 + p2) / 2.

Worked Sample-Size Calculation

Illustrative inputs: baseline 4.0%, and the team will act on a lift to 4.6% (an MDE of 0.6 points, or 15% relative), at α = 0.05 and 80% power.

  • p̄ = (0.040 + 0.046) / 2 = 0.043
  • First term: 1.96 × √(2 × 0.043 × 0.957) = 1.96 × √0.082302 = 1.96 × 0.28688 = 0.5623
  • Second term: 0.8416 × √(0.0384 + 0.043884) = 0.8416 × √0.082284 = 0.8416 × 0.28685 = 0.2414
  • Sum = 0.8037, squared = 0.6459
  • Divide by (0.006)² = 0.000036: n = 0.6459 / 0.000036 ≈ 17,943 users per arm

That is roughly 36,000 users in total. Raising power to 90% pushes it to about 24,000 per arm. At 3,000 eligible users a day, the 80% design takes about 12 days.

A widely used shortcut, n ≈ 16 × p(1 − p) / Δ², gives 16 × 0.04 × 0.96 / 0.000036 ≈ 17,067 per arm. The constant 16 comes from 2 × (1.96 + 0.84)², rounded. It slightly underestimates because it ignores the variant's higher variance.

How Baseline and MDE Drive the Numbers

Users per arm at α = 0.05 two-sided and 80% power, from the full formula:

Baseline rateRelative lift to detectAbsolute changeUsers per arm
2%20%0.4 pointsabout 21,100
4%20%0.8 pointsabout 10,300
4%15%0.6 pointsabout 17,900
4%10%0.4 pointsabout 39,500
4%5%0.2 pointsabout 154,300
10%10%1.0 pointabout 14,800
25%10%2.5 pointsabout 4,900

Two lessons fall straight out of the table. Low-baseline metrics need large samples, which is why a test on checkout completion (high baseline) is far cheaper than a test on homepage-to-purchase conversion (low baseline). And small lifts are expensive: required sample size scales with one over the effect squared, so halving the MDE roughly quadruples the traffic needed.

If the traffic is not there, do not run the test at a smaller size and interpret the result anyway. Test a bolder change, move to a higher-frequency proxy metric further up the funnel, reduce variance (see below), or accept that this decision will be made on judgement. The general logic of power, effect size and why underpowered studies mislead is covered in statistical power and effect size; the survey-oriented version of these formulas is in how to calculate sample size for your study.

Reducing Variance Instead of Adding Traffic

Variance reduction can buy the same power with fewer users. The best-known method, often called CUPED, adjusts each user's outcome using a pre-experiment measurement of the same metric. If the pre-period value correlates with the outcome at ρ, the variance falls by a factor of (1 − ρ²). At ρ = 0.5 that is a 25% reduction, worth the same as 25% fewer users needed. It works best for metrics with stable user-level history and does little for first-visit conversion. It is essentially regression adjustment, the same idea as including a baseline covariate in a regression model.

The Peeking Problem

Checking the dashboard daily and stopping when p < 0.05 first appears is the most common and most damaging error in A/B testing. It is known as the peeking problem.

The false positive rate of a fixed-horizon test is 5% only if you look once, at the planned end. Every extra look is another chance for random noise to cross the line, and once it has crossed, a peeker stops and declares a winner. The classic results for equally spaced looks at a nominal two-sided α of 0.05 are:

Number of looksActual false positive rate
15%
2about 8%
3about 11%
5about 14%
10about 19%
20about 25%
Continuous monitoring with no limitApproaches 100% given enough time

Under unlimited monitoring, a test between two identical variants will eventually show p < 0.05 by chance. "We stopped when it hit significance" is therefore not evidence of anything. The reverse habit, abandoning a test early because it "looks flat", is the same error with the opposite sign and biases you towards concluding there is no effect.

Peeking also inflates effect sizes. A test stopped at the first significant moment is, by construction, stopped at a moment when noise was flattering the variant. Lifts measured this way routinely shrink after launch. The fix is not to stop looking (monitoring guardrails for breakage is essential) but to separate looking from deciding.

Sequential Testing: Looking Early Without Cheating

If the business genuinely needs the option to stop early, sequential testing provides it while keeping the overall false positive rate at α. There are three practical families.

Group Sequential Designs

You plan a fixed number of interim analyses in advance and use stricter thresholds at the early looks. The two classic boundary shapes, for five equally spaced looks at overall two-sided α = 0.05, are:

LookO'Brien-Fleming boundary (z)Pocock boundary (z)
1 (20% of data)4.562.41
2 (40%)3.232.41
3 (60%)2.632.41
4 (80%)2.282.41
5 (100%)2.042.41

O'Brien-Fleming makes early stopping hard, so the final threshold stays close to the usual 1.96 and the maximum sample size rises by only about 3%. Pocock uses the same threshold at every look, making early stopping easier but requiring about 20% more users if the test runs to the end. Alpha-spending functions (Lan-DeMets) generalise both and allow looks at unplanned times, provided the spending rule itself was fixed in advance. Applied to the worked example, a z of 2.09 at the final look would pass the O'Brien-Fleming boundary of 2.04 but fail Pocock's 2.41, which shows why the design must be chosen before the data arrives.

Always-Valid Inference

Methods such as the mixture sequential probability ratio test produce p-values and confidence sequences that remain valid however often you look and whenever you stop. The cost is power: for a given sample, an always-valid test is less sensitive than a fixed-horizon test that is looked at once.

The simplest valid option remains a fixed horizon: fix n, watch guardrails daily for bugs, and read the primary metric once. Whichever approach you choose, write it into the analysis plan before launch.

Bayesian vs Frequentist A/B Testing

The Bayesian vs frequentist A/B testing debate generates more heat than it deserves; the two answer different questions. A frequentist analysis asks: if there were no true difference, how surprising is this data? A Bayesian analysis starts from a prior distribution for each conversion rate, updates it with the data, and reports the probability that B beats A and the expected loss from choosing wrongly.

The Same Data, Analysed the Bayesian Way

Using a flat Beta(1, 1) prior on each conversion rate, the posteriors for the worked example are Beta(1 + 400, 1 + 9,600) = Beta(401, 9,601) for A and Beta(461, 9,541) for B. Drawing a large number of samples from each posterior and comparing them gives:

  • P(B > A) ≈ 0.98
  • 95% credible interval for pB − pA ≈ 0.0004 to 0.0116
  • Expected loss from choosing B if A is actually better: about 0.002 percentage points, which is negligible

With a flat prior and this much data, the Bayesian credible interval almost exactly matches the frequentist confidence interval, and P(B > A) is close to one minus the one-sided p-value (1 − 0.018). The numbers converge; what differs is the vocabulary and the decision rule.

FrequentistBayesian
Main outputp-value, confidence intervalP(B > A), credible interval, expected loss
Interpretation"Could this gap be chance?""How likely is B better, and what does being wrong cost?"
Continuous monitoringInvalid without a sequential designBetter behaved with an informative prior and a loss-based rule, but not immune
Requires up frontα, power, fixed n or stopping ruleA prior and a decision threshold
StrengthStandardised, easy to auditMaps directly onto business decisions
Common misusePeeking, "nearly significant"Flat priors plus "stop when P(B > A) passes 95%"

Bayesian testing is not a licence to peek without consequence. A flat prior combined with a rule of "stop as soon as P(B > A) exceeds 95%" has its own early-stopping bias and will declare false winners more often than its users expect. Bayesian methods are a genuinely better fit when the decision is about expected value (ship the variant that probably earns more) rather than about publishing a claim that an effect exists.

Reading A/B Testing Statistics Correctly

Type I and Type II errors

Report three numbers, always:

  • Absolute difference, for example "conversion rose from 4.0% to 4.6%, +0.6 points"
  • Confidence interval, for example "95% CI +0.04 to +1.16 points"
  • P-value, for example "p = 0.036"

The interval is what makes a result actionable. The same p-value can sit on very different intervals:

ResultInterval for the differenceWhat it means
Significant, narrow+0.5 to +0.9 pointsReal lift, size well estimated: ship with confidence
Significant, wide+0.04 to +1.16 pointsLift is probably real, size uncertain: consider confirming
Not significant, narrow−0.1 to +0.2 pointsThe change is genuinely neutral: a useful finding
Not significant, wide−1.5 to +2.0 pointsThe test was too small to learn anything

The last two rows share a p-value above 0.05 but lead to opposite conclusions. "No significant difference" is only evidence of no effect when the interval is narrow enough to rule out effects that matter.

What about p = 0.07? It means the evidence did not reach your pre-set threshold. It does not mean "almost significant" or "trending towards significance"; both phrases try to claim a result the data did not support. The honest options are to accept the null decision, or to state openly that this was exploratory and run a properly sized confirmatory test. For how to write these results up so they survive review, see presenting statistical results.

Traps That Invalidate Real Tests

Sample ratio mismatch. If a 50/50 split delivers 10,250 users to A and 9,750 to B, test the split before reading any outcome. A chi-square goodness-of-fit test gives χ² = (250² / 10,000) × 2 = 12.5, with p ≈ 0.0004. A split that lopsided by chance is very unlikely, so something is broken in assignment, redirects, bot filtering or logging, and every downstream comparison is suspect. By contrast, 10,100 versus 9,900 gives χ² = 2.0 and p ≈ 0.16, which is unremarkable.

Novelty and primacy effects. Existing users react to change itself, not to the design. Early lifts often decay as novelty wears off. Run for at least one full weekly cycle and compare new against returning users.

Testing too many variants. Four variants against one control is four comparisons. If each is tested at 0.05, the chance of at least one false winner is far above 5% (for four independent comparisons it would be 1 − 0.95⁴ ≈ 19%). A Bonferroni correction tests each at 0.05 / 4 = 0.0125; Holm's method is a less conservative alternative. Extra arms also split traffic, raising the duration needed. The logic of comparing several groups at once is the same one discussed in ANOVA vs t-test.

Metric cherry-picking. Twenty metrics tracked, one significant, that one reported. Declare the primary metric before launch and label everything else exploratory. A dashboard that surfaces every metric with a green or red badge invites this; see choosing KPIs for a business dashboard.

Wrong unit of analysis. If users are randomised but the analysis treats page views as independent, heavy users count many times and the standard error is understated. Analyse at the unit you randomised, or use methods (the delta method, clustered standard errors) that respect it.

Interference between arms. Marketplaces, social products and shared inventory break the assumption that one user's treatment does not affect another's. Cluster-randomised or switchback designs exist for this.

Segment mining after the fact. "It did not work overall, but it worked for Android users in tier-2 cities" is a hypothesis, not a finding. Confirm it in a new test designed for that segment.

A Pre-Launch Checklist for a Conversion Rate Test

  1. Primary metric named, with a written definition including the denominator.
  2. Guardrail metrics named, with the degradation that would stop the test.
  3. Baseline rate measured from the last four to eight weeks of data.
  4. MDE agreed with the decision-maker by asking: "what lift would make us ship this?"
  5. Sample size and duration calculated, rounded up to whole weeks, and committed.
  6. Randomisation unit chosen and assignment verified with an A/A test.
  7. Stopping rule written down: fixed horizon or a named sequential design.
  8. Analysis plan written, including any segments and the multiplicity correction.
  9. Sample ratio mismatch check scheduled as the first step of analysis.

An A/A test, where both arms get the identical experience, is the most underused item on that list. Over many A/A tests, about 5% should show p < 0.05. If yours flag differences far more often, your instrumentation or randomisation is broken and every test you have run on that setup is suspect.

Analysing an A/B Test in Practice

A scripted analysis is easier to audit and reuse than a spreadsheet. In R, the base function prop.test runs the two-proportion test (switch off its default continuity correction to match the hand calculation above), and power.prop.test sizes the test. In Python, the statsmodels library offers proportions_ztest for the test and NormalIndPower with proportion_effectsize for sizing; note that the latter uses Cohen's h, an arcsine-transformed effect size, so its answer differs slightly from the formula in this guide. If you are new to R, getting started with R for statistical analysis covers the basics.

A good script runs the steps in a fixed order: sample ratio, guardrails, the primary metric's difference, interval and p-value, any planned correction, and only then pre-registered segments.

Where test results feed management reporting, show the interval on the dashboard, not just the lift and a significance badge. Why business dashboards fail explains how single-number reporting leads to exactly the misreadings described here. Experiments are one of the few tools that establish why something happened rather than describing it; see the types of data analytics.

How DSTechnoverse Helps

DSTechnoverse helps product, marketing and research teams design and analyse experiments that hold up to scrutiny. Through our statistical research and data analysis service we calculate sample sizes and minimum detectable effects, write analysis plans and stopping rules, run two-proportion, t-test, sequential and Bayesian analyses in R, Python, SPSS or Stata, and explain the results in plain language with intervals and tables. Our data analytics team can build the tracking, sample ratio checks and reporting that keep tests honest over time. To discuss a test you are planning or a result you are unsure how to read, contact us.

Frequently Asked Questions

What is statistical significance in an A/B test? It means the observed difference between variants would be unlikely, at your chosen threshold (usually 5%), if the two versions truly performed the same. It does not tell you the probability that B is better, nor how large the lift is. For that, read the confidence interval alongside the p-value and judge whether the plausible range of effects is worth acting on.

How do I calculate the sample size for an A/B test? You need the baseline conversion rate, the minimum lift worth detecting, the significance level (usually 0.05) and the power (usually 80%). Plug them into the two-proportion sample-size formula. A quick approximation is n ≈ 16 × p(1 − p) / Δ² per arm, where Δ is the absolute difference. For a 4% baseline and a 0.6-point lift, that is roughly 17,000 to 18,000 users per arm.

How long should an A/B test run? Until it reaches the pre-calculated sample size, and for at least one full business cycle, usually one to two weeks, so that weekday and weekend behaviour both appear in each arm. Divide the required total sample by daily eligible traffic and round up to whole weeks. Do not end the test early because it looks significant or because it looks flat.

What is the peeking problem? It is the inflation of false positives that occurs when you check a fixed-horizon test repeatedly and stop as soon as p drops below 0.05. With five looks the real false positive rate is about 14%, and with unlimited looks it approaches certainty. Either look once at the planned end, or use a sequential testing design that adjusts the thresholds for each look.

When should I use a two-proportion z-test? Use it for a binary outcome per user, such as converted or not, with two independently randomised groups and reasonably large counts, typically at least 10 successes and 10 failures in each arm. For continuous metrics like revenue per user, use Welch's t-test. For ratio metrics such as revenue per order, use the delta method or a bootstrap.

Is Bayesian A/B testing better than frequentist? Neither is universally better. Bayesian analysis reports the probability that B beats A and the expected loss, which suits shipping decisions. Frequentist analysis is more standardised and easier to audit. With a flat prior and plenty of data the two give very similar numbers. Both fail in the same way when stopping is undisciplined, so the stopping rule matters more than the framework.

What does a p-value of 0.06 mean in an A/B test? It means the evidence did not reach the 0.05 threshold you set. Treat the result as not significant, then look at the confidence interval: if it is narrow around zero the change is probably neutral; if it is wide the test was too small. Do not describe it as nearly significant, and do not extend the test simply to push the p-value under 0.05.

Should I use a one-tailed test for an A/B test? Usually not. You need to know whether the variant is worse as well as whether it is better, and a one-tailed test cannot detect harm. Switching to one tail after seeing the direction of the result halves the p-value without any new evidence, which is a form of p-hacking. Pre-register a two-sided test unless there is a strong, documented reason.

What is sample ratio mismatch? It is a statistically significant deviation from the intended traffic split, for example 10,250 versus 9,750 on a planned 50/50 test, which gives p ≈ 0.0004 on a chi-square test. It indicates a bug in assignment, redirects, bot filtering or logging. Always check it before reading results, because a mismatch can bias every comparison that follows.

What can I do if I do not have enough traffic? Test bolder changes with larger expected effects, use a metric further up the funnel where events are more frequent, reduce variance with pre-experiment covariates, or run the test longer. If none of these is enough, accept that the decision will rest on judgement and qualitative evidence rather than running an underpowered test and over-reading its result.


Need the statistics done properly? DSTechnoverse runs study design, sample size calculation, hypothesis testing and reporting for research teams, businesses and PhD scholars — in R, Python, SPSS and Stata. We are based in Indore, Madhya Pradesh and work with clients across India. See our statistical research and data analysis and data analytics services, or talk to our team about your study.

Sources and Further Reading

Official and primary sources for the standards, rules and data discussed on this page.

Share

Tags

A/B testingexperiment designconversion rate optimisationstatistical significancesequential testingp-valuedata science

Explore More Articles

Discover more insights and updates from DSTechnoverse

View All Articles