O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A PCA example – US Arrests

As an example, here is the correlation matrix plot for US Arrests, corresponding to the number of arrests per 100,000 residents for assault, murder, and rape in each of the 50 US states in 1973. Also given is the percent of the population living in urban areas. The USArrests dataset should be loaded automatically as part of the datasets package.

You can get description of the USArrests dataset by entering the help command? USArrests dataset at the console.

To see the correlation between all of the variables, enter the following on the console line:

library(datasets) pairs(USArrests)  

The output is shown here:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required