mice (version 1.14)

complete: Produces Imputed Flat Files from Multiply Imputed Data Set (mids)

Description

Takes an object of type mids, fills in the missing data, and returns the completed data in a specified format.

Usage

complete(x, action=1)

Arguments

x
An object of class 'mids' (created by the function mice()).
action
If action is a scalar between 1 and x$m, the function returns the data with the action's imputation filled in. Thus, action=1 returns the first completed data set. The can also be one of the following

Value

  • A data frame with the imputed values filled in.

References

Van Buuren, S. & Oudshoorn, C.G.M. (2000). Multivariate Imputation by Chained Equations: MICE V1.0 User's manual. Report PG/VGZ/00.038, TNO Prevention and Health, Leiden.

See Also

mice, mids

Examples

Run this code
data(nhanes)
imp <- mice(nhanes)     # do default multiple imputation on a numeric matrix
mat <- complete(imp)    # fills in the first imputation
mat <- complete(imp, 3) # fills in the third imputation
mat <- complete(imp, "long") # produces a long matrix with stacked complete data
mat <- complete(imp, "b") # a broad matrix
cor(mat)                # for numeric mat, produces a blocked correlation matrix, where
            # each m*m block contains of the same variable pair over different
            # multiple imputations.

Run the code above in your browser using DataLab