Trying to fit a two-level imputation model with HMI (hierch. multiple imputation)...
The model I'm using is this (I want random intercept ONLY):
glmer(pica_yn ~ 1 + visit_c+visit_c2 + geo_child + hhloc + diar_c + hemo_c + (1|pid))
I keep getting this error:
Error in buildZ(rmodel.terms[r], data = data, nginverse = names(ginverse)): object id not found
It seems as though HMI prefers the specified formula also has a random slope.
Has anyone fit a multilevel imputation model for a BINARY response?
Here is an example you can run that will get the same error:
data("sleepstudy", package="lme4")
sleepstudy[sample(1:nrow(sleepstudy), size = 20), "Reaction"] <- NA
sleep_formula<-Reaction ~ Days + (1|Subject)
hmi_imp <- hmi(data = sleepstudy, model_formula = sleep_formula, M = 5, maxit = 1)