The correlation tool is used to investigate linear relationships between variables. In this recipe, we will use the example from the Oxford weather station and check the correlation between the mean maximum temperature, mean minimum temperature, air frost days, rainfall, and hours of sunlight.
The data from the Oxford weather station can be obtained from the Met office website at http://www.metoffice.gov.uk/climate/uk/stationdata/.
Open the Oxford weather (cleaned).mtw
file. This is available on the Packt Publishing website. For more on importing this data directly, see the Producing a graphical summary of data recipe.
The following steps will generate the Pearson correlation coefficient and P-value for the results of the weather station data:
Go to Stat, click on Basic Statistics, and select Correlation….
Enter the columns for maximum temperature, minimum temperature, rainfall, and hours of sunlight into the Variables:...