## Principal Components Analysis Shiny App

I’ve recently started experimenting with making Shiny apps, and today I wanted to make a basic app for calculating and visualizing principal components analysis (PCA). Here is the basic interface I came up with. Test drive the app for yourself or check out the the R code HERE.

library(shiny) runGist("5846650")

Above is an example of the user interface which consists of data upload (from.csv for now), and options for conducting PCA using the pcaMethods package. The various outputs include visualization of the eigenvalues and cross-validated eigenvalues (q2), which are helpful for selecting the optimal number of model components.The PCA scores plot can be used to evaluate extreme (leverage) or moderate (DmodX) outliers. A Hotelling’s T-squared confidence intervals as an ellipse would also be a good addition for this.

The variable loadings can be used to evaluate the effects of data scaling and other pre-treatments.

The next step is to interface the calculation of PCA to a dynamic plot which can be used to map meta data to plotting characteristics.

KyrstanThis app looks amazing, however, when I tried to use it an error message flashed saying that the devium.pca was missing. Has this been corrected and not updated?

January 19, 2015 at 7:47 pm

dgrapovThere is a more current PCA app to use. Try DeviumWeb (https://github.com/dgrapov/DeviumWeb), which includes an updated PCA analysis module (see Projection).

January 19, 2015 at 9:32 pm