mixError: Compute Imputation Error for Mixed-type Data

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/mixError.R

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

1
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, <[email protected]>

See Also

missForest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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

Example output

Loading required package: randomForest
randomForest 4.6-14
Type rfNews() to see new features/changes/bug fixes.
Loading required package: foreach
Loading required package: itertools
Loading required package: iterators
  missForest iteration 1 in progress...done!
  missForest iteration 2 in progress...done!
  missForest iteration 3 in progress...done!
  missForest iteration 4 in progress...done!
  missForest iteration 5 in progress...done!
  missForest iteration 6 in progress...done!
  missForest iteration 7 in progress...done!
  missForest iteration 8 in progress...done!
     NRMSE        PFC 
0.15718871 0.03571429 

missForest documentation built on May 1, 2019, 8 p.m.