How to use it
- Pick the test. Two groups is a t-test; three or more is a one-way ANOVA.
- Enter the effect size. If you do not have one, try route 1 under “if you do not know your effect size”.
- Check the significance level, power and expected dropout. The defaults are 0.05, 80 % and 10 %.
- Set the unit to whatever you are counting — animals, wells, plates. It goes into the sentence.
- Copy the protocol sentence into your document, and add a line saying where the effect size came from.
The formulas, and what to watch for
The sample size is the smallest one whose power reaches the target. The power itself is computed exactly from the non-central distribution.
Power
When the null hypothesis is false the test statistic follows a non-central F. Power is the chance that it lands past the critical value.
- Non-centrality
- λ = f² × total N
- Power
- P( F′(k−1, N−k, λ) > F_crit )
- Two-group t-test
- the same with one numerator df (|T|>c ⟺ T²>c²)
Effect size
The two-group d and the k-group f describe the same separation on different scales.
- Cohen's d
- (difference of means) / pooled SD
- For two groups
- f = d / 2
- From change and CV
- d = change(%) / CV(%)
Dropout
To survive dropout, divide the requirement by the fraction expected to remain and round up.
- Requested
- ⌈ required / (1 − dropout) ⌉
What to watch for
- ⚠️ This decides the number of subjects in an experimental group. The number of specimens for an in-vitro diagnostic validation is a different calculation, and this site's Sample Size Calculator is that one. The two share no code and no formula.
- Sample sizes are whole numbers, so the power achieved lands a little above the target. The sentence carries the actual figure.
- Cohen's benchmarks (0.2 / 0.5 / 0.8) are a last resort. Lakens (2013) notes that they are arbitrary and should not be interpreted rigidly.
- The dropout allowance is a planning judgement, not something the statistics decide. Follow your institution's convention.
- Where the power curve flattens, more subjects buy almost nothing. Stopping before that is Reduction in the 3Rs.
- Only two-sided tests are calculated. Using a one-sided test needs its own justification in the protocol, and that judgement is not one this tool can make for you.
Frequently asked questions
Use route 1. “How big a difference would matter?” and “how much does my assay wander?” are both answerable before running anything, and their ratio is d. Wanting to see a 30 % change with a 15 % CV gives d = 2.
Entirely. That one decides how many specimens to collect when validating an in-vitro diagnostic; this one decides how many subjects go in an experimental group. Both read as “sample size”, which is exactly why they are kept apart.
Because sample sizes are whole numbers. If 25 falls short and 26 clears it, 26 is the answer and its power is a little over 80 %. The sentence includes that figure.
It should — the same non-central F distribution is behind both. Simpler calculators that use a normal approximation sometimes come out one subject short.