Description Usage Arguments See Also Examples
Generate a plot of 10 first variances of Principal Components. This is useful to determinate which are the most important components.
1 | elbowPlot(data.pca)
|
data.pca |
a list with class "prcomp" containing all principal components calculated. |
CalculateVariance, plotPC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #Example 1
iris.x <- iris[,1:4] # These are the independent variables
# We know that there are no missing values in the data set
# performing prcomp
ir.pca <- prcomp(iris.x, center = TRUE, scale. = TRUE)
# Generating elbow plot to detect the most important principal components
elbowPlot(ir.pca)
#Example 2
# Getting a clean data set (without missing values)
cars <- read.csv("https://dl.dropboxusercontent.com/u/12599702/autosclean.csv", sep = ";", dec = ",")
cars.x <- cars[,1:16] # These are the independent variables
# Performing prcomp
cars.pca <- prcomp(cars.x, center = TRUE, scale. = TRUE)
# Generating elbow plot to detect the most important principal components
elbowPlot(cars.pca)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.