imputeBasic | R Documentation |
Imputes the mean or median for continous variables; highest frequency for categorical variables.
imputeBasic(data, Init = "mean")
data |
a dataset with missing values |
Init |
For continous variables impute either the mean or median |
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.
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 |
Nelson Lee Afanador (nelson.afanador@mvdalab.com)
dat <- introNAs(iris, percent = 25) imputeBasic(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.