as.mimids | R Documentation |
mimids
objectCreates a mimids
object from a list of matchit
objects and an imputed dataset.
as.mimids(x, ...)
## Default S3 method:
as.mimids(x, datasets, ...)
x |
A list of |
... |
Ignored. |
datasets |
This argument specifies the datasets containing the exposure and the potential confounders called in the |
The matched datasets are stored as though matchthem()
was called with approach = "within"
.
A mimids
object.
matchthem()
, mimids
, MatchIt::matchit()
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.