imputePCA(X, ncp = 2, scale = TRUE, method = c("Regularized","EM"), row.w = NULL, coeff.ridge = 1, threshold = 1e-06, seed = NULL, nb.init = 1,
maxiter = 1000, ...)We advice to use the regularized version of the algorithm to avoid the overfitting problems which are very frequent when there are many missing values. In the regularized algorithm, the singular values of the PCA are shrinked.
The output of the algorithm can be used as an input of the PCA function of the FactoMineR package in order to perform PCA on an incomplete dataset.
estim_ncpPCA, MIPCA,
Video showing how to perform PCA on an incomplete dataset## Not run:
# data(orange)
# ## First the number of components has to be chosen
# ## (for the imputation step)
# ## nb <- estim_ncpPCA(orange,ncp.max=5) ## Time consuming, nb = 2
#
# ## Imputation
# res.comp <- imputePCA(orange,ncp=2)
#
# ## A PCA can be performed on the imputed data
# res.pca <- PCA(res.comp$completeObs)
# ## End(Not run)
Run the code above in your browser using DataLab