center: logical, do centering of data values or not.
scale: logical, do standardization of data values or not.
maxncomp: maximum number of components in PCA model.
expvarlim: minimum amount of variance, explained by chosen components (used for selection of optimal number of components in PCA models).
covlim: convergence criterion.
maxiter: maximum number of iterations if convergence criterion is not met.
Returns
Returns the same matrix x where missing values are replaced with approximated.
Details
The function uses iterative PCA modeling of the data to approximate and impute missing values. The result is most optimal for data sets with low or moderate level of noise and with number of missing values less than 10% for small dataset and up to 20% for large data.
Examples
library(mdatools)## A very simple example of imputing missing values in a data with no noise# generate a matrix with valuess =1:6odata = cbind(s,2*s,4*s)# make a matrix with missing valuesmdata = odata
mdata[5,2]= mdata[2,3]=NA# replace missing values with approximatedrdata = pca.mvreplace(mdata, scale =TRUE)# show all matrices togethershow(cbind(odata, mdata, round(rdata,2)))
References
Philip R.C. Nelson, Paul A. Taylor, John F. MacGregor. Missing data methods in PCA and PLS: Score calculations with incomplete observations. Chemometrics and Intelligent Laboratory Systems, 35 (1), 1996.