imputeEM | R Documentation |
Missing values are iterarively updated via an EM algorithm.
imputeEM(data, impute.ncomps = 2, pca.ncomps = 2, CV = TRUE, Init = "mean", scale = TRUE, iters = 25, tol = .Machine$double.eps^0.25)
data |
a dataset with missing values. |
impute.ncomps |
integer corresponding to the minimum number of components to test. |
pca.ncomps |
minimum number of components to use in the imputation. |
CV |
Use cross-validation in determining the optimal number of components to retain for the final imputation. |
Init |
For continous variables impute either the mean or median. |
scale |
Scale variables to unit variance. |
iters |
For continous variables impute either the mean or median. |
tol |
the threshold for assessing convergence. |
A completed data frame is returned that mirrors a model.matrix
. NAs
are replaced with convergence values as obtained via EM. If object contains no NAs
, it is returned unaltered.
imputeEM
returns a list containing the following components:
Imputed.DataFrames |
A list of imputed data frames across |
Imputed.Continous |
A list of imputed values, at each EM iteration, across |
CV.Results |
Cross-validation results across |
ncomps |
|
Nelson Lee Afanador (nelson.afanador@mvdalab.com), Thanh Tran (thanh.tran@mvdalab.com)
B. Walczak, D.L. Massart. Dealing with missing data, Part I. Chemom. Intell. Lab. Syst. 58 (2001); 15:27
dat <- introNAs(iris, percent = 25) imputeEM(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.