# Does anyone know how to conduct power analysis and estimate sample size for a mixed model cross-level interaction?

I am planning for a rather simple mixed design study. I have one within-subject factor (2-level, repeatedly measure/treatment twice) and one continuous between-subject factor. Now I am interested in potential interaction between the two. I wonder if there is any software or R-code that I can use to estimate the required sample size (i.e. level-2 sample size)?

If you repeat these steps a sufficient number of times (e.g., 1000), you can obtain an estimate of the power for this specific design by simply calculating the proportion of times the p-value was significant at a pre-specified significance level $$\alpha$$. Then, you could change some of the settings of the design, e.g., increase the number of subjects and see how does this affect the power.