PCA - Cor - Outlier R |
Top Previous Next |
Having completed a Principal Component Analysis (PCA) it is sometimes useful to consider if any of the observations are significantly different from the others. For example, in the PCA plot below Hinkley fish data for 1982 and 2002 seem to be notably different from other years. This R code undertakes an outlier analysis using the correlation values between the variables. The Mahalanobis distance is used. The default calculations are undertaken using the two largest principal components. This can be changed - see image below.
The following image shows the output - note that 1982 and 2002 are indeed significantly different from the other years.
|