Finding correlation between multiple variables

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.

Getting ready

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.

How to do it…

The following steps will generate the Pearson correlation coefficient and P-value for the results of the weather station data:

  1. Go to Stat, click on Basic Statistics, and select Correlation….
  2. Enter the columns for maximum temperature, minimum temperature, rainfall, and hours of sunlight into the Variables: section.
  3. Click on OK.

How it works…

The output generates a table that compares all of the variables to one another. The top number is the correlation score and the lower number the P-value. Correlation scores range from -1 to +1, and a score of 0 indicates no correlation. The null hypothesis for this test is that there is no correlation; the alternative is that there is correlation. Strong correlations should be seen between the temperature columns and hours of sunlight.

There's more…

With a lot of variables, the correlation table can often be wider than the page width of the session window. The results are then displayed across multiple output tables. The session window's output width can be changed in Options… under the Tools menu.

Correlations can also be visualized very quickly using a matrix plot. This chart will plot a scatterplot of each variable versus one another.

Spearman Rank correlation is also available in Minitab v17 by changing the Method: option to Spearman rho.

See also

  • The Producing a graphical summary of data recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.17.18