Application of Linear Algebra
Application of Linear Algebra
Freeman Chen
11/16/2021
R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring
HTML, PDF, and MS Word documents. For more details on using R Markdown see
http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as
well as the output of any embedded R code chunks within the document. You can embed an
R code chunk like this:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
library(devtools)
#install_github("vqv/ggbiplot")
library(ggbiplot)
#install.packages("factoextra")
library(factoextra)
##perfroman PCA
pca.fit <- prcomp(data, center = TRUE, scale=TRUE)
summary(pca.fit)
## Importance of components:
## PC1 PC2 PC3 PC4 PC5 PC6
PC7
## Standard deviation 1.8102 1.3196 1.1844 0.95432 0.88665 0.82298
0.6760
## Proportion of Variance 0.3277 0.1741 0.1403 0.09107 0.07861 0.06773
0.0457
## Cumulative Proportion 0.3277 0.5018 0.6421 0.73314 0.81176 0.87949
0.9252
## PC8 PC9 PC10
## Standard deviation 0.54742 0.49014 0.45629
## Proportion of Variance 0.02997 0.02402 0.02082
## Cumulative Proportion 0.95516 0.97918 1.00000