Hi,
If center=T (by default) in invoking prcomp, that is, prcomp (x) where x is a
matrix with the observations are in rows and the variables are in column, is
this equivalent to scale(t(x),center=T,scale=F) where x is a matrix with the
observations are in rows and the variables are in columns?
Additionally, could you advise when the variables should mean centered (center
= T in prcomp) before the application of PCA? According to the documentation of
prcomp, the variables and I assume not the observations are mean-centered if
center = T.
I have a discrete data containing 0, 1 and 2. Should I mean center the
variables (center = T in prcomp)? See the histogram in attachment. When I don't
mean center, the first PC captures 91% of variability. and when I mean center,
the first PC captures 1% of variability, see the proportion of variation:
non-mean centered variables:
PC1 PC2 PC3
Standard deviation 259.42437 11.12854 6.865225
Proportion of Variance 0.91282 0.00168 0.000640
Cumulative Proportion 0.91282 0.91450 0.915140
mean-centered variables:
PC1 PC2 PC3
Standard deviation 11.30053 6.870346 5.64987
Proportion of Variance 0.01985 0.007340 0.00496
Cumulative Proportion 0.01985 0.027190 0.03215
Thanks in advance,
Carol
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.