Skip to main content

Statistical Power Refresher

A derivation of the power function, the minimum detectable effect and the required sample size from the asymptotic normality of an estimator, applied to a randomized experiment.
Author

Bas Machielsen

Published

November 24, 2026

Introduction

In this post, I want to refresh my memory on statistical power and write down where the standard power formulas come from. Most treatments present the minimum detectable effect and the required sample size as formulas to plug numbers into, and I wanted to derive them from the asymptotic normality of an estimator, which is the same machinery used to justify the size of a test in the first place. I then apply the formulas to the simplest case, a regression of an outcome on a randomized binary treatment, and check the approximations with a small simulation in R. Finally, I discuss which design choices affect power and two points about how power should and should not be interpreted.

Size and Power

Take a parameter \(\tau\), such as an average treatment effect (ATE) or an average treatment effect on the treated (ATT), and consider the two-sided test

\[ H_0: \tau = 0 \quad \text{vs.} \quad H_1: \tau \neq 0 \]

at level \(\alpha\). The test rejects when \(|T| > z_{1-\alpha/2}\), where \(T = \hat{\tau} / \widehat{se}\) is the usual \(t\)-statistic and \(z_{1-\alpha/2}\) is the \(1-\alpha/2\) quantile of the standard normal distribution (1.96 for \(\alpha = 0.05\)).

The size of the test is \(P(\text{reject} \mid \tau = 0)\). By a central limit theorem and Slutsky’s theorem, \(T\) is approximately standard normal under the null, so the size is approximately \(\alpha\). The power of the test is \(P(\text{reject} \mid \tau = \tau_1)\) for some specific alternative \(\tau_1 \neq 0\). It equals \(1 - \beta\), where \(\beta\) is the probability of a Type II error, failing to reject a false null.

Size is thus a statement about the null hypothesis, whereas power is a statement about one particular alternative. A test therefore has a power function, \(\tau_1 \mapsto \pi(\tau_1)\), and that function also depends on the sample size \(n\) and on the variance of the estimator.

Deriving the Power Function

Suppose the estimator is asymptotically normal,

\[ \sqrt{n} (\hat{\tau} - \tau) \xrightarrow{d} \mathcal{N}(0, V), \]

and that the standard error is \(\widehat{se} = \sqrt{\hat{V}/n}\) with \(\hat{V} \xrightarrow{p} V\). It is useful to be precise about what \(V\) is. \(V\) is the asymptotic variance of the scaled estimator \(\sqrt{n}(\hat{\tau} - \tau)\), and the variance of \(\hat{\tau}\) itself is approximately \(V/n\), so that \(se = \sqrt{V/n}\). The reason to work with the scaled version is that \(\text{Var}(\hat{\tau})\) shrinks to zero as \(n\) grows, while \(V\) is a constant that does not depend on \(n\). For an asymptotically linear estimator, \(\hat{\tau} - \tau = \frac{1}{n} \sum_{i=1}^n \psi(O_i) + o_p(n^{-1/2})\), \(V = \mathbb{E}[\psi(O)^2]\) is the variance of the influence function \(\psi\), the contribution of a single observation to the estimator. Writing the standard error as \(\sqrt{V/n}\) keeps \(n\) visible, and that is what will later allow us to solve for it.

Under the alternative \(\tau = \tau_1\), we can decompose the \(t\)-statistic as

\[ T = \frac{\hat{\tau} - \tau_1}{\widehat{se}} + \frac{\tau_1}{\widehat{se}}. \]

The first term is approximately \(\mathcal{N}(0, 1)\). The second term is approximately the constant

\[ \delta = \frac{\tau_1}{se} = \frac{\sqrt{n} \, \tau_1}{\sqrt{V}}, \]

which is called the noncentrality. Under the alternative, then, \(T \approx \mathcal{N}(\delta, 1)\): the null distribution shifted by \(\delta\).

Power is the probability that \(T\) lands in the rejection region. For the upper tail, using that \(T - \delta\) is approximately standard normal,

\[ \begin{aligned} P(T > z_{1-\alpha/2}) &= P(T - \delta > z_{1-\alpha/2} - \delta) \\ &= 1 - \Phi(z_{1-\alpha/2} - \delta) \\ &= \Phi(\delta - z_{1-\alpha/2}), \end{aligned} \]

where the last step uses the symmetry of the normal distribution, \(1 - \Phi(a) = \Phi(-a)\) for any real \(a\). The second line follows most directly from the rejection event, and the third is the form usually used in planning formulas, because it can be inverted in one step. The same argument for the lower tail gives \(P(T < -z_{1-\alpha/2}) = \Phi(-z_{1-\alpha/2} - \delta)\), so the full two-sided power function is

\[ \pi(\tau_1) \approx \Phi(\delta - z_{1-\alpha/2}) + \Phi(-\delta - z_{1-\alpha/2}). \]

For \(\delta > 0\), the second term is negligible, so \(\pi(\tau_1) \approx \Phi(\delta - z_{1-\alpha/2})\). The picture to keep in mind is the null distribution \(\mathcal{N}(0,1)\) together with a copy shifted to the right by \(\delta\). Power is the mass of the shifted copy that lies beyond the critical value of 1.96:

library(tidyverse)

delta <- 2.8
crit <- qnorm(0.975)

densities <- tibble(t = seq(-4, 7, length.out = 1000)) |>
    mutate(`Null: N(0, 1)` = dnorm(t),
           `Alternative: N(2.8, 1)` = dnorm(t, mean = delta)) |>
    pivot_longer(-t, names_to = "distribution", values_to = "density")

densities |>
    ggplot(aes(x = t, y = density, linetype = distribution)) +
    geom_area(data = filter(densities,
                            distribution == "Alternative: N(2.8, 1)",
                            t > crit),
              fill = "grey70", alpha = 0.6, show.legend = FALSE) +
    geom_line() +
    geom_vline(xintercept = crit, linetype = "dotted") +
    labs(x = "t-statistic", y = "Density", linetype = NULL) +
    theme_minimal() +
    theme(legend.position = "bottom")

The shaded area is the power at \(\delta = 2.8\), which is 0.80.

There is one subtlety here for those familiar with asymptotic theory. For a fixed \(\tau_1 \neq 0\), \(\delta = \sqrt{n} \, \tau_1 / \sqrt{V} \to \infty\) as \(n \to \infty\), so the power tends to one. Any consistent test eventually detects any fixed effect, which makes the fixed-alternative limit uninformative. The formula above is properly justified under local alternatives \(\tau_n = h / \sqrt{n}\). In that case \(\delta = h / \sqrt{V}\) stays fixed, and the same central limit theorem and Slutsky argument gives the non-degenerate limit \(\Phi(h/\sqrt{V} - z_{1-\alpha/2})\). In practice, we plug in the actual \(n\) and \(\tau_1\) and treat the result as an approximation.

The Minimum Detectable Effect and the Required Sample Size

The two standard planning formulas come from a single equation: set the power equal to a target \(1 - \beta\) and solve.

First, fix the power. Using the one-tail approximation,

\[ \Phi(\delta - z_{1-\alpha/2}) = 1 - \beta. \]

Second, since \(\Phi\) is strictly increasing, we can apply \(\Phi^{-1}\) to both sides. By definition, \(\Phi^{-1}(1 - \beta) = z_{1-\beta}\), so

\[ \delta - z_{1-\alpha/2} = z_{1-\beta} \quad \Longrightarrow \quad \delta = z_{1-\alpha/2} + z_{1-\beta}. \]

This is the required noncentrality. For \(\alpha = 0.05\) and 80% power, it equals \(1.960 + 0.842 = 2.80\).

Third, unpack \(\delta\) in terms of the primitives:

\[ \frac{\sqrt{n} \, \tau_1}{\sqrt{V}} = z_{1-\alpha/2} + z_{1-\beta}. \]

This equation links three quantities, the effect size \(\tau_1\), the sample size \(n\) and the variance \(V\), and fixing any two of them determines the third. Holding \(n\) and \(V\) fixed and solving for \(\tau_1\) gives the minimum detectable effect (MDE), the smallest true effect the design detects with probability \(1 - \beta\):

\[ \text{MDE} = (z_{1-\alpha/2} + z_{1-\beta}) \sqrt{V/n}. \]

Holding \(\tau_1\) and \(V\) fixed instead, multiplying by \(\sqrt{V} / \tau_1\) and squaring both (positive) sides gives the required sample size:

\[ n_{\text{req}} = (z_{1-\alpha/2} + z_{1-\beta})^2 \frac{V}{\tau_1^2}. \]

With \(\alpha = 0.05\) and 80% power, the MDE is 2.8 standard errors and the constant in \(n_{\text{req}}\) is \(2.80^2 = 7.85\). This is the rule of thumb that the true effect should be about 2.8 standard errors in size for a study to be adequately powered.

The same result has a geometric reading. On the scale of \(\hat{\tau}\), the test rejects (in the upper tail) when \(\hat{\tau} > z_{1-\alpha/2} \cdot se\). Two conditions determine where that critical value must sit. Under \(H_0\), \(\hat{\tau}\) is centred at 0, and the size requirement places the critical value \(z_{1-\alpha/2}\) standard errors above 0. Under \(H_1\), \(\hat{\tau}\) is centred at \(\tau_1\), and for a fraction \(1 - \beta\) of that distribution to lie beyond the critical value, the critical value must sit \(z_{1-\beta}\) standard errors below \(\tau_1\). The distance from 0 to \(\tau_1\) is therefore the sum of the two pieces, \(\tau_1 = (z_{1-\alpha/2} + z_{1-\beta}) \cdot se\), which explains why the two quantiles add up.

A few remarks are in order. Dropping the lower tail makes the formulas slightly conservative: the exact two-sided power at the MDE is \(1 - \beta + \Phi(-2 z_{1-\alpha/2} - z_{1-\beta})\), which exceeds \(1 - \beta\) by about \(4 \cdot 10^{-5}\) in the example below. For a one-sided test, \(z_{1-\alpha/2}\) is replaced by \(z_{1-\alpha}\), and with \(\alpha = 0.05\) the constant becomes \((1.645 + 0.842)^2 = 6.18\) instead of 7.85. Finally, \(V\) is unknown at the design stage, so the researcher has to plug in a guess for it, and the formulas are only as good as that guess. Since \(n_{\text{req}}\) scales one-for-one with \(V\), underestimating \(\sigma^2\) by 20% leads to a sample that is about 20% too small.

Application: A Randomized Experiment

Consider a randomized experiment with a binary treatment \(D_i\), where \(D \perp (Y(0), Y(1))\) and \(P(D = 1) = p\). The regression model is

\[ Y_i = \mu + \tau D_i + \varepsilon_i, \qquad \text{Var}(\varepsilon_i \mid D_i) = \sigma^2. \]

With a single binary regressor, the OLS slope is exactly the difference in means, \(\bar{Y}_1 - \bar{Y}_0\). Its variance follows from the two independent group means, with \(n_1 \approx np\) treated and \(n_0 \approx n(1-p)\) control units:

\[ \text{Var}(\hat{\tau}) = \frac{\sigma^2}{n_1} + \frac{\sigma^2}{n_0} = \frac{\sigma^2}{n p (1-p)}, \qquad \text{so} \qquad V = \frac{\sigma^2}{p (1-p)}. \]

Here the distinction from before is visible: \(V\) does not depend on \(n\), whereas \(\text{Var}(\hat{\tau}) = V/n\) shrinks with it. Substituting \(V\) into the formula for the required sample size gives

\[ n_{\text{req}} = 7.85 \cdot \frac{\sigma^2}{p (1-p) \tau_1^2}. \]

As a numerical example, standardize the outcome so that \(\sigma = 1\), and suppose we expect an effect of \(\tau_1 = 0.2\) standard deviations with a 50/50 split, so that \(p(1-p) = 0.25\). The required sample size is \(7.85 / (0.25 \times 0.04) \approx 785\) units in total, or about 393 per arm. As a check, \(se = 1 / \sqrt{785 \times 0.25} = 0.0714\), so \(\delta = 0.2 / 0.0714 = 2.80\) and the power is \(\Phi(2.80 - 1.96) = \Phi(0.84) = 0.80\).

Conversely, with only \(n = 400\) units, \(se = 1/\sqrt{100} = 0.1\), so \(\delta = 2.0\) and the power is \(\Phi(2.0 - 1.96) = \Phi(0.04) \approx 0.52\), close to a coin flip. The second tail, \(\Phi(-3.96)\), is negligible.

To check whether the asymptotic approximation is accurate at these sample sizes, I simulate the experiment 5,000 times, regress \(Y\) on \(D\) with conventional standard errors, and record how often the test rejects. The function below also allows for an unequal allocation and for a covariate \(X\) that explains a share \(R^2\) of the outcome variance, which I use in the next section.

set.seed(1234)

simulate_experiment <- function(n, tau = 0.2, p = 0.5, r2 = 0, reps = 5000) {
    results <- replicate(reps, {
        d <- rbinom(n, 1, p)
        x <- rnorm(n)
        y <- tau * d + sqrt(r2) * x + sqrt(1 - r2) * rnorm(n)
        fit <- if (r2 > 0) lm(y ~ d + x) else lm(y ~ d)
        coefs <- summary(fit)$coefficients["d", ]
        c(estimate = coefs[["Estimate"]],
          reject = abs(coefs[["t value"]]) > qnorm(0.975))
    })
    as_tibble(t(results))
}

analytic_power <- function(n, tau = 0.2, p = 0.5, r2 = 0) {
    delta <- tau / sqrt((1 - r2) / (n * p * (1 - p)))
    pnorm(delta - qnorm(0.975)) + pnorm(-delta - qnorm(0.975))
}

designs <- tibble(
    design = c("p = 0.5, n = 785", "p = 0.5, n = 400",
               "p = 0.2, n = 1226", "p = 0.5, R2 = 0.5, n = 393"),
    n  = c(785, 400, 1226, 393),
    p  = c(0.5, 0.5, 0.2, 0.5),
    r2 = c(0, 0, 0, 0.5)
)

sims <- designs |>
    mutate(draws = pmap(list(n, p, r2),
                        \(n, p, r2) simulate_experiment(n, p = p, r2 = r2)))

sims |>
    mutate(analytic = pmap_dbl(list(n, p, r2),
                               \(n, p, r2) analytic_power(n, p = p, r2 = r2)),
           simulated = map_dbl(draws, \(d) mean(d$reject))) |>
    select(design, analytic, simulated) |>
    knitr::kable(digits = 3)
design analytic simulated
p = 0.5, n = 785 0.800 0.795
p = 0.5, n = 400 0.516 0.521
p = 0.2, n = 1226 0.800 0.792
p = 0.5, R2 = 0.5, n = 393 0.801 0.804

The simulated rejection rates are within about one percentage point of the analytic power in each design, so the asymptotic approximation is accurate here.

What Affects Power

Every design choice affects power through \(V\), the variance of the influence function. I discuss four of them.

The first is allocation. \(p(1-p)\) is maximized at \(p = 1/2\). With \(p = 0.2\), \(p(1-p) = 0.16\), so the required sample size rises to about 1,226 instead of 785, as the third row of the table confirms. If the two arms have different outcome variances, \(\text{Var}(\hat{\tau}) = \sigma_1^2 / (np) + \sigma_0^2 / (n(1-p))\), and the optimal allocation satisfies \(p / (1-p) = \sigma_1 / \sigma_0\). This is known as Neyman allocation: the arm with the noisier outcome receives more units.

The second is covariates. Regressing \(Y\) on \(D\) and pre-treatment covariates \(X\) replaces \(\sigma^2\) by the residual variance \(\sigma^2 (1 - R^2_{Y|X})\), where \(R^2_{Y|X}\) is the share of the outcome variance explained by \(X\). With \(R^2 = 0.5\), only about 393 units are needed, and the last row of the table shows a simulated power of about 0.80 at that sample size. This is the logic of outcome regression and augmented inverse probability weighting (AIPW) applied to a randomized setting. Randomization already identifies the treatment effect, so modelling the conditional means \(\mu_0(X)\) and \(\mu_1(X)\) adds nothing to identification. It does, however, lower the variance of the influence function, and that raises power. A baseline measurement of the outcome is usually the single most useful covariate in this respect.

The third concerns observational designs. For inverse probability weighting or doubly robust estimators of the ATT, \(V\) contains terms such as \(\frac{e(X)}{1 - e(X)} \text{Var}(Y(0) \mid X)\), where \(e(X)\) is the propensity score. Propensity scores close to 1, that is, limited overlap, inflate \(V\). The cost of weak overlap therefore shows up directly as low power, even when the effect is identified.

The fourth is clustering. If treatment is assigned to clusters of size \(m\) with intra-cluster correlation \(\rho\), \(V\) is multiplied by the design effect \(1 + (m - 1)\rho\). With clusters of 20 units and \(\rho = 0.05\), for example, the design effect is 1.95, so the required number of units almost doubles.

Interpreting Power

Two points of interpretation follow from the derivation. The first is that power is a design-stage quantity. The alternative \(\tau_1\) should be chosen before seeing the data, either from a substantively relevant effect size or from prior estimates shrunk toward zero. So-called post-hoc power, computed by plugging the estimated \(\hat{\tau}\) into the power formula, is a one-to-one function of the \(p\)-value, and therefore adds no information beyond it.

The second is that underpowered studies distort the estimates that reach statistical significance. When power is low, the estimates that clear the significance threshold are biased upward in magnitude. In the example with \(n = 400\) and a power of 0.52, a significant estimate must exceed \(1.96 \times 0.1 = 0.196\) in absolute value, which is almost the size of the true effect of 0.2, so the significant estimates are on average larger than 0.2. Gelman and Carlin (2014) call this a Type M (magnitude) error. The simulation draws from the previous section allow us to compute the exaggeration ratio, the mean absolute significant estimate divided by the true effect:

sims |>
    mutate(exaggeration = map_dbl(draws,
                                  \(d) mean(abs(d$estimate[d$reject == 1])) / 0.2)) |>
    select(design, exaggeration) |>
    knitr::kable(digits = 2)
design exaggeration
p = 0.5, n = 785 1.13
p = 0.5, n = 400 1.38
p = 0.2, n = 1226 1.12
p = 0.5, R2 = 0.5, n = 393 1.13

At \(n = 400\), significant estimates overstate the true effect by almost 40% on average, whereas in the three designs with 80% power the exaggeration is about 12 to 13%. This is a good reason to plan for power at the design stage rather than to rely on obtaining a significant result.

Conclusion

In this post, I have derived the power function of a \(t\)-test from the asymptotic normality of the estimator, and shown that the minimum detectable effect and the required sample size both follow from setting the noncentrality \(\delta\) equal to \(z_{1-\alpha/2} + z_{1-\beta}\). In a randomized experiment, the asymptotic variance is \(V = \sigma^2 / (p(1-p))\), and a simulation confirms that the resulting approximations are accurate at realistic sample sizes. Allocation, covariates, overlap and clustering all affect power through \(V\). Thanks for reading!

References

Gelman, A., & Carlin, J. (2014). Beyond power calculations: Assessing Type S (sign) and Type M (magnitude) errors. Perspectives on Psychological Science, 9(6), 641–651.