I want to conduct a power simulation for my research with crossed random effects model in the R environment. Specifically, in the pilot study, each participant randomly rates 10 stimuli out of a stimulus pool consisting of 100 stimuli. Each stimulus has 20 random raters. I fit a linear mixed effects model with random intercepts for both participants and stimuli (I didn't include any random slopes for some specific reasons).
I want to do a power simulation to estimate how many participants and stimuli should be used for the formal study. Moreover, I also want to take into account the ICC values and want to manipulate the number of raters for each stimulus. I didn't find any tutorials for my case. I have proposed the following three steps as a solution but I'm not sure whether it is the right way to do so:
- Simulate predictor values based on between- and within-stimulus correlations (I guess there is no way to simulate based on both between- and within-stimulus correlations and between- and within-participant correlations so I chose only between- and within-stimulus correlations).
- Simulate random intercepts for participants and stimuli.
- Calculate the outcomes from the regression model.
Besides the question of whether the steps are right, I also have a question about Step 1. The function sim.multilevel
from the psych
package might be useful to implement Step 1, but after checking the package manual I didn't understand how to fit the function for my case.