1
$\begingroup$

I want to calculate power for an interaction (two categorical variables, each with two levels). I'm using the simr package. I'm able to calculate the observed power, but now I would like to modify the effect size. I know that I cannot set the effect size for the overall interaction, but I need to either modify the main effects or set the effect for each combination of the two variables involved. The issue is that, whichever of these two solutions, I don't know how to choose the new values. I would just play around and see ho the power and interaction effect size change, but, for some reason, the powerSim function doesn't calculate the effect size (instead says: Test: unknown test). Does anybody have any suggestion?

$\endgroup$
2
$\begingroup$

An interaction between two binary factors $x_1$ and $x_2$ is a double difference. If the $x$'s had values of 0 and 1, and letting 00 01 10 11 denote all the $x$ combinations, the interaction effect corresponds to parameters for (01 - 00) - (11 - 10). We don't usually expect qualitative interactions, i.e., different signs for 01 - 00 as for 11 - 10. It is reasonable to set a interaction effect size not to miss, for the purpose of a power calculation, as (01 - 00) / 2, i.e., the interaction effect being half the main effect. In the best possible case of equal cell sizes for 00 01 10 11 you'll need $16 \times$ the sample size for the interaction effect that you need for the main effect. See this by Andrew Gelman.

$\endgroup$
0
$\begingroup$

As far as I know, powerSim uses slope differences. This is an effect size but not a standardized one. So of course, powerSim doesn't calculate the effect size in a standardized way - it uses your observed slope differences (depending on the contrast you have used in your model) to calculate power. If you want to manipulate the effect size, just use the fixef-function to change them (e.g. fixef(model)[c("effect1", "effect2")] <- c(somevalue_x, somevalue_x).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.