Interpreting score plots

Let us recall what a score value is: There is one score value for each observation (row) in the data set, so there are \(n\) score values for the first component, another \(n\) score values for the second component, and so on. The score value for an observation is the point where that observation projects onto the direction vector for say the first component. Or in vector terminology it is the distance from the origin, along the direction (loading vector) of the first component, up to the point where that observation projects onto the direction vector.

An important point with PCA is that because the matrix \(\mathbf P\) is orthonormal, any relationships that were present in \(\mathbf X\) are still present in \(\mathbf Z\). Thus score plots allow us to rapidly locate similar observations, clusters, outliers and time-based patterns (Dunn 2016).

The first two score vectors, \(\mathbf Z_1\) and \(\mathbf Z_2\), explain the greatest variation in the data, hence we usually start by looking at the \(\{\mathbf Z_1, \mathbf Z_2\}\) scatter plot of the scores.

# load data from previous sections

food.pca.eigen <- eigen(cov(food.pca))
pca.loading <- food.pca.eigen$vectors[,1:2] # select the first two principal components

pca.scores <- food.pca %*% pca.loading
rownames(pca.scores) <- seq(1, nrow(pca.scores))

# Plot the scores
     xlab = expression('Z'[1]), 
     ylab = expression('Z'[2]), 
     main = 'Score plot')
abline(h = 0, col = "blue")
abline(v = 0, col = "green")

# Plot the scores as points
      col="blue", cex=0.6)

Interpreting loading plots

The loadings plot is a plot of the direction vectors that define the model. They show how the original variables contribute to creating the principal component.

loading.vector <- food.pca.eigen$vectors
rownames(loading.vector) <- colnames(food.pca)

# Plot the loading vector
     xlab = expression('p'[1]), 
     ylab = expression('p'[2]), 
     main = 'Loading plot',
     ylim = c(-1,1),
     xlim = c(-1,1))
abline(h = 0, col = "blue")
abline(v = 0, col = "green")

# Plot the loadings as points
     col="blue", cex=1.2)

Interpreting Biplots

The biplot is a very popular way for visualization of results from PCA, as it combines both the principal component scores and the loading vectors in a single biplot display.

# Correlation BiPlot <- sqrt(food.pca.eigen$values) # standardize to sd = 1
loading.vector <- food.pca.eigen$vectors
rownames(loading.vector) <- colnames(food.pca)

# Plot
     xlab = expression('p'[1]), 
     ylab = expression('p'[2]))
abline(h = 0, col = "blue")
abline(v = 0, col = "green")

# This is to make the size of the lines more apparent
factor <- 0.5

# Plot the variables as vectors
        length = 0.1,
        lwd=  2,
        angle = 20,
        col = "red")

# Plot annotations
      col = "red",
      cex = 1.2)

The plot shows the observations as points in the plane formed by two principal components (synthetic variables). Like for any scatterplot we may look for patterns, clusters, and outliers.

In addition to the observations the plot shows the original variables as vectors (arrows). They begin at the origin \([0,0]\) and extend to coordinates given by the loading vector (see loading plot above). These vectors can be interpreted in three ways (Rossiter 2014):