Experimental Design
Core principle: Define what counts as evidence before you collect it. A well-designed experiment eliminates alternative explanations so only one conclusion survives. Pre-registration is the firewall between discovery and self-deception.
When to Use This Skill
- A decision hinges on a factual claim no one has tested
- Someone proposes an A/B test but hasn't defined success criteria
- epistemic-mapping flagged a dangerous assumption needing validation
- A team is about to invest resources based on an unvalidated hypothesis
- Prior experiment results were inconclusive and need a better design
Core Methodology
Step 1: Convert the Question into a Testable Hypothesis
Take the vague question ("Does feature X improve retention?") and produce a precise, falsifiable hypothesis pair.
- H₀ (null): The default — no effect. "Feature X has no effect on 30-day retention."
- H₁ (alternative): The claim. "Feature X increases 30-day retention by ≥ 2 percentage points."
State the direction. One-tailed when you only care about improvement; two-tailed when you also need to detect harm. Default two-tailed unless strong prior reason to expect one direction.
If a hypothesis isn't falsifiable — if no observable outcome could disprove it — rewrite it.
Step 2: Identify Variables
- Independent variable (IV): What you manipulate. One per experiment unless factorial design with sufficient power.
- Dependent variable (DV): What you measure. The metric closest to the outcome you care about. Proxies introduce noise.
- Controlled variables: Held constant across conditions.
- Potential confounders: Could vary between groups and affect DV independently. List them all, then design controls (randomization, stratification, matching, statistical control).
Step 3: Select the Experimental Design
Randomized Controlled Trial (RCT / A/B test) — Gold standard. Random assignment eliminates confounding. Use when you can randomize and have sample size.
Quasi-experimental — When randomization is impossible:
- Difference-in-differences: Treated vs. untreated, before vs. after. Requires parallel trends.
- Regression discontinuity: Exploit a threshold (users above/below a score cutoff). Strong validity near cutoff.
- Interrupted time series: Track outcome over time, look for level/slope change at intervention.
Within- vs. between-subjects — Within-subjects eliminates individual differences but introduces order effects (counterbalance or use washout periods).
Factorial — Multiple IVs to detect interactions. Multiplicatively more sample. Only when interactions are the research question.
State what design you picked and why alternatives were rejected.
Step 4: Determine Sample Size
Run a power analysis before data collection:
- Minimum detectable effect (MDE): Smallest practically meaningful effect — not statistically significant, practically significant.
- Significance level (α): False positive rate. Standard 0.05; lower for high-stakes.
- Power (1-β): Probability of detecting a real effect. Standard 0.80; use 0.90 for critical experiments.
- Baseline rate: Current DV value (e.g., retention = 40%).
- Variance estimate: From historical data or pilot.
If required n exceeds feasible: accept larger MDE, run longer, or redesign for a more sensitive metric. Do not run underpowered and hope.
Step 5: Pre-Register Success Criteria
Before any data collection, commit in writing to:
- Primary metric: The one metric that determines success.
- Secondary metrics: Should move if hypothesis is correct (and shouldn't if effect is spurious).
- Success threshold: Effect size and significance required.
- Guardrail metrics: Must not degrade (error rate, latency, revenue).
- Decision rules: "If primary improves by ≥ MDE at p < α, ship. If guardrail degrades by > X%, halt."
- Stopping rules: Early stop conditions (sequential testing with adjusted thresholds) and extension criteria.
Pre-registration prevents the garden of forking paths — redefining success after seeing results.
Step 6: Mitigate Threats to Validity
Internal validity (did X actually cause Y?):
- Selection bias → randomization or matching
- Attrition → intent-to-treat analysis
- Maturation → control group captures natural change
- History → concurrent control experiences same external events
- Instrumentation → consistent measurement across conditions
External validity (does it generalize?):
- Sample representativeness → stratified sampling
- Temporal validity → run through full business cycles
- Setting validity → test in production, not staging
Construct validity (are we measuring what we think?):
- Metric validity → does the DV capture the construct?
- Treatment fidelity → did participants actually experience the treatment?
For each threat, state mitigated / partially mitigated / unmitigated and what that means for interpretation.
Step 7: Specify the Analysis Plan
Define the exact analytical approach before data arrives:
- Statistical test: t-test, chi-squared, regression, Bayesian — matched to data type and design.
- Multiple comparison correction: Bonferroni, Holm, or FDR if testing multiple hypotheses.
- Segmentation plan: Pre-specified subgroups (new vs. returning users). Exploratory segments labeled as such.
- Sensitivity analysis: Re-run under different assumptions (excluding outliers, different attribution windows).
- Effect size reporting: Practical effect size (Cohen's d, relative lift, absolute difference) alongside p-values. Statistical without practical significance is noise.
Step 8: Define Timeline and Resources
- Ramp-up plan: Traffic allocation schedule (5% → 20% → 50%).
- Minimum run duration: From sample size and business cycles.
- Maximum run duration: When to call it.
- Resource requirements: Engineering, data pipeline, stakeholder reviews.
- Go/no-go checkpoints: Dates to review interim data for safety (not for peeking at results).
Output Format
🎯 Research Question
- Plain language: [What are we trying to find out?]
- H₀: [Null — no effect]
- H₁: [Alternative — specific, falsifiable, directional]
📋 Variables
| Role |
Variable |
Measurement |
| Independent (IV) |
[What we manipulate] |
[How treatment is defined] |
| Dependent (DV) |
[What we measure] |
[Metric definition and source] |
| Controlled |
[Held constant] |
[How controlled] |
| Confounder |
[Potential threat] |
[Mitigation approach] |
🔬 Design
- Type: [RCT / quasi-experimental / observational — with variant]
- Justification: [Why, and what alternatives were rejected]
- Assignment: [Random / stratified / threshold — mechanism]
📊 Sample Size
- MDE: [Minimum detectable effect]
- Power: [Target]
- α: [Significance level]
- Required n: [Per group and total]
- Feasibility: [Can we reach this? If not, what changes?]
✅ Pre-Registered Criteria
- Primary metric: [name] — success if [condition]
- Secondary metrics: [List with expected direction]
- Guardrail metrics: [List with degradation thresholds]
- Decision rule: [If...then ship / halt / extend]
- Stopping rule: [Early stop conditions]
⚠️ Threats to Validity
| Threat |
Category |
Severity |
Mitigation |
Residual Risk |
| [Threat] |
Internal |
[H/M/L] |
[Approach] |
[What remains] |
| [Threat] |
External |
[H/M/L] |
[Approach] |
[What remains] |
| [Threat] |
Construct |
[H/M/L] |
[Approach] |
[What remains] |
📊 Analysis Plan
- Test: [Statistical test with justification]
- Correction: [Multiple comparison method, if applicable]
- Segments: [Pre-specified subgroups]
- Sensitivity: [Alternative analyses]
📋 Timeline and Resources
- Duration: [Min — max]
- Ramp plan: [Traffic allocation schedule]
- Checkpoints: [Go/no-go review dates]
- Resources: [What's needed]
Thinking Triggers
- "What would we need to observe to abandon this hypothesis?"
- "If we saw this result, could we explain it without the hypothesis being true?"
- "Are we testing what we think we're testing, or a proxy?"
- "What's the smallest effect that would actually change our decision?"
- "If we can't randomize, what's the best natural experiment available?"
- "What would a skeptic say is wrong with this design?"
Common Traps
- Post-hoc hypothesis: Formulating after seeing data. If you discover something unexpected, label it exploratory and design a new experiment to confirm.
- Underpowered experiments: Running too small to detect realistic effects, then concluding "no effect." Absence of evidence is not evidence of absence — especially with n=47.
- Peeking: Checking daily and stopping when results look good. Inflates false positives dramatically. Use sequential testing with adjusted thresholds for interim looks.
- Surrogate metrics: Measuring clicks when you care about retention. The surrogate must have a validated causal link to what matters.
- Multiple testing without correction: Testing 20 metrics and celebrating the one significant at p=0.05 is finding noise.
- Ignoring practical significance: A statistically significant 0.01% improvement at p=0.03 isn't worth shipping if engineering cost exceeds value.
Example Applications
| Trigger |
Application |
| "Does this new onboarding flow improve activation?" |
A/B test, randomized assignment, activation rate as primary DV, power analysis for minimum lift, pre-registered 14-day window |
| "We think the bottleneck is the database" |
Observational study: latency with and without DB load, control for concurrent traffic, pre-register the latency threshold that confirms |
| "Should we invest in this training program?" |
Difference-in-differences: trained vs. untrained teams' productivity before and after, controlling for team composition and project difficulty |
| epistemic-mapping flagged "We assume users prefer simplicity" |
Within-subjects preference test: simple and complex versions (counterbalanced), measure task completion + stated preference, pre-register which signal wins on conflict |
1---2name: experimental-design3description: Apply experimental-design whenever the user needs to test a hypothesis, validate an assumption, or determine whether something actually works. Triggers on phrases like "how do we test this?", "design an experiment", "what would prove this?", "set up an A/B test", "how do we validate this hypothesis?", "what's the right control?", "is this result significant?", "what sample size do we need?". Use proactively when decisions rest on untested assumptions — designing the test before collecting data prevents post-hoc rationalization.4---56# Experimental Design78**Core principle**: Define what counts as evidence *before* you collect it. A well-designed experiment eliminates alternative explanations so only one conclusion survives. Pre-registration is the firewall between discovery and self-deception.910---1112## When to Use This Skill1314- A decision hinges on a factual claim no one has tested15- Someone proposes an A/B test but hasn't defined success criteria16- epistemic-mapping flagged a dangerous assumption needing validation17- A team is about to invest resources based on an unvalidated hypothesis18- Prior experiment results were inconclusive and need a better design1920---2122## Core Methodology2324### Step 1: Convert the Question into a Testable Hypothesis2526Take the vague question ("Does feature X improve retention?") and produce a precise, falsifiable hypothesis pair.2728- **H₀ (null)**: The default — no effect. "Feature X has no effect on 30-day retention."29- **H₁ (alternative)**: The claim. "Feature X increases 30-day retention by ≥ 2 percentage points."3031State the direction. One-tailed when you only care about improvement; two-tailed when you also need to detect harm. Default two-tailed unless strong prior reason to expect one direction.3233If a hypothesis isn't falsifiable — if no observable outcome could disprove it — rewrite it.3435### Step 2: Identify Variables3637- **Independent variable (IV)**: What you manipulate. One per experiment unless factorial design with sufficient power.38- **Dependent variable (DV)**: What you measure. The metric closest to the outcome you care about. Proxies introduce noise.39- **Controlled variables**: Held constant across conditions.40- **Potential confounders**: Could vary between groups and affect DV independently. List them all, then design controls (randomization, stratification, matching, statistical control).4142### Step 3: Select the Experimental Design4344**Randomized Controlled Trial (RCT / A/B test)** — Gold standard. Random assignment eliminates confounding. Use when you can randomize and have sample size.4546**Quasi-experimental** — When randomization is impossible:47- **Difference-in-differences**: Treated vs. untreated, before vs. after. Requires parallel trends.48- **Regression discontinuity**: Exploit a threshold (users above/below a score cutoff). Strong validity near cutoff.49- **Interrupted time series**: Track outcome over time, look for level/slope change at intervention.5051**Within- vs. between-subjects** — Within-subjects eliminates individual differences but introduces order effects (counterbalance or use washout periods).5253**Factorial** — Multiple IVs to detect interactions. Multiplicatively more sample. Only when interactions are the research question.5455State what design you picked and why alternatives were rejected.5657### Step 4: Determine Sample Size5859Run a power analysis *before* data collection:6061- **Minimum detectable effect (MDE)**: Smallest practically meaningful effect — not statistically significant, *practically* significant.62- **Significance level (α)**: False positive rate. Standard 0.05; lower for high-stakes.63- **Power (1-β)**: Probability of detecting a real effect. Standard 0.80; use 0.90 for critical experiments.64- **Baseline rate**: Current DV value (e.g., retention = 40%).65- **Variance estimate**: From historical data or pilot.6667If required n exceeds feasible: accept larger MDE, run longer, or redesign for a more sensitive metric. Do not run underpowered and hope.6869### Step 5: Pre-Register Success Criteria7071Before any data collection, commit in writing to:7273- **Primary metric**: The one metric that determines success.74- **Secondary metrics**: Should move if hypothesis is correct (and shouldn't if effect is spurious).75- **Success threshold**: Effect size and significance required.76- **Guardrail metrics**: Must *not* degrade (error rate, latency, revenue).77- **Decision rules**: "If primary improves by ≥ MDE at p < α, ship. If guardrail degrades by > X%, halt."78- **Stopping rules**: Early stop conditions (sequential testing with adjusted thresholds) and extension criteria.7980Pre-registration prevents the garden of forking paths — redefining success after seeing results.8182### Step 6: Mitigate Threats to Validity8384**Internal validity** (did X actually cause Y?):85- Selection bias → randomization or matching86- Attrition → intent-to-treat analysis87- Maturation → control group captures natural change88- History → concurrent control experiences same external events89- Instrumentation → consistent measurement across conditions9091**External validity** (does it generalize?):92- Sample representativeness → stratified sampling93- Temporal validity → run through full business cycles94- Setting validity → test in production, not staging9596**Construct validity** (are we measuring what we think?):97- Metric validity → does the DV capture the construct?98- Treatment fidelity → did participants actually experience the treatment?99100For each threat, state mitigated / partially mitigated / unmitigated and what that means for interpretation.101102### Step 7: Specify the Analysis Plan103104Define the exact analytical approach before data arrives:105106- **Statistical test**: t-test, chi-squared, regression, Bayesian — matched to data type and design.107- **Multiple comparison correction**: Bonferroni, Holm, or FDR if testing multiple hypotheses.108- **Segmentation plan**: Pre-specified subgroups (new vs. returning users). Exploratory segments labeled as such.109- **Sensitivity analysis**: Re-run under different assumptions (excluding outliers, different attribution windows).110- **Effect size reporting**: Practical effect size (Cohen's d, relative lift, absolute difference) alongside p-values. Statistical without practical significance is noise.111112### Step 8: Define Timeline and Resources113114- **Ramp-up plan**: Traffic allocation schedule (5% → 20% → 50%).115- **Minimum run duration**: From sample size and business cycles.116- **Maximum run duration**: When to call it.117- **Resource requirements**: Engineering, data pipeline, stakeholder reviews.118- **Go/no-go checkpoints**: Dates to review interim data for safety (not for peeking at results).119120---121122## Output Format123124### 🎯 Research Question125- **Plain language**: [What are we trying to find out?]126- **H₀**: [Null — no effect]127- **H₁**: [Alternative — specific, falsifiable, directional]128129### 📋 Variables130| Role | Variable | Measurement |131|------|----------|-------------|132| Independent (IV) | [What we manipulate] | [How treatment is defined] |133| Dependent (DV) | [What we measure] | [Metric definition and source] |134| Controlled | [Held constant] | [How controlled] |135| Confounder | [Potential threat] | [Mitigation approach] |136137### 🔬 Design138- **Type**: [RCT / quasi-experimental / observational — with variant]139- **Justification**: [Why, and what alternatives were rejected]140- **Assignment**: [Random / stratified / threshold — mechanism]141142### 📊 Sample Size143- **MDE**: [Minimum detectable effect]144- **Power**: [Target]145- **α**: [Significance level]146- **Required n**: [Per group and total]147- **Feasibility**: [Can we reach this? If not, what changes?]148149### ✅ Pre-Registered Criteria150- **Primary metric**: [name] — success if [condition]151- **Secondary metrics**: [List with expected direction]152- **Guardrail metrics**: [List with degradation thresholds]153- **Decision rule**: [If...then ship / halt / extend]154- **Stopping rule**: [Early stop conditions]155156### ⚠️ Threats to Validity157158| Threat | Category | Severity | Mitigation | Residual Risk |159|--------|----------|----------|------------|---------------|160| [Threat] | Internal | [H/M/L] | [Approach] | [What remains] |161| [Threat] | External | [H/M/L] | [Approach] | [What remains] |162| [Threat] | Construct | [H/M/L] | [Approach] | [What remains] |163164### 📊 Analysis Plan165- **Test**: [Statistical test with justification]166- **Correction**: [Multiple comparison method, if applicable]167- **Segments**: [Pre-specified subgroups]168- **Sensitivity**: [Alternative analyses]169170### 📋 Timeline and Resources171- **Duration**: [Min — max]172- **Ramp plan**: [Traffic allocation schedule]173- **Checkpoints**: [Go/no-go review dates]174- **Resources**: [What's needed]175176---177178## Thinking Triggers179180- *"What would we need to observe to abandon this hypothesis?"*181- *"If we saw this result, could we explain it without the hypothesis being true?"*182- *"Are we testing what we think we're testing, or a proxy?"*183- *"What's the smallest effect that would actually change our decision?"*184- *"If we can't randomize, what's the best natural experiment available?"*185- *"What would a skeptic say is wrong with this design?"*186187---188189## Common Traps190191- **Post-hoc hypothesis**: Formulating after seeing data. If you discover something unexpected, label it exploratory and design a new experiment to confirm.192- **Underpowered experiments**: Running too small to detect realistic effects, then concluding "no effect." Absence of evidence is not evidence of absence — especially with n=47.193- **Peeking**: Checking daily and stopping when results look good. Inflates false positives dramatically. Use sequential testing with adjusted thresholds for interim looks.194- **Surrogate metrics**: Measuring clicks when you care about retention. The surrogate must have a validated causal link to what matters.195- **Multiple testing without correction**: Testing 20 metrics and celebrating the one significant at p=0.05 is finding noise.196- **Ignoring practical significance**: A statistically significant 0.01% improvement at p=0.03 isn't worth shipping if engineering cost exceeds value.197198---199200## Example Applications201202| Trigger | Application |203|---------|-------------|204| "Does this new onboarding flow improve activation?" | A/B test, randomized assignment, activation rate as primary DV, power analysis for minimum lift, pre-registered 14-day window |205| "We think the bottleneck is the database" | Observational study: latency with and without DB load, control for concurrent traffic, pre-register the latency threshold that confirms |206| "Should we invest in this training program?" | Difference-in-differences: trained vs. untrained teams' productivity before and after, controlling for team composition and project difficulty |207| epistemic-mapping flagged "We assume users prefer simplicity" | Within-subjects preference test: simple and complex versions (counterbalanced), measure task completion + stated preference, pre-register which signal wins on conflict |