I have an experimental design for a GLMM as follows:
- independent variable: fixed factor with 3 levels, randomly assigned between groups (condition a, condition b, condition c)
- dependent variable: repeated measures over 4 trials with a dichotomous outcome (0,1) in each trial (trial 1, trial 2, trial 3, trial 4)
- covariates: age (continuous), order (for counterbalancing; order 1, order 2)
- participant ID (as random effects factor)
Similar studies (using t-tests or similar) have previously found an effect of around d = 0.6
I am struggling to understand how to calculate the sample size I need a priori. I have seen there are some packages available (e.g., simr, longpower, powerlmm, simglm), however, I think because I am in general a bit inexperienced with GLMMs I am having some difficulties in applying them to my example. I understand that I first need to create a simulated dataset, but I am not sure how to go about this.
I read through the following questions: Sample size calculation for mixed models
How can you compute sample size for a linear mixed model? G*Power only does repeated measures ANOVA
A priori power analysis for generalized linear mixed-effects model
Mixed effects model for power analysis to aid study design
I also tried following this tutorial but got stuck conceptually on how to create simulated data.
Could somebody point me in the right direction for how I could go about calculating power for this example?