G*Power is a free statistical software that calculates the required sample size for a study based on the chosen statistical test, effect size, alpha level, and power. You enter these four parameters, and it returns the minimum number of participants (or observations) needed to detect a true effect. This article explains how to use G*Power, what each input means, and how to interpret the results.
Formula
The formula used in the calculator above is a simplified version for a one-way ANOVA with equal group sizes. The exact formula in G*Power is more complex, but the core relationship is:
N = ( (z1-α/2 + z1-β)2 * (k + 1) ) / (k * f2)
Where:
- N = total sample size (number of participants across all groups)
- k = number of groups
- f = Cohen’s f effect size (0.1 = small, 0.25 = medium, 0.4 = large)
- z1-α/2 = z-score for the alpha level (1.96 for α = 0.05, two-tailed)
- z1-β = z-score for the desired power (0.84 for 80% power)
In the calculator block, the expression uses (1.96 + 0.84)2 = 7.84, and the denominator is adjusted for the number of groups. The result is rounded up to the nearest whole number.
Worked Example
Suppose you plan a study with 2 groups, a medium effect size (f = 0.25), α = 0.05, and power = 0.80. Using the defaults from the calculator:
N = ( (1.96 + 0.84)2 * (2 + 1) ) / (2 * 0.252) = (7.84 * 3) / (2 * 0.0625) = 23.52 / 0.125 = 188.16
Round up to 189 total participants, about 95 per group. The calculator gives 189 (rounded from 188.16). Always round up to the next whole number.
Assumptions
- The test is a one-way ANOVA with equal group sizes (the calculator assumes balanced design).
- The effect size is Cohen’s f, which is the standard deviation of group means divided by the common within-group standard deviation.
- The alpha level is two-tailed (default).
- The power is the probability of rejecting the null when the alternative is true.
How to Choose the Right Test in G*Power
G*Power offers a wide range of tests under the “Test family” dropdown. The most common families are:
- t tests – for comparing two means (independent or paired).
- F tests – for ANOVA, ANCOVA, regression, and MANOVA.
- χ² tests – for categorical data (goodness-of-fit, independence).
- Exact – for binomial, Poisson, and other exact tests.
After selecting the family, choose the specific statistical test you plan to run (e.g., “Means: Difference between two independent means (two groups)”). Then set the analysis type: “A priori” (compute required sample size), “Post hoc” (compute achieved power for a given sample size), or “Compromise” (balance alpha and beta).
Understanding Effect Size
Effect size is the magnitude of the difference you expect to detect. G*Power uses several measures:
- Cohen’s d for t-tests: (mean1 – mean2) / pooled standard deviation. Small = 0.2, medium = 0.5, large = 0.8.
- Cohen’s f for ANOVA: square root of (η² / (1 – η²)). Small = 0.1, medium = 0.25, large = 0.4.
- Odds ratio for logistic regression.
If you don’t know the expected effect size, use the conventional small, medium, or large values, or refer to prior literature. Be realistic: too small an effect size will demand an impractical sample size; too large may underpower your study.
Common Mistakes and How to Avoid Them
- Using one-tailed instead of two-tailed: For most research, two-tailed is appropriate. G*Power defaults to two-tailed; changing it alters the z-score and sample size.
- Forgetting to adjust for multiple comparisons: If you plan multiple tests, your alpha should be corrected (e.g., Bonferroni). G*Power doesn’t automatically do this; you must lower the alpha accordingly.
- Assuming equal group sizes: The simplified calculator above assumes equal groups. In G*Power, you can specify unequal allocation ratios (e.g., 2:1) which increases the total sample size.
- Rounding down: Always round up to the nearest whole number, and add a small buffer for dropouts (e.g., 10-20% extra).
- Ignoring the actual test: The sample size for a t-test differs from that for an ANOVA. Use the test you will actually run.
Comparisons: G*Power vs. Other Tools
G*Power is free, open-source, and widely used in social sciences. Alternatives include:
- PASS (Power Analysis and Sample Size) – commercial, more extensive features, but expensive.
- R packages (pwr, powerAnalysis) – free, flexible, but requires programming.
- Online calculators (e.g., from universities) – quick but limited to specific tests.
- SPSS (with optional module) – available but not as comprehensive.
G*Power is often preferred because it is free, covers many tests, and allows for custom effect sizes.
Costs and Availability
G*Power is completely free to download and use for academic and non-commercial purposes. It runs on Windows, macOS, and Linux. You can download it from the official website (gpower.hhu.de). No registration or license is required.
Safety and Accuracy Notes
Sample size calculations are a planning tool, not a guarantee. The actual power of your study depends on many factors: the true effect size, measurement reliability, and adherence to the protocol. Always consult with a statistician if you are unsure. For clinical trials, follow regulatory guidelines (e.g., ICH E9). The calculator above is for educational purposes; use G*Power for final decisions.
Frequently Asked Questions
Q: What is the difference between a priori and post hoc power analysis?
A: A priori analysis is done before data collection to determine the sample size needed to detect an effect. Post hoc analysis is done after the study to estimate the power actually achieved given the observed effect size and sample size. Post hoc is sometimes criticized because it doesn’t change the study outcome.
Q: How do I find the effect size for my study?
A: You can estimate it from previous research, pilot studies, or use conventional benchmarks (e.g., Cohen’s d = 0.5 for medium). If you have no idea, a sensitivity analysis (varying effect size) helps you see how sample size changes.
Q: Can I use G*Power for non-parametric tests?
A: G*Power has some non-parametric options, but they are limited. For many non-parametric tests, you can use the parametric equivalent with a slightly larger sample size (e.g., 10-15% more) to account for the loss of power.
Q: What if my sample size is too large for my budget?
A: You have several options: reduce the effect size (if justifiable), lower the power (e.g., from 0.80 to 0.70), increase the alpha (e.g., from 0.05 to 0.10), or use a more efficient design (e.g., paired samples instead of independent). Each trade-off has ethical and scientific implications.
Q: Does G*Power work for complex designs like mixed models?
A: G*Power does not directly handle multilevel or mixed models. For those, you may need specialized software (e.g., simulation in R or SAS). G*Power can still give you a rough estimate if you treat the design as a simpler ANOVA, but be cautious.
Q: Why does my sample size change when I switch from two-tailed to one-tailed?
A: One-tailed tests require a smaller sample size because the critical z-value is lower (1.645 vs. 1.96 for α = 0.05). However, one-tailed tests are only appropriate if you have a strong directional hypothesis and can justify that an effect in the opposite direction is impossible or irrelevant.
Related
Formula used
in n | Number of groups | - | 2 | 2 in f | Effect size f (Cohen's f) | - | 0.25 | 0.01 in a | Alpha (Type I error) | - | 0.05 | 0.001 in p | Power (1 - Type II error) | - | 0.80 | 0.50 out total | Total sample size | - | (n * (1 / (f^2)) * ((1.96 + 0.84)^2)) / (1 - (1 / (n * (1 / (f^2))))) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.
More in this section
- Mean and Median Calculation Example
- Right Triangle Trigonometry Angle Calculation
- Simple Interest Rate Calculation Example$150.00
- Ladder Height Calculation Problem?24.74 ft
- Mean Absolute Deviation Calculation Example
- Average Speed Calculation Problem?100.00 km