I'm looking for ways to estimate the sample size for a within-subject repeated measures design with continuous moderators. There are two conditions with 5 stimuli per condition, and each participant sees all of them. Analytic strategy will be a linear mixed model (using the lme4 package in R).
First I need a simple method, based on an effect size estimate. I've tried the smpsize_lmm function from the sjstats package, but I'm unsure whether it can be applied to my case. https://strengejacke.github.io/sjstats/reference/samplesize_mixed.html
samplesize_mixed(eff.size = .5, df.n = 5, k = 2, power = .8)
Is this appropriate for a fully within-design? k is for the number of level-2 clusters, but since all participants are completing all conditions there are no level-2 clusters in my case (or am I getting this wrong?) ... I still entered 2 here for the number of conditions, as the formula doesn't work with df.n = 10 and k = 1. Could someone tell me if I can use this for my case, or point me towards a more appropriate but ideally equally straightforward method for my design?
EDIT: some clarification/additional information:
By continuous moderator I mean that these are metric variables, not categorical variables. Moderators are at subject level and I'm mainly interested in the interaction between the moderators and the condition, expecting a hybrid interaction.
This is the model I'm planning to run:
model <-lmer(dv~ 1 + (1|subject) + m1*cond + m2*cond, data, na.action = na.omit)
lmer
orlme
model you plan to run? There are no simple ways to calculate power for this design. You will need to use simulation. Check outsimglm
andsimr
. cran.r-project.org/web/packages/simglm/vignettes/… humburg.github.io/Power-Analysis/simr_power_analysis.html $\endgroup$