Power analysis for mixed-effects model

#1
Does anyone know how I can run a power analysis to determine the sample size for a linear mixed-effects model? Can this be done on G*Power?

Thanks
 

spunky

Can't make spagetti
#4
Does anyone know how I can run a power analysis to determine the sample size for a linear mixed-effects model? Can this be done on G*Power?

Thanks
It can't be done in GPower. You'll need to approximate it through computer simulations,
 
#5
Maybe I read or heard somewhere that power analysis' are often a simplification of the model that generates the data. As you start getting in the weeds with more complicated models, a power analysis for that specific model is harder to calculate. So, you do your best with what's tractable.
 

Dason

Ambassador to the humans
#6
Maybe I read or heard somewhere that power analysis' are often a simplification of the model that generates the data. As you start getting in the weeds with more complicated models, a power analysis for that specific model is harder to calculate. So, you do your best with what's tractable.
Or you just simulate
 

Dason

Ambassador to the humans
#8
It could be done in any reasonable programming language. R would be the easiest though. Basically you just need to fully write out what the data generation process looks like under your proposed alternative hypothesis and then use built in random number generators to simulate the values from those distributions and then do the analysis. One nice benefit of this approach is that the code for analyzing the data is already created after this point.

If you have specific questions we'd be more than happy to help but without specific details that's about all I can say.
 
#9
Unfortunately, I don't really have any experience in R/programming in general (beyond the basics). I ran the mixed-effects models in Jamovi - they included one continuous predictor, one categorical predictor, and two cluster variables (two random intercepts). I don't suppose there is any other way this can be done?
 

Dason

Ambassador to the humans
#10
I believe jamovi provides a mode to get the corresponding R code for any analysis. That would be a good place to start. From there it's more about generating the code for the data generating process.