ce.mimp {dprep} | R Documentation

## Mean or median imputation

### Description

A function that detects location of missing values by class, then imputes the missing values that occur in the features, using mean or median imputation, as specified by the user. If the feature is nominal then a mode imputation is done.

### Usage

    ce.mimp(w.cl, method = c("mean", "median"), atr, nomatr = 0)

### Arguments

`w.cl` | dataset with missing values.
`method` | either "mean" or "median"
`atr` | list of relevant features
`nomatr` | list of nominal features, imputation is done using mode

### Value

`w.cl` | the original matrix with values imputed

### Note

A description of all the imputations carried out may be stored in a report that is later saved to the current workspace. To produce the report, lines at the end of the code must be uncommented. The report objects name starts with Imput.rep.

### Author(s)

Caroline Rodriguez and Edgar Acuna

### References

Acuna, E. and Rodriguez, C. (2004). The treatment of missing values and its effect in the classifier accuracy. In D. Banks, L. House, F.R. McMorris, P. Arabie, W. Gaul (Eds). Classification, Clustering and Data Mining Applications. Springer-Verlag Berlin-Heidelberg, 639-648.

### Examples

    data(hepatitis)
    #--------Mean Imputation----------
    ce.impute(hepatitis,"mean",1:19)

[Package dprep version 1.0 Index]