hredestig / pcaMethods

Perform PCA on data with missing values in R
GNU General Public License v2.0
45 stars 10 forks source link

Why is the number of observations ( number of rows) in nlpca score matrix different from the number of observations from the original data? #11

Closed h56cho closed 4 years ago

h56cho commented 4 years ago

Hello,

I am trying to apply nlpca to my dataset, below are my code:

# principal component analysis to determine important predictors
pr.out = pca(na.omit(combined_num[,-c(1)]),  nPcs=15, method="nlpca", maxSteps = 6000)

dat = data.frame(pr.out@scores)
dim(dat)
>>[1] 2955   15

dim(combined_num)[1]
>>[1] 39325

from the output above, the number of observations contained in the scores function is 2955, whereas the number of observations contained in the original dataset is 39325; what is causing this mismatch? is this possibly because I specified maxSteps to be too small?

Thank you,