dbaranger / InteractionPoweR

InteractionPoweR: Power analysis for interactions via simulation in R
GNU General Public License v3.0
19 stars 1 forks source link

Three-way interaction? #2

Closed rempsyc closed 2 years ago

rempsyc commented 2 years ago

Reading the documentation led me to believe that it is not possible to do a power analysis for a three-way interaction with InteractionPoweR. I would just like to verify that this is correct? I have two binary variables (experimental manipulations) and one continuous variable. If three-way interactions are not supported at this time, are you expecting to add support in the future, and can you think of any other package to accomplish this goal at this time (e.g., how would you do it personally)? I have looked at package Superpower but it does not seem to support continuous variables. Thanks.

dbaranger commented 2 years ago

Hello! Yes, that it correct, we do not currently support 3-way interactions. I am planning on implementing them in the near future (2-3 months). I don't know of any existing way except for SuperPower, sorry!

dbaranger commented 2 years ago

I circled back to this, and after some initial work I came to several roadblocks. Primarily, I'm not aware if anyone has worked out what the variance of a 3-way interaction term will be if the variables are correlated. Without that, I can only write a function for the special (unusual) case when all three variables are uncorrelated (and when the 2-way interaction terms are uncorrelated with the third variable - i.e. x1x2 is uncorrelated with x3, x2x3 is uncorrelated with x1, and x1x3 is uncorrelated with x2). And, one does not need this package for that case (simply sum the r2 of all the variables, and use the change in r2 power function in G*Power). For the time being, I am going to close this issue, but I will return to it if I ever learn to a solution to this roadblock!