Research methods guide
Sample size for two independent means
For two independent means, specify the difference of interest, expected standard deviation, significance level, power, and allocation ratio. Use a calculation that matches the planned analysis and design.
This synthetic plan compares two independent means with a meaningful difference of 5 points, common SD 10, two-sided α=0.05, 80% power, and equal allocation.
From inputs to recruitment target
Calculate the analyzable sample per group before allowing for unavailable outcomes.
| Item | Worked example | Verification |
|---|---|---|
| Command | stats::power.t.test(delta=5, sd=10, sig.level=0.05, power=0.8, type="two.sample", alternative="two.sided"). | Confirm n is per group and record the R and package versions. |
| Analyzable sample | About 63.77 per group, rounded up to 64. | Check the difference, SD, two-sided alternative, and target power in the output. |
| Recruitment sample | At 10% anticipated loss, ceil(64/0.90)=72 per group, total 144. | If groups have different expected losses, calculate separately and revisit allocation. |
Apply the method to your materials
Document the assumptions
Explain why the target difference matters and where the SD came from, with scale and time point. Recompute under alternative SDs and losses.
Match the primary analysis
The command targets two independent groups with a common SD. Recalculate for pairing, clustering, unequal allocation, or a different primary model.
Questions that arise in practice
Can a significant published effect be used for delta?
It can be a sensitivity scenario. Base the primary calculation on a defensible meaningful difference tied to the research question.
Verified sources
The official sources below were checked on 2026-11-12. Access conditions and update dates are rechecked before publication.
RigorMed workspace
Start with your research materials
Bring your research question, available materials, and the steps you want to check.
