Learn R Programming

mice (version 3.15.0)

mice.impute.sample: Imputation by simple random sampling

Description

Imputes a random sample from the observed y data

Usage

mice.impute.sample(y, ry, x = NULL, wy = NULL, ...)

Value

Vector with imputed data, same type as y, and of length sum(wy)

Arguments

y

Vector to be imputed

ry

Logical vector of length length(y) indicating the the subset y[ry] of elements in y to which the imputation model is fitted. The ry generally distinguishes the observed (TRUE) and missing values (FALSE) in y.

x

Numeric design matrix with length(y) rows with predictors for y. Matrix x may have no missing values.

wy

Logical vector of length length(y). A TRUE value indicates locations in y for which imputations are created.

...

Other named arguments.

Author

Stef van Buuren, Karin Groothuis-Oudshoorn, 2000, 2017

Details

This function takes a simple random sample from the observed values in y, and returns these as imputations.

References

van Buuren S and Groothuis-Oudshoorn K (2011). mice: Multivariate Imputation by Chained Equations in R. Journal of Statistical Software, 45(3), 1-67. tools:::Rd_expr_doi("10.18637/jss.v045.i03")