Sample size: predictor block, partial correlation, several factors, covariate, repeated measurements
In brief
Besides the simple cases, the "Plan a study" page calculates four more: the increase in R² from a block of predictors and the partial correlation (both under "Predict something" at "What should be tested?"), and the card "Groups with several factors or repeated measures" (two or three factors, covariate, planned contrast, repeated measures). The calculations are those of G*Power; the printed examples in the G*Power manual (1 June 2023) and by Faul and colleagues (2007, 2009) come out to the last printed digit.
Increase in R² (a block of predictors)
- The question is: how many people are needed for the F test to find that a block of q predictors explains additional variance when the others are already in the model? What counts is f² = (R² with − R² without) / (1 − R² with). Example from the manual: f² = .0714 (R² from .25 to .30), 4 of 9 predictors, α = .01, power .80 gives N = 242.
- Pitfall 1: Cohen's benchmarks .02 / .15 / .35 apply to f², not to the increase in R². An increase of .10 at R² = .25 is f² of about .15.
- Pitfall 2: "All predictors in the model" are those of the full model, including those already in it. A group variable with g levels counts as g − 1 predictors.
- Pitfall 3: The R package pwr calculates this case wrongly as soon as there are control variables: with f² = .35, 3 tested predictors and 5 control variables pwr asks for N = 41, the correct number is 37 (G*Power and WebPower). The page calculates like G*Power.
- Pitfall 4: Fixed or random model. G*Power (and the page) assume the predictors are set by the experimenter. If they are measured, the power is somewhat lower: in the example with N = 90 a simulation shows it dropping from .241 to .218. That is why the note to allow a small safety margin is always shown.
- Pitfall 5: R² values from a small pilot study are biased upwards; better use the adjusted R². The increase in the hierarchical regression is called ΔR² there; the page turns it into f².
Partial correlation
- The relationship between two variables once k others are partialled out. G*Power has no calculation of its own for this; there you take "R² increase with one predictor" (fixed). Statable calculates exactly by default: the sample ρp is distributed like an ordinary correlation from N − k pairs. "As G*Power (fixed)" can be chosen.
- The difference is noticeable: for ρp = .30 and power .80 (two-tailed) the fixed calculation gives N = 82 for any number of control variables. Exactly it is 84 with no control variable, 85 with one, 87 with three and 92 with eight. A simulation with 20,000 runs at N = 84 confirms the exact calculation (power .788 with three control variables; fixed would be .812).
- The semipartial correlation and the standardized β are different from the partial correlation. The control variables should be related to both variables, otherwise it is just the simple correlation.
Several factors, contrasts and covariate
- Factorial analysis of variance: what counts is the effect (main effect or interaction) with its f and its numerator degrees of freedom; the design enters the denominator degrees of freedom only through the number of all cells. Cohen's .10 / .25 / .40 apply per effect. Example: 3 × 3 groups, interaction, f = .25, power .80: N = 196 (22 per cell), 198 with equal-sized cells. G*Power gives the smallest number, which need not be a multiple of the cells (for A×C in 3 × 2 × 5 with f = .1: 2283); Statable shows both. If several effects are to be found, the least favorable one counts.
- Contrasts: f = |Σ cᵢμᵢ| / √(N Σcᵢ²/n) / σ with one numerator degree of freedom. The weights cᵢ add up to 0.
- Covariate: the effective f is f / √(1 − R²), the denominator degrees of freedom drop by the number of covariates. At f = .25 and 6 cells it takes N = 158 without a covariate, with a covariate that explains 20% of the variance within the groups 127, at 50% only 81. This formula is backed by a simulation (formula .652, simulated .656 at N = 120), not by a printed example.
- The partial η² from an analysis of covariance in SPSS is already adjusted for the covariate. Work out f from it and set R² of the covariate to 0, otherwise the adjustment is made twice.
- The partial η² from SPSS depends on the number of people in the pilot study (it is sample-based). The help window "work out f" converts it to the f of G*Power using N and the degrees of freedom of the pilot study: f² = η²/(1 − η²) · df₂ / N.
Repeated measures: the same f, three meanings
- The same number f means something different in G*Power, WebPower and SPSS. G*Power: f = spread of the means divided by the spread of ONE measurement within a group; the correlation between the measurements is added separately. WebPower: f already includes the correlation (f_WebPower = f_G·√u). SPSS: the partial η² with the error term person × condition. With f = .2572, 3 groups, 3 measurements, ρ = .30 and power .80, G*Power gives N = 36 and WebPower N = 148. Statable uses the G*Power meaning; the sentence in the report says so.
- From a partial η² from SPSS the help window works out the G*Power f: g = η²/(1 − η²); f_S² = g (m − 1)(N₀ − k) / (m N₀); f_G² = f_S² (1 − ρ). An example: η²p = .128 at N = 90 gives f = .2572.
- The correlation ρ between the measurements is an assumption that moves the result a lot: the higher ρ, the fewer people the time effect needs (one group, 3 measurements, f = .25: 38 / 28 / 17 at ρ = .3 / .5 / .7), but the MORE the group difference needs (two groups, 3 measurements: 69 / 86 / 103).
- ε (nonsphericity) below 1 needs more people (time effect, 3 measurements, ρ = .5: 28 at ε = 1, 34 at ε = .75). The calculation is then an approximation that is somewhat too optimistic: with 4 measurements, N = 30 and ε = .718 the formula gives .723, a simulated Greenhouse-Geisser test .694. ρ below −1/(measurements − 1) is impossible and blocked.
- The multivariate analysis (MANOVA) of repeated measures is not calculated. Dropout: allowance n / (1 − dropout), as everywhere.
An a priori power analysis for the effect of the measurement occasions in a repeated measures analysis of variance (one group, 3 measurements, f = .25, expected correlation between the measurements r = .50, ε = 1, α = .05, 1 − β = .80) yielded a required sample size of N = 28. It was computed in Statable using the noncentral F distribution, following the procedure of G*Power. The effect size f is meant as in G*Power, not as in SPSS or WebPower.