rpsychologist / powerlmm

powerlmm R package for power calculations for two- and three-level longitudinal multilevel/linear mixed models.
100 stars 12 forks source link

simulate: satterthwaite dfs give error when time:treatment is omitted #7

Open rpsychologist opened 6 years ago

rpsychologist commented 6 years ago

The following model will fail:

p <- study_parameters(n1 = 5, 
                     n2 = 5, 
                     icc_pre_subject = 0.5)

f <- "y ~ 1 + time + (1 | subject)"

res <- simulate(object = p,
        nsim = 10,
        formula = f,
        satterthwaite = TRUE)

Even though it is a custom model, it is probably a good idea to support this type of custom use.

Would need to update:

Before this is supported it would be better to give a more informative error message.