Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mixError

Compute Imputation Error for Mixed-type Data


Description

'mixError' is used to calculate the imputation error particularly in the case of mixed-type data. Given the complete data matrix and the data matrix containing the missing values the normalized root mean squared error for the continuous and the proportion of falsely classified entries for the categorical variables are computed.

Usage

mixError(ximp, xmis, xtrue)

Arguments

ximp

imputed data matrix with variables in the columns and observations in the rows. Note there should not be any missing values.

xmis

data matrix with missing values.

xtrue

complete data matrix. Note there should not be any missing values.

Value

imputation error. In case of continuous variables only this is the normalized root mean squared error (NRMSE, see 'help(missForest)' for further details). In case of categorical variables onlty this is the proportion of falsely classified entries (PFC). In case of mixed-type variables both error measures are supplied.

Note

This function is internally used by missForest whenever a complete data matrix is supplied.

Author(s)

Daniel J. Stekhoven, <stekhoven@stat.math.ethz.ch>

See Also

Examples

## Compute imputation error for mixed-type data:
data(iris)

## Artificially produce missing values using the 'prodNA' function:
set.seed(81)
iris.mis <- prodNA(iris, noNA = 0.2)

## Impute missing values using 'missForest':
iris.imp <- missForest(iris.mis)

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

missForest

Nonparametric Missing Value Imputation using Random Forest

v1.4
GPL (>= 2)
Authors
Daniel J. Stekhoven <stekhoven@stat.math.ethz.ch>
Initial release
2013-12-31

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.