In statistics, a correlation is used to guage the connection between two variables.
In a previous post, we showed easy methods to compute a correlation and perform a correlation test in R. On this post, we illustrate easy methods to compute the Pearson, Spearman, and Kendall correlation coefficients by hand and under two different scenarios (i.e., with and without ties).
For instance the methods with and without ties, we consider two different datasets, one with ties and one other without ties.
For the illustrations of the scenarios with ties, suppose we’ve got the next sample of size 5:
As we will see, there are some ties since there are two an identical observations within the variable x.
For the scenarios which require no ties, we are going to consider the next sample of size 3:
The three most typical correlation methods are:1
- Pearson, used for 2 quantitative continuous variables which have a linear relationship
- Spearman, used for 2 quantitative variables if the link is partially linear, or for one qualitative ordinal variable and one quantitative variable
- Kendall, often used for 2 qualitative ordinal variables