Imputing cluster-level missing data with 2L gives NAs #580
Unanswered
august-18
asked this question in
Getting started
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm cross-posting from SO to double check my approach and understanding.
https://stackoverflow.com/questions/76552891/mice-creates-nan-and-na-after-imputing-cluster-level-variable-for-clustered-data
I'm trying to impute missing values in the cluster variable itself, (called
cluster
) using2lonly.pmm
, butNA
values are being imputed for the missing values and I don't understand why.a) Do I need to specify an additional class variable (-2 in the predictor matrix) when I am trying to impute a class variable, or can I set my class variable with missing values (
cluster
) as -2 in the predictor matrix and still impute it?b) all the variables used as predictors (-1 in the matrix) need to have complete values without any missing data, correct?
meth = make.method(data) meth[c("cluster")] = "2lonly.pmm"
pm = make.predictorMatrix(data) pm[, c("id")] = 0 pm[, c("cluster")] = -2
Beta Was this translation helpful? Give feedback.
All reactions