I am trying to run a post-hoc power analysis on a previously conducted study, in which the results were analysed through a two-way repeated measures ANOVA (I used a 2x2 within-subjects design). Through the previous analysis, I already have the effect size (Cohen's f), sample size, and alpha, so based on these measures, I want to calculate the power. However, I'm struggling to find out how to do a power analysis for two-way repeated measures ANOVA. The 'pwr' function in r seems to support only power analysis for one-way ANOVA, and so does the other ones. I'd appreciate it if anyone could help me on this matter.
1 Answer
You can do this in G*Power software, or in R using the WebPower package:
library(WebPower)
wp.rmanova(n = 30, ng = 2, nm = 2, f = 0.36, alpha = 0.05, power = NULL, type = 1)
where n = number of participants, ng = nr of groups, nm = nr of measurements, f=Cohen's f and type=1 specifies that you want power for the repeated effect (0 (default) is for between-groups effect and 2 is for within-between interaction).
Edited to add - it seems that Gpower's default for specifying Cohen's f is different from WebPower's default. I got identical results when I went to GPower options and chose "effect size specifications - as in Cohen (1988))"
-
$\begingroup$ Thanks for the reply. However, I have additional questions. First of all, I'm not sure what the nm(#of measurement) means. Also, I am trying to do an analysis two within-subject factors, but doesn't wp.rmanova only support either analysis for one within-subject factor or one within and one between-subject factor? $\endgroup$– fr000gCommented Jan 2, 2023 at 2:46
-
$\begingroup$ number of measurements refers to the number of levels of the within-person factor. But unfortunately, it seems WebPower can't handle an interaction between two within-person factors. (if you had 4 entirely different repeated measures conditions that all participants went through, you could specify nm = 4, ng=1, type=1, but wp.rmanova doesn't seem to take 2 within-person factors). $\endgroup$– SointuCommented Jan 2, 2023 at 9:12
-
$\begingroup$ I see. Thanks for the comment! Btw, do you know any R packages that support power analysis with 2 within-subject factors by any chance? $\endgroup$– fr000gCommented Jan 3, 2023 at 0:03
-
$\begingroup$ Sorry, I don't :( It's curious that that option does not seem to be readily available in any software (but I don't know G*Power well, it might be possible there). Using simulations is an option too. $\endgroup$– SointuCommented Jan 3, 2023 at 13:53
-
$\begingroup$ I dont' think it's available in G*Power but thanks a lot. Much appreciated. $\endgroup$– fr000gCommented Jan 4, 2023 at 0:10