#Loading the dataset
data(osteoarthritis)
#Multiply imputing the missing values
imputed.datasets <- mice::mice(osteoarthritis, m = 5,
printFlag = FALSE)
#Matching the multiply imputed datasets manually
match.list <- lapply(1:5, function(i) {
MatchIt::matchit(OSP ~ AGE + SEX + BMI + RAC + SMK,
mice::complete(imputed.datasets, i),
method = 'nearest')
})
#Creating mimids object
matched.datasets <- as.mimids(match.list,
imputed.datasets)
Run the code above in your browser using DataLab