Sample Size for Mediation: Why G*Power Cannot Do It

In short

G*Power cannot compute power for the indirect effect. Its test families (exact, F, t, chi-square and z) contain nothing that fits the product ab, so what it hands back is the power to detect path b, which is a different question. The standard answer is Monte Carlo simulation: you fix a and b, generate thousands of samples of size N, build a confidence interval for the indirect effect in each one, and count how often it excludes zero. With a = 0.35 and b = 0.30 the simulation asks for about 96 participants for power of .80; drop a to 0.20 and it asks for close to 200, while G*Power answers 81 in both cases. The Schoemann et al. (2017) app runs that simulation free in your browser.

You are writing the power section of an ethics application or a grant, your hypothesis is that the intervention works through a mechanism, and someone asks how many participants you need. You open G*Power, pick “Linear multiple regression: fixed model, single regression coefficient”, type an f2 of 0.10 with two predictors, and out comes a number that looks like an answer. It is not: that number is the power to detect path b, not the power to detect the indirect effect, which is the whole point of the study. The general guide to calculating sample size with G*Power works for a t test, an ANOVA or a correlation. A mediation model needs a different method, and that method is Monte Carlo simulation.

What G*Power actually gives you when you ask it about mediation

G*Power is organized by distribution family: exact tests, F, t, chi-square and z. A test makes it into the program when its statistic follows one of those distributions under the null, because the whole machinery works by shifting that distribution with a noncentrality parameter. The indirect effect is the product of two regression coefficients, and the sampling distribution of a product of two normal variables is not normal: it is heavy-tailed and, except in special cases, skewed, and it only approaches normality when both paths are large relative to their standard errors. There is no box for it because there is no distribution to put in the box.

What most people do instead is ask G*Power for the power of a single regression coefficient, using the f2 of path b with two predictors. That answers a perfectly reasonable question — how many people do I need to detect the effect of the mediator on the outcome controlling for the treatment — which is not the question your hypothesis asks. Your hypothesis says that X affects Y through M, and that claim lives in the product, not in either half of it.

The shortcut misleads in a way you can check on paper. Take two scenarios: in the first, a = 0.35 and b = 0.30; in the second, a = 0.20 and b = 0.30. In both, the f2 for path b sits around 0.10, so G*Power returns the same sample size for both: 81 participants for power of .80. But the indirect effect in the first scenario (ab = 0.11) needs roughly 96 participants, and in the second (ab = 0.06) it needs close to 200. Same answer for two studies that differ by more than double the sample, because the thing that separates them — the size of path a — never entered the calculation.

There is a standard objection worth answering: the Sobel test is a z test, and G*Power has a z family. True, and no help. G*Power contains no procedure that takes a and b as inputs and returns the standard error of their product, and the Sobel test is precisely the one the field has moved away from, because it assumes a normal sampling distribution for ab that does not hold and loses power against bootstrap intervals.

Why the indirect effect is hungrier than either path

For the confidence interval around ab to exclude zero, both paths have to be estimated well at the same time. That is a conjunction, not a sum: power for the indirect effect is bounded by the power of the weaker path and, in practice, behaves roughly like the product of the two. Power of .95 on path a and .84 on path b leaves you with .80 on the indirect effect. Two paths that each look comfortable produce a study that is not.

The shape of the distribution adds to it. Because the product is skewed, symmetric intervals built from a standard error are badly centered and reject less often than they should. Percentile bootstrap, bias-corrected bootstrap and Monte Carlo intervals fix the shape of the interval, but none of them hands you power for free: you still need enough data for both paths to clear zero.

The third factor is one you control and almost nobody checks: the reliability of the mediator. Measurement error attenuates coefficients, and because the indirect effect is a product, that attenuation is paid twice. A mediator with an internal consistency of .70 does not estimate the same path b as one with .90, and the difference is settled in participants. Modeling the mediator as a latent variable recovers part of the loss, at the price of a larger model that also wants sample.

The classic numbers are those of Fritz and MacKinnon (2007), who tabulated the N required for power of .80 across several tests of mediation. With both paths small, the bias-corrected bootstrap — the most efficient method they compared — needed 462 participants, while the Baron and Kenny causal steps needed 20,886; with both paths medium, about 70 was enough. That 20,886 is why causal steps quietly vanished from journals: the procedure was never banned, it was simply out of reach for almost every study that used it.

Monte Carlo simulation, step by step

The logic is plain and needs no new formulae: if you cannot work out analytically how often you would detect the effect, simulate it many times and count. One. Fix the population values of the model — path a, path b, the direct effect c' and whatever variances or correlations the model needs. Two. Generate a large number of artificial samples of size N from that model. Three. In each sample, fit the mediation model and build a confidence interval for the indirect effect. Four. Count the proportion of intervals that exclude zero: that proportion is your estimated power at that N. Five. Move N up or down and repeat until you hit your target.

The number of replications is not decoration, because the power you get is itself an estimate with error attached. With 1,000 replications and a true power of .80, the 95% margin of error is roughly ±.025; with 5,000 replications it drops to about ±.011. Use a thousand to explore and five thousand for the number you are going to print in the Method section.

One computational detail explains why some tools take seconds and others take hours. If you run a full 5,000-resample bootstrap inside every replication, you have two nested loops and millions of model fits. That is why the fast applications build the interval with the Monte Carlo method instead (Preacher & Selig, 2012): they simulate the distribution of the product from the estimates of a and b and their covariance matrix, rather than resampling the data. The result is close to the percentile bootstrap at a fraction of the cost.

For the scenario above — a = 0.35, b = 0.30, c' = 0.20, with 5,000 replications — the simulation reaches power of .80 at around N = 96 and .90 at around N = 122. Your own run may land on a slightly different figure depending on the interval type, the number of replications and the seed. That is expected, and it is one more reason to set the seed and report it. What does not move is the order of magnitude, or the fact that the indirect effect costs more than path b on its own.

Which tool for which model

Simple mediation, two parallel mediators, two serial mediators. The web app by Schoemann, Boulton and Short (2017) is the shortest route: you enter correlations or coefficients, choose “Set Power, Vary N”, and it returns power against sample size. It is free, it runs in the browser, and because it uses Monte Carlo intervals a serious analysis takes under a minute. For a thirty-second first pass there is David Kenny's MedPower app, which returns power for the indirect effect analytically, with no simulation: useful for orienting yourself before you collect anything, but it does not reproduce the behavior of the bootstrap interval you will actually use, so I would not offer it as the only justification in a manuscript.

R. The bmem package (Zhang, 2014) computes power for mediation with bootstrapping and handles non-normal data and missing values, which is the situation most real studies are in. WebPower provides wp.mediation() for the Sobel-type case. When the model fits no app at all, lavaan plus simsem lets you simulate anything you can specify, at the cost of writing it yourself.

Latent variables and complex designs. For mediation among latent constructs, pwrSEM (Wang & Rhemtulla, 2021) runs power analysis parameter by parameter through a point-and-click interface. And for everything that fits nowhere else — multilevel mediation, longitudinal mediation, moderated mediation, categorical outcomes — there is the MONTE CARLO command in Mplus, the approach set out by Muthén and Muthén (2002) and applied to complex mediational designs by Thoemmes, MacKinnon and Reiser (2010).

If your model is moderated mediation, remember there is no single indirect effect: there is one at every value of the moderator. Power has to be simulated at the specific values you plan to report, and the one that matters is the conditional effect your hypothesis rests on. The modeling side of that is covered in mediation and moderation with the PROCESS macro.

Where a and b come from when you have no prior study

This is the hard part, exactly as in any power analysis. The simulation is arithmetic; the values you feed it are science. In order of preference: a meta-analysis that estimates those paths with instruments close to yours, a previous study using the same measures in a comparable population, or the smallest effect you would consider worth detecting, stated explicitly and defended on clinical or theoretical grounds.

One check is worth running before you trust a value. In a two-arm trial with a binary X and equal groups, a standardized path a of 0.35 means the intervention moves the mediator by roughly d = 0.75 — a large effect for a behavioral intervention. If you would not bet on that difference on the mediator, do not build a sample size on it.

What does not work is treating a pilot estimate as if it were reliable. With 40 participants, the 95% confidence interval around a correlation of r = .35 runs from about .04 to .60. Anchoring your N to the midpoint of that interval is how studies end up underpowered: if the true path sits at the low end, your real power bears no relation to the number you wrote down.

The honest way out is a sensitivity grid. Instead of one number, compute the N you would need if a were 0.20, 0.30 or 0.40 and b were 0.20, 0.30 or 0.40. The pessimistic corner will typically multiply your sample by three or four, and that is the point where you decide: collect it, change the design, or state in writing the smallest indirect effect your study can detect. All three are defensible. Not looking is not. And do not try to repair it afterwards — post hoc power analysis computed from the observed effect is just a restatement of your p value.

Writing the justification in the Method section

A power paragraph for a mediation model has to make six things unambiguous: that power was computed for the indirect effect and not for a single path, what the population values were and where they came from, what model was simulated, how many replications and which type of interval, which software and which seed, and what N follows at what power and what alpha. If you are inflating the target for attrition, say so and give the percentage.

A template, with brackets for you to fill in: “Sample size was determined by Monte Carlo simulation for the indirect effect (Schoemann et al., 2017). A simple mediation model was specified with path a = 0.35 and path b = 0.30, taken from [reference], and a direct effect of c' = 0.20. For each value of N, 5,000 samples were generated and a 95% Monte Carlo confidence interval for the indirect effect was computed in each from 20,000 draws. Under these parameters, N = 96 yields power of .80 and N = 122 yields power of .90, with alpha = .05, two-tailed. A recruitment target of N = 110 was set to retain 96 complete cases under an anticipated 12% attrition rate. Code and seed are available at [repository]”.

What a trained reviewer checks, in this order. That the quantity powered is the product and not a coefficient. That a and b have a source and are not simply “medium effects”. That the target N does not coincide suspiciously with the sample you had already collected. And that the attrition inflation was applied to the N the simulation asked for, not the other way round: 110 minus 12% is 97, which works; 96 minus 12% is 84, which puts the study below the number you just justified.

When it comes time to report the result, the format changes: what gets published is the indirect effect with its bootstrap interval, not a p value. That is covered in how to report a mediation analysis in APA 7, and if you need paths a, b, c' and c laid out with their intervals, the APA mediation table generator produces the table ready to paste.

Frequently asked questions

Can you use G*Power for mediation analysis?

Not for the indirect effect. G*Power works with exact, F, t, chi-square and z test families, and the product ab follows none of those distributions. You can use it for the power of path a or path b separately, but that answers a different question and returns the same number for scenarios that need very different samples.

How many participants do I need for a mediation analysis?

It depends on both paths, not one. With a = 0.35 and b = 0.30, simulation asks for about 96 participants for power of .80 and about 122 for .90. With both paths small, Fritz and MacKinnon (2007) put the requirement at 462 using the bias-corrected bootstrap. Any single figure offered without asking you about a and b was made up.

Is 200 participants enough for a mediation model?

Sometimes, and the number itself tells you nothing. The “200 for SEM” convention is about stable estimation and fit indices, not about power for one specific parameter, and rules such as Green's (1991) 50 + 8k were derived for the R2 of a multiple regression. A study can have 200 participants, fit beautifully, and still be underpowered for its indirect effect.

How many Monte Carlo replications do I need?

A thousand to explore, five thousand for the final figure. With 1,000 replications and a true power of .80, the 95% margin of error is roughly ±.025; with 5,000 it falls to about ±.011. Always report the number of replications and the seed, because without them nobody can reproduce your justification.

Do I need a larger sample for two parallel mediators?

Usually yes, for two reasons. Each specific indirect effect is estimated controlling for the other mediator, so if the mediators correlate, the b paths compete for variance and shrink. And if your hypothesis requires both indirect effects to hold, the conjunction logic applies again: joint power is lower than the power of either one.

Can I justify my sample size after collecting the data?

Not with post hoc power computed from the observed effect, which is only a rewriting of the p value you already have. What is defensible is a sensitivity analysis: given the N you achieved, what size of indirect effect would you have detected with power of .80. That is a statement about what your design could see, and it survives review.

What happens when a reviewer asks where that number came from?

Sample size justification attracts more reviewer comments than almost any other paragraph in the Method, and nearly always for the same reason: the power reported belongs to a different test. The AI paper reviewer reads your manuscript and tells you what they will ask before they ask it.

Run my manuscript through Previum

Once the model gets bigger — serial mediators, a latent mediator, repeated measures, moderated mediation — the simulation stops fitting in a web app and has to be written. That is part of what we do in statistical consulting: build the simulation around your parameters, hand you the code with the seed fixed, and draft the Method paragraph so your committee or your reviewers do not have to take your word for it.

Cite this guide

Ciudad-Fernández, V. (2026, September 4). Sample Size for Mediation: Why G*Power Cannot Do It. Ciudad Science. https://analisisdedatospsicologia.com/en/blog/sample-size-for-mediation-monte-carlo

Keep reading

All blog articles