imputeBasic {mvdalab} | R Documentation |
Naive imputation of missing values.
Description
Imputes the mean or median for continous variables; highest frequency for categorical variables.
Usage
imputeBasic(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. For numeric variables, NAs
are replaced with column means or medians. For categorical variables, NAs
are replaced with the most frequent levels. If object contains no NAs
, it is returned unaltered.
Value
imputeBasic
returns a list containing the following components:
Imputed.DataFrame |
Final imputed data frame |
Imputed.Missing.Continous |
Imputed continous values |
Imputed.Missing.Factors |
Imputed categorical values |
Author(s)
Nelson Lee Afanador (nelson.afanador@mvdalab.com)
Examples
dat <- introNAs(iris, percent = 25)
imputeBasic(dat)
[Package mvdalab version 1.7 Index]