library(tidyr)
library(dplyr)
data("toenail2")
data <- tidyr::complete(toenail2, patientID, visit) %>%
tidyr::fill(treatment) %>%
dplyr::select(-time) %>%
dplyr::mutate(patientID = as.integer(patientID))
if (FALSE) {
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