Pearson, Spearman and Kendall Correlation Coefficients, by Hand | by Antoine Soetewey | Sep, 2023

In statistics, a correlation is used to evaluate the relationship between two variables.

In a previous post, we showed how to compute a correlation and perform a correlation test in R. In this post, we illustrate how to compute the Pearson, Spearman, and Kendall correlation coefficients by hand and under two different scenarios (i.e., with and without ties).

To illustrate the methods with and without ties, we consider two different datasets, one with ties and another without ties.

For the illustrations of the scenarios with ties, suppose we have the following sample of size 5:

Table by author
Plot by author

As we can see, there are some ties since there are two identical observations in the variable x.

For the scenarios which require no ties, we will consider the following sample of size 3:

Plot by author

The three most common correlation methods are:1

  1. Pearson, used for two quantitative continuous variables which have a linear relationship
  2. Spearman, used for two quantitative variables if the link is partially linear, or for one qualitative ordinal variable and one quantitative variable
  3. Kendall, often used for two qualitative ordinal variables

Source link

This post originally appeared on TechToday.