问题
I want to perform multiple imputation for a set of variables using the MICE package in R.
# Example data
data <- data.frame(
gcs = c(3, 10, NA, NA, NA, 15, 14, 15, 15, 14, 15, NA, 13, 15, 15),
hf = c(50, 66, 78, 99, NA, NA, 56, 55, NA, 76, 98, 105, NA, NA, 65),
...
)
The minimum for gcs
is 3 and the maximum is 15, and it may not be a fractional number, how can I set these constraints in MICE? Same goes for hf
, but this one only has a bottom limit of 0.
来源:https://stackoverflow.com/questions/36811650/simple-restrictions-constraint-for-multiple-imputation-mice-in-r