Sample size calculated before experiment launch
Why it matters
Launching an A/B test without calculating required sample size means you have no principled stopping rule. Teams peeking at early results and declaring a winner at 200 contacts when 800 were needed inflate false positive rates from 5% to 25% or higher — a phenomenon called peeking bias. You ship subject lines, CTAs, or send times based on noise rather than signal. In iso-25010:2011 terms this is a functional-suitability failure: the experiment tooling exists but cannot reliably distinguish a real effect from random variance. The Campaign Orchestration & Sequencing Audit covers how these flawed signals propagate into branching decisions.
Severity rationale
High because experiments evaluated without a pre-calculated sample size routinely produce false positives, causing teams to deploy losing variants with statistical confidence that the system never actually earned.
Remediation
Implement a sample size calculator and require the field to be set before experiment launch. Block the launch action at the API layer until required_sample_size is populated:
function requiredSampleSize(
baselineRate: number, // e.g. 0.25 for 25% open rate
minimumDetectableEffect: number, // e.g. 0.05 for +5pp lift
alpha = 0.05,
power = 0.80
): number {
const p1 = baselineRate
const p2 = baselineRate + minimumDetectableEffect
const pBar = (p1 + p2) / 2
const zAlpha = 1.96 // two-tailed, alpha=0.05
const zBeta = 0.842 // power=0.80
const n = Math.pow(
zAlpha * Math.sqrt(2 * pBar * (1 - pBar)) +
zBeta * Math.sqrt(p1 * (1 - p1) + p2 * (1 - p2)),
2
) / Math.pow(p2 - p1, 2)
return Math.ceil(n)
}
// Example: 25% baseline, detect +5pp lift → 768 contacts per variant
const n = requiredSampleSize(0.25, 0.05)
Store the result on the experiment record and add a pre-launch validation that rejects experiments where required_sample_size is null or zero.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Campaign Analytics & Attribution Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · functional-suitability — Functional suitability — functional correctness
Taxons
History
- 2026-04-18·v1.0.0·Initial import from campaign-analytics-attribution·automated