# \donttest{
#Loading the dataset
data(osteoarthritis)
#Multiply imputing the missing values
imputed.datasets <- mice::mice(osteoarthritis, m = 5)
#Matching the multiply imputed datasets
matched.datasets <- matchthem(OSP ~ AGE + SEX + BMI + RAC + SMK,
imputed.datasets,
approach = 'within',
method = 'nearest')
#Extracting the first imputed dataset
matched.dataset.1 <- complete(matched.datasets, n = 1)# }
Run the code above in your browser using DataLab