Hello,
I am creating a principal component analysis (PCA). A few variables in my table are 0. When I run the PCA, I get the message "Missing values are imputed by the mean of the variable: you should use the imputePCA function of the missMDA package"
After installing the missMDA package, I followed the instructions in the missMDA guide and copied the following code (my data is "ACP"):
ncomp <- estim_ncpPCA(ACP)
res.imp <- imputePCA(ACP, ncp = ncomp$ncp)
res.comp <- MIPCA(ACP, ncp = ncomp$ncp, nboot = 1000)
plot(res.comp)
This is the error I get:
ncomp <- estim_ncpPCA(ACP)
Error: $ operator is invalid for atomic vectors
I found an explanation on a forum that the code is not applicable to a vector and that it can be used only for recursive data.
When I test > is.recursive(ACP), I get "true" so the issue seems to come from somewhere else.
Still I converted my date into a data frame as follows
ACP <- as.data.frame(ACP)
res.imp <- imputePCA(ACP, ncp = ncomp$ncp)
Error in imputePCA(ACP, ncp = ncomp$ncp) :
could not find function "imputePCA"
It is still not working.
How can I fix this issue???