1

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)

Abby
  • 11
  • 3
  • Note that this is with the package "hmi" in R. – Abby Feb 20 '18 at 20:10
  • 1
    can you provide a reproducibleexample (https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)? This might include code to generate a small fictitious data set resembling your actual data set and quite importantly the code you used to call `hmi`. You can click on "edit" below your question to update it with more information/code. – Qaswed Feb 22 '18 at 00:05
  • 1
    Updated! Thanks @Qaswed – Abby Feb 22 '18 at 19:32
  • 1
    I ran your example and get no errors. Is it possible something else in your environment that's causing the error? – Pdubbs Feb 22 '18 at 19:46

0 Answers0