Learn R Programming

missForest (version 1.4)

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.

See Also

missForest

Examples

Run this code
# NOT RUN {
## 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
# }

Run the code above in your browser using DataLab