Why Variability Affects Sample Size
A study is easier to plan when the outcome is relatively consistent: a real difference in means stands out against less random variation. When observations vary widely, the same difference is harder to distinguish from noise. A study may therefore need more observations to detect the same mean difference with the same probability, while holding the significance level fixed.
This relationship is especially useful when planning a mean test. It helps translate a plausible standard deviation, a target difference, and a desired power into a sample-size requirement. The central result is that, under a normal-approximation model, required sample size is proportional to the square of the standard deviation when the other planning choices remain fixed.
Planning Model and Sample-Size Relationship
Consider a one-sample, two-sided Z test of \(H_0:\mu=\mu_0\) against \(H_a:\mu\ne\mu_0\). For the planning calculation, assume independent observations from a population that is normal with standard deviation \(\sigma\), treated as known for the Z-test calculation. The test uses significance level \(\alpha\), and the study is planned to have power \(1-\beta\) when the true mean differs from \(\mu_0\) by the target amount \(\delta\). The calculation also assumes that the outcome is measured on a consistent scale and that the target difference and variability refer to the same population and measurement conditions.
Under these assumptions, the sample mean has standard error \(\sigma/\sqrt{n}\). Under \(H_0\), the test statistic \(Z=(\bar{x}-\mu_0)/(\sigma/\sqrt{n})\) follows a standard normal distribution. For a two-sided test, reject \(H_0\) when \(|Z|>z_{1-\alpha/2}\), where \(z_q\) is the \(q\)-quantile of the standard normal distribution.
If the true mean is \(\mu_1=\mu_0+\delta\), the test statistic has a normal distribution with variance 1 and mean \(\lambda=\delta\sqrt{n}/\sigma\). Thus its power is the probability that this shifted statistic falls in either rejection tail:
Here \(\Phi\) is the standard normal cumulative distribution function. The first term is the upper-tail rejection probability when the true mean is above the null value; the second term is the probability of falling in the opposite rejection tail. For a negative target difference, the two tails exchange roles and the power is the same for the same absolute difference.
Deriving the Approximate Formula
An exact normal-theory calculation can find \(n\) by solving the two-tail power equation above. A widely used planning formula is obtained by requiring the upper-tail probability alone to equal the target power. For a positive target difference, the lower-tail probability is usually very small when the test is designed to detect that difference, so this gives an accurate approximation in many standard designs.
Let \(c=z_{1-\alpha/2}\). Ignoring the small opposite-tail probability, set \(1-\Phi(c-\lambda)=1-\beta\). This means \(\Phi(c-\lambda)=\beta\). Since the standard normal distribution is symmetric, its \(\beta\)-quantile is \(-z_{1-\beta}\); therefore \(c-\lambda=-z_{1-\beta}\), or \(\lambda=c+z_{1-\beta}\). Substituting \(\lambda=\delta\sqrt{n}/\sigma\) and rearranging gives the approximate sample-size relationship:
This equation shows the role of variability directly: with \(\alpha\), power, and \(\delta\) fixed, \(n\) is proportional to \(\sigma^2\). If standard deviation is multiplied by \(k\), the approximate required sample size is multiplied by \(k^2\). The formula is an approximation because it omits the opposite-tail probability; a more exact normal calculation uses the full power equation. In practice, round a calculated sample size up to the next whole observation.
Worked Example: Planning for a Mean Difference
Suppose a hypothetical study will use a two-sided one-sample Z test with \(\alpha=0.05\). The target power is \(0.80\), the target mean difference is \(\delta=4\) measurement units, and the planning standard deviation is \(\sigma=10\) units. Find the approximate sample size.
The normal quantiles are \(z_{0.975}=1.960\) and \(z_{0.80}=0.8416\). Substituting into the formula:
Rounding upward gives a planned sample size of 50 independent observations. For a check using the full two-tail power expression, \(n=50\) gives \(\lambda=4\sqrt{50}/10\approx2.828\). The power is approximately \(\Phi(2.828-1.960)+\Phi(-1.960-2.828)\), or \(\Phi(0.868)+\Phi(-4.788)\approx0.807\). This is just above the target of 0.80, as intended.
The interpretation is conditional on the planning model: if the true mean is 4 units from the null value and the assumed standard deviation and other conditions are appropriate, this design has about an 80% probability of rejecting the null hypothesis. It does not mean there is an 80% probability that the null hypothesis is false.
Comparing Designs With Different Variability
A useful way to see the effect of \(\sigma\) is to compare designs that keep the scientific target, significance level, and power unchanged. Because standard deviation is squared in the formula, even a moderate increase in spread can produce a substantial increase in the required sample size.
Worked Example: Increasing the Standard Deviation
Use the same two-sided test, target difference of 4 units, \(\alpha=0.05\), and power \(0.80\) as in the first example. Now suppose a new hypothetical setting has a planning standard deviation of 15 units rather than 10 units. Find its approximate sample size and compare the unrounded requirements.
The common quantile factor is \((1.960+0.8416)^2\approx7.849\). With \(\sigma=15\):
The new design therefore needs at least 111 observations under this approximation. The unrounded sample-size ratio is determined by the variance ratio:
Thus a 50% increase in standard deviation requires about 2.25 times as many observations to preserve the same target difference, significance level, and power. The rounded designs are 50 and 111 observations; their ratio is not exactly 2.25 because each sample size must be an integer.
The same reasoning works for decreases in variability. If a measurement procedure reduces the standard deviation while leaving the target difference unchanged, less sampling is needed to reach the same power. This is one reason measurement consistency and outcome definitions matter in study design: reducing avoidable variation can make a study more efficient. It does not, however, justify changing how the outcome is measured in a way that changes the scientific meaning of the target difference.
Worked Example: A 50% Increase in Variability
A hypothetical study plans a two-sided mean test with \(\alpha=0.05\), 90% power, and a target difference of 2 units. Compare the approximate sample sizes if the planning standard deviation is 5 units versus 7.5 units.
For 90% power, \(z_{0.90}=1.282\), and \(z_{0.975}=1.960\). The common quantile factor is approximately \((1.960+1.282)^2=(3.242)^2\approx10.51\). For \(\sigma=5\):
so the planned sample size is 66 observations. For \(\sigma=7.5\):
so the planned sample size is 148 observations. The standard deviation is multiplied by \(7.5/5=1.5\), and the unrounded sample-size requirement is multiplied by \(1.5^2=2.25\). Indeed, the unrounded calculations are about 65.69 and 147.80, whose ratio is about 2.25. The specific values of alpha and power affect the common multiplier, but not this variance ratio.
Using a Variability Estimate Responsibly
The population standard deviation is rarely known exactly before a study. A planning value may come from prior data, a pilot study, or subject-matter knowledge. The formula should be understood as conditional on that value: if the true variability is larger than anticipated, the achieved power can be lower than planned unless the sample size is increased.
For example, if two candidate planning values differ by a factor of 1.2, their corresponding unrounded sample sizes differ by a factor of \(1.2^2=1.44\), provided all other design inputs are unchanged. This makes it important to record the assumed \(\sigma\), not just the final \(n\). The estimate should also be relevant to the planned population, measurement method, and outcome scale; borrowing a standard deviation from a materially different setting may lead to a misleading sample-size plan.
The derivation above assumes a Z test with a known or planning-fixed \(\sigma\). When the population standard deviation is estimated from the study sample and a t test is used, the critical values and power calculation depend on the degrees of freedom as well as \(n\). The normal formula remains a useful guide to the square-law relationship, but the final sample size should be obtained with the planned test's appropriate calculation.
Common Mistake: Scaling Sample Size Linearly
A frequent error is to reason, “The standard deviation rose by 50%, so I need 50% more observations.” That is not the relationship in the mean-test planning formula. The standard error decreases as \(1/\sqrt{n}\), so offsetting a \(k\)-fold increase in standard deviation requires increasing \(\sqrt{n}\) by \(k\), which increases \(n\) by \(k^2\). A 50% increase in standard deviation therefore means about 125% more observations, not 50% more, when the other planning choices are fixed.
The square-law comparison is a planning relationship, not a promise that every realized study will have exactly its target power. The actual data may differ from the model, the true standard deviation may differ from the planning value, and the true mean difference may not equal the target. The calculation gives a transparent design expectation under stated assumptions.
Check Your Understanding
Answer each question using the relationship developed above.
- If the planning standard deviation is doubled while the target difference, significance level, and power stay fixed, approximately what happens to the required sample size?
- A study's standard deviation is expected to rise from 8 units to 12 units. By what factor does the unrounded sample-size requirement change, all else equal?
- Why does the sample-size formula use the square of the ratio \(\sigma/\delta\), rather than the ratio itself?
- What does the 80% power interpretation mean when the true mean difference equals the prespecified target?
- Name one reason an actual study might achieve less power than planned even if it recruits the calculated sample size.