miceadds icon indicating copy to clipboard operation
miceadds copied to clipboard

Possible error in example for ml.lmer documentation

Open jmgirard opened this issue 1 year ago • 0 comments

When specifying the random slope for x1, it will cross-classify by id2 and id3 with the current code. To make it nested (as in a three-level model), I believe it needs to be id2:id3.

Current:

#----- specify random slopes
random_slopes <- list()
#** random slopes for variable x1
random_slopes[["x1"]] <- list( "id2"=c("x2"), "id3"=c("y1") )
# if no random slopes should be specified, the corresponding entry can be left empty
# and only a random intercept is used in the imputation model

Suggested:

#----- specify random slopes
random_slopes <- list()
#** random slopes for variable x1
random_slopes[["x1"]] <- list( "id2:id3"=c("x2"), "id3"=c("y1") )
# if no random slopes should be specified, the corresponding entry can be left empty
# and only a random intercept is used in the imputation model

jmgirard avatar Mar 21 '23 16:03 jmgirard