# Sample size for multilevel model with 30 cluster groups and a small to
# medium effect size (Cohen's d) of 0.3. 29 subjects per cluster and
# hence a total sample size of about 859 observations is needed.
smpsize_lmm(eff.size = .3, k = 30)
# Sample size for multilevel model with 20 cluster groups and a medium
# to large effect size for linear models of 0.2. Nine subjects per cluster and
# hence a total sample size of about 172 observations is needed.
smpsize_lmm(eff.size = .2, df.n = 5, k = 20, power = .9)
Run the code above in your browser using DataLab