Imputes the mean of within the class
mice.impute.2lonly.mean(y, ry, x, type, ...)
Incomplete data vector of length n
Vector of missing data pattern (FALSE
=missing,
TRUE
=observed)
Matrix (n
x p
) of complete covariates.
Vector of length ncol(x)
identifying random and class
variables. The class variable (only one is allowed) is coded as '-2'.
Other named arguments.
A vector of length nmis
with imputations.
Observed values in y
are averaged within the class, and replicated to
the missing y
within that class. If there are no observed data in the
class, all entries of the class are set to NaN
. This function is
primarily useful for repairing incomplete data that are constant within the
class, but that vary over the classes.