imputeRough {mvdalab} | R Documentation |
Naive Imputation of Missing Values for Dummy Variable Model Matrix
Description
After generating a cell means model matrix, impute expected values (mean or median for continous; hightest frequency for categorical).
Usage
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
dat <- introNAs(iris, percent = 25)
imputeRough(dat)
[Package mvdalab version 1.7 Index]