mixError: Compute Imputation Error for Mixed-type Data

View source: R/mixError.R

mixErrorR Documentation

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

missForest

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 documentation built on April 14, 2022, 5:05 p.m.