# NOT RUN {
library(tidyr)
library(dplyr)
data("toenail", package = "HSAUR3")
data <- tidyr::complete(toenail, patientID, visit) %>%
tidyr::fill(treatment) %>%
dplyr::select(-time) %>%
dplyr::mutate(patientID = as.integer(patientID))
# }
# NOT RUN {
pred <- mice(data, print = FALSE, maxit = 0, seed = 1)$pred
pred["outcome", "patientID"] <- -2
imp <- mice(data, method = "2l.bin", pred = pred, maxit = 1, m = 1, seed = 1)
# }
Run the code above in your browser using DataLab