imp <- mice(nhanes, m = 2, maxit = 1, print = FALSE)
# example with external logical vector
imp_f <- filter(imp, c(rep(TRUE, 13), rep(FALSE, 12)))
nrow(complete(imp))
nrow(complete(imp_f))
# example with calculated include vector
imp_f2 <- filter(imp, age >= 2 & hyp == 1)
nrow(complete(imp_f2)) # should be 5
Run the code above in your browser using DataLab