PCA file calculation with "R".

December 5, 2011
By

(This article was first published on NIR-Quimiometría, and kindly contributed to R-bloggers)

X es la matriz centrada (X is the centered matrix).
Xcov es la matriz de covarianzas de X (Xcov is the covariance matrix of X).
Con la función "eigen" calculamos los "eigenvectors" y "eigenvalues" de Xcov.(With the function "eigen" we calculate the "eigenvectors" and "eigenvalues" of  Xcov).
Para hacer todo al mismo tiempo, podemos usar la función "prcomp".(To do everything at the same time we can use the function "prcomp").
La diferencia es que con eigen obtenemos la varianza y con prcomp las desviaciones estándar.
The diference is that with eigen we get the variances, and with prcomp the standard deviations.
Podemos comprobar estos resultados con el cálculo del fichero PCA de la entrada anterior.
We can compare this results with the PCA file got in Win ISI in the previous post.

To leave a comment for the author, please follow the link and comment on his blog: NIR-Quimiometría.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags:

Comments are closed.