Experiment Design Assistant: Sample Size & Power
Plan a controlled experiment with guidance on sample size, statistical power, and control-group setup before you collect data.
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer
Experiment Design Assistant: Sample Size & Power
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: n = ((Z_alpha + Z_beta) / d)^2 per group
Worked example — 64 total participants needed (32 per group). This is the standard benchmark for medium-effect studies.
Formula
n = ((Z_alpha + Z_beta) / d)^2 per group
Sample size per group is calculated by squaring the sum of the critical Z-values for the desired significance level (alpha) and power (1-beta), divided by the expected effect size (Cohen d). For two-tailed tests, alpha is halved before computing Z_alpha. Total sample size equals n per group times the number of groups.
Worked Examples
Example 1: Clinical Trial Sample Size
Problem:Design a two-group RCT to detect a medium effect (d=0.5) with 80% power at alpha=0.05, two-tailed.
Solution:Z_alpha/2 = 1.960 (for alpha=0.05 two-tailed) Z_beta = 0.842 (for power=0.80) n per group = ((1.960 + 0.842) / 0.5)^2 = (2.802 / 0.5)^2 = 5.604^2 = 31.4 -> 32 Total N = 32 * 2 = 64 participants Recruitment: ~1.3 weeks at 50/week
Result:64 total participants needed (32 per group). This is the standard benchmark for medium-effect studies.
Example 2: High-Power A/B Test Design
Problem:Design a website A/B test to detect a small effect (d=0.2) with 90% power at alpha=0.05.
Solution:Z_alpha/2 = 1.960 Z_beta = 1.282 (for power=0.90) n per group = ((1.960 + 1.282) / 0.2)^2 = (3.242 / 0.2)^2 = 16.21^2 = 263 Total N = 263 * 2 = 526 participants Recruitment: ~10.5 weeks at 50/week
Result:526 total participants needed. Small effects require large samples — consider whether the effect is practically meaningful at this cost.
Frequently Asked Questions
What is statistical power and why does it matter?
Statistical power is the probability that your experiment will correctly detect a real effect when one exists — mathematically, it equals 1 minus the Type II error rate (beta). A power of 0.80 means there is an 80% chance of finding a statistically significant result if the true effect exists. Industry standard is 80% power, though clinical trials often require 90%. Low power leads to inconclusive experiments, wasted resources, and the risk of falsely concluding that an intervention does not work when it actually does. Underpowered studies are one of the biggest problems in research, contributing to the replication crisis. Proper power analysis before data collection prevents this issue.
What is effect size and how do I choose one?
Effect size (Cohen d) measures the magnitude of the difference between groups in standard deviation units. Cohen defined d = 0.2 as small, 0.5 as medium, and 0.8 as large. To choose an appropriate effect size: (1) Review prior literature for similar interventions — what effects have others found? (2) Determine the minimum clinically or practically meaningful difference — the smallest change worth detecting. (3) Conduct a pilot study to estimate the likely effect. In practice, most real-world effects in social science are small (d = 0.2-0.4), medical interventions are small to medium (d = 0.3-0.6), and educational interventions can range from small to large depending on the context.
What is the difference between one-tailed and two-tailed tests?
A two-tailed test checks for differences in either direction (drug could help OR hurt), while a one-tailed test only checks one direction (drug can only help). Two-tailed tests are more conservative and generally recommended because they protect against unexpected results. A one-tailed test requires fewer subjects (roughly 20% fewer) but assumes you know the direction of the effect before starting, which is rarely justified. Most journals and regulatory bodies prefer two-tailed tests. Use one-tailed only when: the effect can physically only go one direction, or there is overwhelming prior evidence for the direction, AND you would take no action based on an opposite result.
How does the number of groups affect sample size?
Adding groups increases the total sample size needed. For a two-group comparison, you need N participants per group. With three groups (e.g., placebo, low dose, high dose), you need N per group times 3, and the per-group N increases slightly to maintain power across multiple comparisons. For ANOVA designs comparing k groups, the sample size per group is approximately (k-1)/k times what you would need for a two-sample test, multiplied by a correction for the F-test distribution. Factorial designs (2x2, 2x3) are more efficient because they test multiple factors simultaneously, requiring fewer total participants than running separate experiments for each factor.
What happens if my study is underpowered?
An underpowered study (power below 0.60) has several severe consequences. First, you are likely to get a non-significant result even if the treatment actually works, wasting the time and resources of both researchers and participants. Second, any significant results from underpowered studies tend to have inflated effect size estimates (the "winner curse"), making them less replicable. Third, underpowered studies contribute to publication bias because non-significant results are less likely to be published. A landmark 2017 analysis found that the median power in published psychology studies was only 36%, meaning most studies had less than a coin-flip chance of detecting the effects they were investigating. Always conduct a priori power analysis.
What is the minimum detectable effect and why does it matter?
The minimum detectable effect (MDE) is the smallest effect size your experiment can reliably detect given its sample size, significance level, and desired power. If the true effect is smaller than your MDE, your study is unlikely to find a statistically significant result. MDE is inversely related to sample size, meaning larger samples can detect smaller effects. Before running an experiment, you should determine whether the MDE is practically meaningful. There is no value in running a study that can only detect effects larger than what you would consider important. Conversely, designing for an extremely small MDE requires very large and expensive samples, so balancing practical significance with feasibility is key to good experiment design.
What is the difference between Type I and Type II errors?
A Type I error (false positive) occurs when you incorrectly reject the null hypothesis, concluding that an effect exists when it does not. The probability of a Type I error is controlled by the significance level alpha, typically set at 0.05 or 5%. A Type II error (false negative) occurs when you fail to reject the null hypothesis even though a real effect exists. The probability of a Type II error is beta, and statistical power equals 1 minus beta. These two error types are inversely related: reducing one increases the other unless you increase the sample size. In medical research, the consequences of each error type must be carefully weighed, as a false positive might lead to ineffective treatments while a false negative might cause a beneficial treatment to be abandoned.
How do I conduct a power analysis for a randomized controlled trial?
To conduct a power analysis for an RCT, you need four inputs and solve for the fifth: sample size, effect size, significance level, power, and the number of groups. Typically you specify the desired power (usually 0.80 or 0.90), significance level (usually 0.05), and estimated effect size, then solve for the required sample size per group. The effect size should come from pilot data, prior literature, or the minimum clinically important difference. Account for expected dropout rates by inflating the calculated sample size, typically by 10 to 20 percent. If using stratified randomization or repeated measures, the sample size calculation requires adjustments. Software tools like G*Power, R, or Experiment Design Assistant: Sample Size & Power can perform these calculations accurately.
What role does randomization play in experiment design?
Randomization is the cornerstone of causal inference in experimental research. By randomly assigning participants to treatment and control groups, you ensure that both observed and unobserved confounding variables are distributed approximately equally across groups, eliminating systematic bias. This makes it valid to attribute any differences in outcomes to the treatment rather than pre-existing differences between groups. Simple randomization works well for large samples, but for smaller studies, stratified or block randomization can ensure balance on known important variables like age or disease severity. Without randomization, observational differences between groups can masquerade as treatment effects, leading to incorrect conclusions about the efficacy of interventions.
Can I adjust sample size during an ongoing experiment?
Adaptive sample size re-estimation is possible but requires careful pre-planning to maintain statistical validity. If you simply keep adding participants until you get a significant result, you inflate the Type I error rate well above the nominal alpha level. Properly designed adaptive trials use pre-specified interim analysis points with adjusted significance thresholds, such as those provided by the O Brien-Fleming or Pocock spending functions. Group sequential designs allow you to stop early for efficacy or futility while controlling the overall error rate. Sample size re-estimation based on nuisance parameters like variance is less problematic than re-estimation based on treatment effects. Any adaptive design should be documented in the study protocol before data collection begins.
References
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer · Editorial policy
Related Calculators
🧮A B Test Significance Power Analyzer
Calculate a b test significance power analyzer with inputs, formulas, and instant results.
🔬Experiment Power & Sample Size Checker
Calculate A/B test sample size, statistical power, and test duration
⚖️A/B Test Sample Size & Power
Calculate required sample size for A/B tests with statistical power and MDE analysis
🧮Etl Throughput Sizing Assistant
Calculate etl throughput sizing assistant with inputs, formulas, and instant results.
🧮Color Palette Balance AI
Calculate color palette balance ai with inputs, formulas, and instant results.
🧮EV Route Charge Planner Range AI
Calculate ev route charge planner range ai with inputs, formulas, and instant results.
🧮Work Break Pomodoro Planner AI
Calculate work break pomodoro planner ai with inputs, formulas, and instant results.
🧮3d Print Time Support Estimator
Calculate 3d print time support estimator with inputs, formulas, and instant results.