Learn R Programming

matchMulti (version 1.1.12.1)

handleNA: Handle Missing Values

Description

Preprocesses a dataframe of matching covariates so the Mahalanobis distance can be calculated.

Usage

handleNA(X, verbose = FALSE)

Value

a matrix containing the preprocessed data.

Arguments

X

a matrix or dataframe of covariates to be used for matching

verbose

logical value indicating whether detailed output should be provided.

Author

Luke Keele, Penn State University, ljk20@psu.edu

Sam Pimentel, University of California, Berkeley, spi@berkeley.edu

Details

Preprocessing involves three main steps: (1) converting factors to matrices of dummy variables (2) for any variable with NAs, adding an additional binary variable indicating whether it is missing (3) imputing all NAs with the column mean. This follows the recommendations of Rosenbaum in section 9.4 of the referenced text.

References

Rosenbaum, Paul R. (2010). Design of Observational Studies. Springer-Verlag.