# NOT RUN {
#Loading the 'dt.osa' and 'dt.osp' datasets
data(dt.osa)
data(dt.osp)
#Imputing missing data points in the'dt.osa' dataset
datasets <- mice(dt.osa, m = 5, maxit = 1,
method = c("", "", "mean", "", "polyreg", "logreg", "logreg"))
#Matching the imputed datasets, 'datasets'
matcheddatasets <- matchitmice(KOA ~ SEX + AGE + SMK, datasets,
approach = 'within', method = 'exact')
#Merging the dataframe, 'dt.osp', with each imputed dataset of the 'matcheddatasets' object
matcheddatasets <- mergeitmice(matcheddatasets, dt.osp, by = "IDN")
#Analyzing the imputed datasets
models <- with(data = matcheddatasets,
exp = glm(KOA ~ PTH,
na.action = na.omit, family = binomial))
#Printing pooled results
results <- pool(models)
# }
Run the code above in your browser using DataLab