Statistical power and sample size

The question
Choose the sample before collecting the measurements.
- 1 SeeFind the smallest sample that works.
- 2 TryCompare two sampling plans.
- 3 ProveDerive the power and sample-size formulas.
- 4 ApplyPlan and interpret five experiments.
Before you start · 3 quick checks on normal areas, standard errors, and testing
Two ideas before you start
2 ideasA mean has its own spread
A normal sampling density centered at the population mean.
Switch the sample size. The curve describes the mean across fresh samples from the same population.
Exact definition
Let the observations \(X_1,\ldots,X_n\) be independent normal variables with common mean μ and known population standard deviation \(\sigma\gt0\). Their average \(\bar X\) is normal with mean μ and variance \(\sigma^2/n\). Its standard error is \(s=\sigma/\sqrt n\). The card uses a centered population with a fixed SD; its readout gives the chosen values.
The normal distribution lesson explains density and standardization. The width here describes uncertainty in a mean, not the spread of individual observations.
Two areas answer two questions
Select a model to see its density and the rejection tail.
The same decision boundary has an area under each model. Name the model whenever you name a probability.
Exact definition
For a fixed rejection region R, the Type I error is \(P_0(R)\), rejection under the null. Power at a specified alternative is \(P_1(R)\). The Type II error is \(\beta=P_1(R^c)\), so power is \(1-\beta\). The subscripts name the data-generating model. They do not assign probabilities to hypotheses.
These definitions come from hypothesis tests. Here the rule stays fixed while the selected distribution changes. This illustration uses its own cutoff, separate from the design challenge.
The sampling plan and the effect of interest
Throughout the normal calculations, the sample size is a positive integer chosen in advance. Observations are independent and identically distributed normal measurements, with the same known SD under both hypotheses. There is one upper-tail test, with its direction and significance level fixed before sampling. No interim looks or data-dependent stopping are included.
The null mean is μ₀. The planning alternative is \(\mu_1=\mu_0+\Delta\), where \(\Delta\gt0\) is an increase worth detecting. The standardized effect is \(d=\Delta/\sigma\). It is a population difference in units of the individual SD, not a difference divided by the standard error. Choose it from the scientific question before seeing a result. The power calculation is conditional on that assumed effect actually being present.
Find the smallest workable sample
- Choose an integer sample size, then check your plan.
- After your first action, inspect both curves and the power readout as you adjust the sample.
- Reach the target with the smallest possible sample. A sample that is larger than necessary does not finish the challenge.
Here Z measures the sample mean relative to the null mean in standard-error units. The null curve therefore stays standard normal. The alternative curve is centered at the population shift divided by the planned standard error. Its movement is a change of measurement scale, not a change in the population effect.
The curves overlap because either population can produce a range of sample means. Shading only the alternative area beyond the cutoff answers the power question. The geometric overlap of the curves is not itself the miss probability: misses are all alternative outcomes on the nonrejection side of this particular boundary.
Compare two plans
- Commit to a comparison before opening the calculation.
- Then use the revealed relationship to solve two sample-size goals.
| n | d | d√n | Power |
|---|
With the level fixed, power depends on the effect measured in standard errors. A smaller population effect can be offset by a larger sample. The square root in the standard error makes this compensation expensive. The comparison is about probabilities over fresh samples; it does not promise the same decision in any two actual experiments.
Use what you found above
Each goal supplies a planning effect, a significance level, and a power target. Keep them separate. At a fixed effect and sample size, a smaller upper-tail significance level puts the boundary farther right and reduces power. Increasing the sample can compensate, but it does not change the chosen false-alarm probability.
Power is a function of the true mean. A design chosen for one increase has lower power for a smaller increase, and the chance of rejection at the null is the significance level. A negative shift is not the target of this upper-tail test. If both directions matter, choose a two-sided rule in advance and calculate both rejection tails.
Derive the planning formula
Refresher: normal quantiles and rounding up
Write \(\Phi(t)=P(U\le t)\) for standard normal U, and \(z_v=\Phi^{-1}(v)\) for the unique value with CDF v. This inverse is a quantile, not a reciprocal. The density is positive, so Φ is strictly increasing. Normal symmetry gives \(1-\Phi(t)=\Phi(-t)\). The ceiling \(\lceil a\rceil\) is the smallest integer at least a. It leaves an integer unchanged and rounds a noninteger upward.
Assume the independent normal model above, known \(\sigma\gt0\), integer \(n\ge1\), \(d=\Delta/\sigma\gt0\), and \(0\lt\alpha\lt1/2\). Define \(q=z_{1-\alpha}\) and reject the null mean μ₀ when \(Z=(\bar X-\mu_0)/(\sigma/\sqrt n)\gt q\). The rule has Type I error α. Its power at μ₀ + Δ is
\[\pi(n,d)=\Phi(d\sqrt n-q).\]For a target \(1/2\lt p_*\lt1\), the smallest integer sample size attaining at least that power is
\[\begin{aligned} A&=\frac{q+z_{p_*}}d,\\ n_{\min}&=\lceil A^2\rceil.\end{aligned}\]Both quantiles and d are positive in this theorem, so A is positive. Normality makes the result exact for every allowed sample size. It is not a large-sample substitute for a test with an estimated SD.
Build the sampling distribution, then translate a rejection into an area. Finally invert that area. The theorem states the result; the choices below supply its justification.
Under the null, Z is standard normal, so its probability beyond q is α by the quantile definition. Under the specified alternative, subtracting its new center makes it standard normal again. These are two probability calculations for one fixed rejection rule.
For a positive planning effect, the argument of Φ increases strictly with sample size. Once an integer works, every larger integer works too. The ceiling is essential: rounding to the nearest integer can choose a plan below the target. Retain unrounded quantiles in the calculation before applying that ceiling.
If both directions matter: the two-sided test
A two-sided level-α test rejects when \(|Z|\gt c\), where \(c=z_{1-\alpha/2}\), so each tail holds α/2 under the null. Under the same planning alternative \(\mu_0+\Delta\) with \(\Delta\gt0\), the same standardization gives
\[\begin{aligned}\pi_2(n,d)={}&\Phi(d\sqrt n-c)\\&+\Phi(-d\sqrt n-c).\end{aligned}\]The second term is the chance of rejecting in the wrong direction. Dropping it gives a lower bound for the power, so \(n=\lceil((c+z_{p_*})/d)^2\rceil\) always reaches the target; the exact minimum is that value or smaller. Since \(c\gt q\), this formula never asks for fewer observations than the one-sided formula at the same α. Decide on one or two tails before seeing data; the one-sided test is valid only if a decrease would not be reported as a finding.
Plan, calculate, interpret
Use the known-SD independent normal model and a fixed upper-tail test in each planning problem. Enter probabilities as decimals without percent signs; answers within 0.001 of the exact value are accepted, so either rounded or unrounded quantiles work. For sample counts, enter a whole number. Hints and full worked solutions are available after you try.
What a power calculation does not tell you
Power is a property of a plan at a specified population effect. It is not the probability that a significant finding is true, and it is not the probability that a nonsignificant finding has no effect. Those reverse the conditioning. The p-values lesson separates tail probabilities from statements about hypotheses.
A high-powered experiment can still miss its target effect. A low-powered experiment can still reject. After observing data, report the estimated difference and its uncertainty alongside the testing rule. Substituting the observed difference into the planning formula does not turn a nonrejection into evidence of equality.
If observations are correlated, the variance of the mean need not be σ²/n. If σ is estimated, a t-test requires different quantiles and a different power distribution. Multiple tests, missing measurements, or stopping early also change the design being evaluated. The calculations here apply to the complete fixed plan stated on this page.
Further reading
- G. Casella and R. L. Berger, Statistical Inference, chapter 8, “Hypothesis Testing.”