Computing a Spearman correlation coefficient and test if it is significant or not

Dataset for Correlation Tests XLS59.0 KB

Tutorial video
  • Pro Core statistical software

  • System configuration

    • Windows:
      • Versions: 9x/Me/NT/2000/XP/Vista/Win 7
      • Excel: 97 and later
      • Processor: 32 or 64 bits
      • Hard disk: 150 Mb
    • Mac OS X:
      • OS: OS X
      • Excel: X, 2004 and 2011
      • Hard disk: 150Mb.

Benefits

  • Easy and user-friendly
    Easy and user-friendly XLSTAT is flawlessly integrated with Microsoft Excel which is the most popular spreadsheet worldwide. This integration makes it one of the simplest available tools to work with as it utilizes the same philosophy as Microsoft Excel. The program is accessible in a dedicated XLSTAT tab. The analyses are grouped into functional menus. The dialog boxes are user-friendly and setting up an analysis is straightforward.
  • Data and results shared seamlessly
    Data and results shared seamlessly One of the greatest advantages of XLSTAT is the way you can share data and results seamlessly. As the results are stored in Microsoft Excel, anyone can access them. There is no need for the receiver to have an XLSTAT license or any additional viewer which makes your team-work easier and more affordable. In addition, results are easily integrable into other Microsoft Office software such as PowerPoint, so that you can create striking presentation in minutes.
  • Modular
    Modular XLSTAT is a modular product. XLSTAT-Pro is a core statistical module of XLSTAT which includes all the mainstream functionalities in statistics and multivariate analysis. More advanced features contained in add-on modules can be added for specific applications. This way you can adapt the software to your needs making the software more cost-efficient.
  • Didactic
    Didactic The results of XLSTAT are organized by analysis and are easy to navigate. Moreover useful information is provided along with the results to assist you in your interpretation.
  • Affordable
    Affordable XLSTAT is a complete and modular analytical solution that can suit any analytical business needs. It is very reasonably priced so that the return of your investment is almost immediate. Any XLSTAT license comes with top level support and assistance.
  • Accessible - Available in many languages
    Accessible - Available in many languages We have ensured XLSTAT is accessible to everyone by making the program available in many languages, including Chinese, English, French, German, Italian, Japanese, Polish, Portuguese and Spanish.
  • Automatable and customizable
    Automatable and customizable Most of the statistical functions available in XLSTAT can be called directly from the Visual Basic window of Microsoft Excel. They can be modified and integrated to more code to fit to the specificity of your domain. Adding tables and plots as well as modifying existing outputs becomes easy. Furthermore, XLSTAT includes some special tools on the dialog boxes to generate automatically the VBA code in order to reproduce your analysis using the VBA editor or to simply load pre-set settings. This effortless automation of routine analysis will be a huge time saver on your part.

Dataset to run a Spearman correlation coefficient test

An Excel sheet containing both the data and the results for use in this tutorial can be downloaded by clicking here.

The data used in this example correspond to a survey where a given brand/type of potato chips has been evaluated by 100 consumers. Each consumer gave a rating on 1 to 5 scale for four attributes (Saltiness, Sweetness, Acidity, Crunchiness) - 1 means "little", and 5 "a lot" -, and then gave an overall liking score on a 1-10 likert scale. Our goal is to check how the attributes are correlated with the liking score.

Correlations are computed in many of the XLSTAT features. However two functions are dedicated to that: the Describing data / Similarity/Dissimilarity matrices feature, and the Correlation/Association tests / Correlation tests feature. In this tutorial, we use the Correlation/Association tests / Correlation tests tool.

Setting up a Spearman correlation coefficient test

After opening XLSTAT, select the Correlation/Association tests / Correlation tests command, or click on the corresponding button of the Correlation/Association tests toolbar (see below).

barcorrsp.gif

Once you've clicked on the button, the dialog box appears. We select the liking scores and the four attributes in the Observations/Variables box. As the first row of the table corresponds to headers, we leave the Variable labels option checked.

Because the data are not continuous but ordinal, we choose to use the Spearman correlation coefficient instead of the Pearson correlation coefficient which is the usual one for continuous data.

corrsp1.gif

In the Outputs tab, we choose the results we want to display.

corrsp2.gif

In the Charts tab, we select the correlations maps we want to display.

corrsp3.gif

The computations begin once you have clicked on OK. The results will then be displayed.

Interpreting the results of a Spearman correlation coefficient test

The first results are the descriptive statistics for the liking data and the attributes. The correlations matrix is then displayed.

corrsp4.gif

The correlations between the liking scores and the attributes are mostly low. The correlation between the liking scores and the Crunchiness is higher than average with 0.466. This suggests that the only criterion for which we have "the more, the better" is the crunchiness. For the other criteria it is likely that there is an intermediate optimal level, above which the consumers will show their insatisfaction.

Values displayed in bold are significant at 0.05 significance level. That means that the risk of being wrong when rejecting the null hypothesis that the correlations are not significantly different from 0 is less than 5%.

The corresponding p-values (the estimated risk) are displayed in the next table. The lower the p-value, the more different from 0 the correlation. Note: the tests are two-sided.

corrsp5.gif

XLSTAT is among the few software that generates correlation maps. Correlation maps allow to visually identify patterns in correlations. While this has more meaning when there are many dimensions, we take advantage of this example to show how the maps can be used.

The first correlation map uses a blue-red (cold-hot) scale to display the correlations. The blue color corresponds to a correlation close to -1 and the red color corresponds to a correlation close to 1. Green corresponds to a correlation close to 0.

corrsp6.gif

The second correlation map uses black and white to respectively identify positive and negative correlations. The diagonal is displayed in grey color.

corrsp7.gif

The third correlation map uses patterns to identify both the sign and the intensity of the correlations:

  • lines that go from the bottom left to the top right correspond to positive correlations, and vice versa;
  • the tighter the lines, the closer the correlation to 0.

corrsp8.gif

Note: if you only want to compute the correlation coefficient between two samples, you can use directly in the Excel sheet the XLSTAT XLSTAT_Spearman function. Example: on the "Data" sheet, type in the G2 cell, "=XLSTAT_Spearman(A2:A101,B2:B101)".