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.
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))"