SSG

Math & Statistics

Sample Size Graphing Calculator

Graph the equal-group sample size needed to detect a difference between two independent proportions across effect sizes, alpha levels, and power targets, including continuity-free normal approximation and total recruitment.

Absolute effect-
Analyzable group 1 n-
Analyzable group 2 n-
Analyzable total-
Recruit group 1-
Recruit group 2-
Total recruitment-
Risk ratio p2/p1-

EFFECT-SIZE TERRAIN

Required total sample falls nonlinearly as the detectable difference grows

A live curve maps absolute proportion difference to recruitment, while the selected effect is pinned against 70%, 80%, 90%, and 95% power corridors.

Required total sample falls nonlinearly as the detectable difference growsUpdates with every input

POWER SCENARIOS

Allocation and power checkpoints at the entered effect

Each row uses the same proportions and alpha but changes power and allocation to expose efficiency costs.

Live analysis based on the current calculator inputs
PowerAllocation rGroup 1 nGroup 2 nAnalyzable totalRecruit total

POWER QUESTION

Specify the smallest effect worth detecting

  1. Define independent groups and a binary outcome.
  2. Enter a credible baseline proportion.
  3. Choose the smallest comparison proportion that matters operationally.
  4. Set alpha and power before seeing study results.
  5. Use unequal allocation only for recruitment, cost, or ethics reasons.

NONLINEAR COST

Chasing a smaller effect rapidly increases recruitment

The effect enters the denominator squared, so the sample curve rises steeply near zero.

Higher power and stricter alpha both increase critical boundaries. An imbalanced allocation usually costs total efficiency unless group-specific costs justify it.

TWO-PROPORTION POWER MODEL

Balance null variance, alternative variance, and allocation

The normal approximation combines a pooled variance term for the alpha boundary with group-specific variance under the alternative. Unequal allocation changes the variance carried by each group.

Detailed calculation process and general formulas

delta = |p2-p1|pbar = (p1 + r p2)/(1+r)n1 = [z_(1-alpha/2)sqrt(pbar(1-pbar)(1+1/r)) + z_power sqrt(p1(1-p1)+p2(1-p2)/r)]^2 / delta^2n2 = ceil(r n1)recruit total = ceil(n1/(1-a)) + ceil(n2/(1-a))

Symbols, meanings, and units

delta
absolute difference to detectproportion points
r
group 2 to group 1 allocation ratioratio
alpha
two-sided type-I error probabilitydecimal
power
probability of detecting the specified effectdecimal
a
planned attrition fractiondecimal

DESIGN TRADEOFFS

Read the curve as a decision boundary, not a promise

The planned effect and assumptions determine what the study is designed to detect.

Minimum effect

-

The selected delta is a design target, not the expected observed difference.

Allocation cost

-

The scenario table quantifies the extra total n from imbalance.

Field reserve

-

Attrition affects recruitment but not the analyzable power formula.

Decision takeaway: Document the smallest important effect and show at least one higher-power sensitivity scenario.

Applied decisions

Two-group planning applications

Conversion experiment

Two independent user cohorts are compared on a binary conversion outcome.

What the result clarifies: The power curve shows how modest effect targets dominate traffic demand.

Treatment response comparison

Two arms are compared on the proportion meeting a prespecified response definition.

What the result clarifies: Allocation and attrition must reflect the actual protocol.

Worked current scenario

Substitution, intermediate values, and reconciliation

Method references

Sources for this calculator's specific method

Scope and limitations

This is an approximate independent two-proportion design without continuity correction. It does not cover paired outcomes, cluster randomization, covariate adjustment, sequential monitoring, multiplicity, noninferiority, equivalence, or exact small-sample methods.

Sample Size Graphing Calculator | Two-Proportion Power Curve FAQ

Why does sample size explode near zero effect?

The squared effect is in the denominator.

Is 80% power always appropriate?

No. Power should reflect consequences, feasibility, and the design's decision context.

Does unequal allocation always help?

It can reduce cost when groups differ in recruitment expense, but equal allocation is usually most statistically efficient.