Learn R Programming

missForest (version 1.6.1)

mixError: Compute Imputation Error for Mixed-type Data

Description

mixError computes imputation error for mixed-type data given the imputed matrix (ximp), the original matrix with missing values (xmis), and the complete ground truth (xtrue). It reports the normalized root mean squared error (NRMSE) for numeric variables and the proportion of falsely classified entries (PFC) for factor variables.

Usage

mixError(ximp, xmis, xtrue)

Value

A named vector with the imputation error(s):

  • NRMSE: normalized root mean squared error computed over the numeric entries that were missing in xmis.

  • PFC: proportion of falsely classified entries computed over the factor entries that were missing in xmis.

If only one type (numeric or factor) is present among the missing entries, only the corresponding error is returned.

Arguments

ximp

Imputed data matrix (or data frame) with variables in columns and observations in rows. There must be no missing values.

xmis

Data matrix (or data frame) with missing values used to derive the missingness pattern.

xtrue

Complete data matrix (or data frame) containing the true values. There must be no missing values.

Author

tools:::Rd_package_author("missForest")

References

StekhovenBuehlmann2012missForest

For the NRMSE notion in imputation benchmarking: Oba2003missForest

See Also

missForest, nrmse

Examples

Run this code
## Mixed-type error computation on iris:
data(iris)

## Introduce missingness:
set.seed(81)
iris.mis <- prodNA(iris, noNA = 0.2)

## Impute:
iris.imp <- missForest(iris.mis)

## Compute the true imputation error:
err.imp <- mixError(iris.imp$ximp, iris.mis, iris)
err.imp

Run the code above in your browser using DataLab