Naive Imputation of Missing Values for Dummy Variable Model Matrix

Share:

Description

After generating a cell means model matrix, impute expected values (mean or median for continous; hightest frequency for categorical).

Usage

1
imputeRough(data, Init = "mean")

Arguments

data

a dataset with missing values

Init

For continous variables impute either the mean or median

Details

A completed data frame is returned that mirrors a model.matrix. NAs are replaced with column means or medians. If object contains no NAs, it is returned unaltered. This is the starting point for imputeEM.

Value

imputeRough returns a list containing the following components:

Initials

Imputed values

Pre.Imputed

Pre-imputed data frame

Imputed.Dataframe

Imputed data frame

Author(s)

Nelson Lee Afanador (nelson.afanador@mvdalab.com)

Examples

1
2
dat <- introNAs(iris, percent = 25)
imputeRough(dat)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.