binditmice: Binds Imputed Datasets and Dataframes

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/binditmice.R

Description

The binditmice() function binds a dataframe to each imputed dataset of the mids, mimids, or wimids class objects in a row-wise fashion.

Usage

1

Arguments

datasets

This argument specifies an object of the mids, mimids, or wimids class.

data

This argument specifies a dataframe.

Details

This functions can be used instead of the cbind() function (from the mice package).

Value

This function returns an object of the mids, mimids, or wimids class after binding a dataframe to each imputed dataset of the inputted object.

Author(s)

Farhad Pishgar

References

Stef van Buuren and Karin Groothuis-Oudshoorn (2011). mice: Multivariate Imputation by Chained Equations in R. Journal of Statistical Software, 45(3): 1-67. https://www.jstatsoft.org/v45/i03/

See Also

matchitmice

weightitmice

mergeitmice

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#Loading the dataset
data(dataset)

#Multiply imputing the missing values
imputed.datasets <- mice(dataset, m = 5, maxit = 10,
                         method = c("", "", "", "mean", "polyreg", "logreg", "logreg", "logreg"))

#Matching the multiply imputed datasets
matched.datasets <- matchitmice(OSP ~ AGE + SEX + BMI + RAC + SMK, imputed.datasets,
                                approach = 'within', method = 'nearest')

#Binding a dataframe to imputed datasets of the 'matched.datasets'
matched.datasets <- binditmice(matched.datasets, data)

FarhadPishgar/MatchIt.mice documentation built on Sept. 18, 2019, 11:52 a.m.