Online Learning Platform

Data Analysis > Correlation and Regression > Correlation for ordinal variables

Spearman’s Rank Correlation and its context

Spearman correlation coefficient is applied where one or both the variable are qualitative in nature.

 

Where Di is the difference of ranks of ith data point.

The t-test formula to test the hypothesis,  no correlation,

 

cor(mtcars$mpg, mtcars$hp, method = "spearman")  # Ranked correlation

cor.test(mtcars$mpg, mtcars$hp, method = "spearman")

 

Kendall’s Tao

We use Kandall’s Tao in the following situation:

  • When we have both variables are on an Ordinal scale,
  • When data don’t follow a normal distribution
  • Small samples or data with many tied ranks
  • We have suspect a consistent increasing or decreasing relationship, but not necessarily linear

 

cor(mtcars$gear, mtcars$carb, method = "kendall")

cor.test(mtcars$gear, mtcars$carb, method = "kendall")

 

Prev
Linear Regression
Next
Chi-Square Test of Independence
Feedback
ABOUT

Statlearner


Statlearner STUDY

Statlearner