ConceptComplete

Power Analysis and Sample Size

Power analysis determines the sample size needed to detect an effect of a given size with a specified probability, balancing the tradeoff between type I and type II errors.


The Power Function

Definition

The power function of a test with rejection region RR is β(θ)=Pθ(TR)=P(reject H0θ)\beta(\theta) = P_\theta(T \in R) = P(\text{reject } H_0 \mid \theta) This gives the probability of rejection as a function of the true parameter value θ\theta:

  • For θΘ0\theta \in \Theta_0 (null): β(θ)α\beta(\theta) \leq \alpha (size constraint)
  • For θΘ1\theta \in \Theta_1 (alternative): β(θ)=1βtype II(θ)\beta(\theta) = 1 - \beta_{\text{type II}}(\theta) (power)
Definition

The effect size quantifies the magnitude of the departure from H0H_0:

  • For testing μ=μ0\mu = \mu_0: Cohen's d=μμ0/σd = |\mu - \mu_0|/\sigma
  • Small: d=0.2d = 0.2, Medium: d=0.5d = 0.5, Large: d=0.8d = 0.8

The effect size, along with α\alpha and nn, determines the power of the test.


Sample Size Formulas

Theorem9.3Sample Size for Z-test

For a two-sided ZZ-test of H0:μ=μ0H_0: \mu = \mu_0 at level α\alpha with power 1β1 - \beta at μ=μ1\mu = \mu_1: n=((zα/2+zβ)σμ1μ0)2=(zα/2+zβd)2n = \left(\frac{(z_{\alpha/2} + z_\beta)\sigma}{\mu_1 - \mu_0}\right)^2 = \left(\frac{z_{\alpha/2} + z_\beta}{d}\right)^2 where d=μ1μ0/σd = |\mu_1 - \mu_0|/\sigma is the effect size.

ExampleRequired sample size

To detect an effect size d=0.5d = 0.5 with α=0.05\alpha = 0.05 (two-sided) and power 0.800.80 (z0.025=1.96z_{0.025} = 1.96, z0.20=0.84z_{0.20} = 0.84): n=(1.96+0.840.5)2=(2.800.5)2=31.36    n=32n = \left(\frac{1.96 + 0.84}{0.5}\right)^2 = \left(\frac{2.80}{0.5}\right)^2 = 31.36 \implies n = 32 For a small effect d=0.2d = 0.2: n=(2.80/0.2)2=196n = (2.80/0.2)^2 = 196.


Multiple Testing

RemarkThe multiple comparisons problem

When conducting mm simultaneous tests at level α\alpha, the probability of at least one false positive is 1(1α)m1 - (1-\alpha)^m, which grows rapidly with mm. The Bonferroni correction tests each at level α/m\alpha/m, controlling the family-wise error rate (FWER). For large mm (e.g., genomics), the Benjamini-Hochberg procedure controls the false discovery rate (FDR) =E[false positives/total positives]= E[\text{false positives}/\text{total positives}], which is less conservative and more powerful.