Quick answers
- What is statistical power?
- The probability that a test rejects a false null hypothesis: the chance of detecting an effect of a given size if it exists. Power = 1 − β, where β is the Type II error rate.
- What is a good statistical power?
- 80% is the usual minimum, meaning a 1 in 5 chance of missing a real effect. 90% is better for expensive or important trials.
- What affects statistical power?
- Four things: the size of the effect you want to detect, the variability (SD or CV), the number of replicates, and α. Good design, such as blocking, raises power by lowering variability.
- How do you calculate sample size?
- Decide the smallest difference worth detecting, estimate the SD from past trials, choose α (0.05) and power (0.80), then solve for n. With SD 0.087 kg/day, detecting 0.10 kg/day needs 13 pigs per diet.
- What is effect size?
- How big an effect is. It can be in raw units (0.14 kg/day), as a percentage, or standardized, such as Cohen's d: the difference divided by the SD.
- Should I calculate power after the experiment?
- Not from the observed effect: this 'post hoc power' just restates the p value. After a trial, report the confidence interval instead; it shows which effects the data can rule out.
On this page
What statistical power means
Every test can make two errors (see hypothesis testing). α, the chance of a false positive, is fixed at 0.05. β, the chance of missing a real effect, depends on the experiment. Power = 1 − β.
An underpowered trial is a poor bet: it will often end with "no significant difference" even when the treatment works, wasting the animals, land and money spent on it. Animal ethics committees and grant reviewers increasingly ask for a power analysis for exactly this reason. Overpowered trials waste resources too. A power analysis finds the balance, and it must be done before the experiment.
The four things that set power
| Factor | Power goes up when | What you control |
|---|---|---|
| Effect size (the difference to detect) | the difference is larger | Choose the smallest difference that matters biologically or economically |
| Variability (SD or CV) | units are more uniform | Uniform animals and plots, blocking, covariates, careful measurement |
| Replicates per treatment (n) | n is larger | Budget, animals, land |
| Significance level α | α is larger | Usually fixed at 0.05 |
Fix any three and the fourth follows. In practice you set α = 0.05 and power = 0.80, estimate the SD, decide the difference worth detecting, and solve for n. If n is unaffordable, the honest options are a larger detectable difference, a better design, or not running the trial.
Effect size and Cohen's d
The effect size is the magnitude of the difference you care about. In agricultural research it is best stated in units people use: kg/day, t/ha, percent.
Cohen's d = (mean₁ − mean₂) / pooled SD
Cohen's benchmarks (0.2 small, 0.5 medium, 0.8 large) come from psychology and fit field and animal trials poorly; there, "large" standardized effects are common because units are uniform. Choose the effect size from biology and economics: the smallest gain that would pay for the supplement, or the yield difference that would make farmers switch varieties. Other effect sizes you will meet include r and R² for relationships, η² for ANOVA, and odds ratios for yes/no outcomes.
Worked example: how many pigs?
Blocking changes the picture. In the first trial, analyzing by litter cut the error SD from 0.082 to 0.047 kg/day. With that SD, 5 pigs per diet give 80% power to detect 0.10 kg/day. Good design is often cheaper than more animals.
Worked example: how many replicates in the field?
Plant breeders and agronomists usually think in coefficients of variation. If the CV of plot yields is known from past trials, the replicates needed are roughly:
r ≈ 2 (t₁ + t₂)² × (CV / D)², where D is the difference to detect as a percent of the mean
Here t₁ ≈ 1.96 for α = 0.05 and t₂ ≈ 0.84 for 80% power, refined with t values for the actual degrees of freedom.
For designs with blocks, split-plots or repeated measures, the calculation must use the right error term; simulation or software such as SAS PROC GLMPOWER handles this. The Plan a study tool includes a sample-size calculator for t-tests and ANOVA.
Common mistakes
- Counting the wrong units. If a diet is fed to a pen, the pen is the experimental unit. Twelve pigs in two pens give 2 replicates, not 12; see experimental design.
- Post hoc power. Power calculated from the observed effect after a non-significant result is always low and adds nothing to the p value.
- Optimistic SDs. Use SDs from similar trials and conditions, or a pilot study; when unsure, plan for the larger value.
- Forgetting dropouts. Add animals or plots for expected losses: deaths, culls, hail.
- Unequal groups. For a fixed total, equal group sizes give the most power; the smallest group limits it.
Power analysis in R and SAS
In R
power.t.test(delta = 0.10, sd = 0.087, power = 0.80) # n per group
power.t.test(n = 6, delta = 0.10, sd = 0.087) # power with 6 per group
power.anova.test(groups = 4, between.var = 0.00446,
within.var = 0.00666, power = 0.80) # n per diet
power.t.test(delta = 10, sd = 6, power = 0.80) # CV 6%, detect 10%In SAS
proc power;
twosamplemeans test=diff
meandiff = 0.10
stddev = 0.087
power = 0.80
npergroup = .;
run;
proc power;
onewayanova
groupmeans = 0.803 | 0.830 | 0.908 | 0.947
stddev = 0.0816
power = 0.80
npergroup = .;
run;Key takeaways
- Power is the chance of detecting a real effect; aim for at least 80%, and calculate it before the trial.
- Power rises with a larger effect, lower variability, more replicates and a larger α.
- Pick the effect size from biology and economics, in real units, not from generic benchmarks.
- Halving the detectable difference needs about four times the replicates; blocking can save many animals or plots.
- Count experimental units, not observations, and skip post hoc power: report confidence intervals instead.
Questions people ask
Why is 80% power the standard?
It is a convention balancing cost and risk, proposed by Jacob Cohen: a Type II risk of 20% alongside a Type I risk of 5%. Important or costly decisions justify 90%.
What if I cannot afford the replicates the power analysis asks for?
Reduce variability (uniform units, blocking, a covariate), accept a larger detectable difference, collaborate across sites, or reconsider the trial. Running it underpowered rarely gives a useful answer.
Does a non-significant result in a small trial mean there is no effect?
No. A small trial has low power, so non-significance is expected even when the treatment works. Look at the confidence interval: if it includes important effects, the question is still open.
What is a power analysis for a mixed model?
The same idea, but variance components (blocks, pens, repeated measures) all affect power. Use simulation or SAS PROC GLIMMIX with a planning dataset, as described by Stroup (2013).
Sources
- Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Lawrence Erlbaum.
- Chapman, P. L., and Seidel, G. E., Jr. (2008). Experimental design, power and sample size for animal reproduction experiments. Reproduction, Fertility and Development, 20(1), 33–40.
- Stroup, W. W. (2002). Power analysis based on spatial effects mixed models: a tool for comparing design and analysis strategies in the presence of spatial variability. Journal of Agricultural, Biological, and Environmental Statistics, 7, 491–511.
- Stroup, W. W. (2013). Generalized Linear Mixed Models: Modern Concepts, Methods and Applications. CRC Press.
- Hoenig, J. M., and Heisey, D. M. (2001). The abuse of power: the pervasive fallacy of power calculations for data analysis. The American Statistician, 55(1), 19–24.