{"id":5025,"date":"2021-01-28T06:30:43","date_gmt":"2021-01-28T06:30:43","guid":{"rendered":"https:\/\/logicplum.com\/?post_type=docs&p=5025"},"modified":"2021-08-10T10:11:46","modified_gmt":"2021-08-10T10:11:46","slug":"spearmans-rank-correlation-coefficient","status":"publish","type":"docs","link":"https:\/\/logicplum.com\/blog\/knowledge-base\/spearmans-rank-correlation-coefficient\/","title":{"rendered":"Spearman\u2019s Rank Correlation Coefficient"},"content":{"rendered":"
In statistics, the Spearman\u2019s rank correlation coefficient is a nonparametric measure of the statistical dependence between the rankings of two variables. Named after its creator Charles Spearman and denoted by the Greek letter \u03c1 or as rs<\/sub>, it evaluates the relationship between two variables using a monotonic function (a function between ordered sets that preserves or reverses the order).<\/p>\n The Spearman correlation rank takes values between -1 and 1. A perfect correlation is given when the value obtained is either 1 or -1, indicating that each of the two variables considered is a perfect monotone function of the other.<\/p>\n Mathematically, for a sample of size n, it is calculated as follows:<\/p>\n Where<\/p>\n rgX<\/sub> and rgY<\/sub> are the converted ranks of X and Y, \u03c1 is the Pearson correlation coefficient, cov denotes the covariance, and \u03c3 the standard deviation.<\/p>\n When all n ranks are distinct integers, the equation becomes:<\/p>\n where di <\/sub>= rg(Xi<\/sub>) \u2013 rg(Yi<\/sub>).<\/p>\n <\/p>\n The Spearman\u2019s rank correlation coefficient is widely used to determine the strength of the relationship between two datasets. Its applications range from economics to physics to psychology and more. It is used in field research studies to validate empirical relationships. However, it must be noted that a strong relationship doesn\u2019t imply a cause-effect relationship, but merely that the two variables show related patterns.<\/p>\n <\/p>\n Understanding the relationship between different factors requires two types of knowledge. First, statistical knowledge is necessary to use formal methods. Second, the science behind the factors involved, necessary to create a realistic interpretation of the results.<\/p>\n LogicPlum\u2019s platform has been designed to help in the creation of models for those lacking the necessary mathematical and statistical knowledge. It includes cutting-edge methods from artificial intelligence, machine learning, statistics, mathematics; which are processed in an automated manner. Thus, users can concentrate on the second step, which is, using their knowledge to interpret the results.<\/p>\n <\/p>\n For those wanting to use Python, pandas offers the corr function. The online guide is available at https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.corr.html<\/a><\/p>\n For those who prefer the Julia language: https:\/\/juliastats.org\/StatsBase.jl\/stable\/ranking\/<\/a><\/p>\n For R practitioners: https:\/\/www.rdocumentation.org\/packages\/stats\/versions\/3.6.2\/topics\/cor<\/a><\/p>\n <\/p>\n","protected":false},"excerpt":{"rendered":" What is the Spearman\u2019s Rank Correlation Coefficient? In statistics, the Spearman\u2019s rank correlation coefficient is a nonparametric measure of the statistical dependence between the rankings of two variables. Named after its creator Charles Spearman and denoted by the Greek letter \u03c1 or as rs, it evaluates the relationship between two variables using a monotonic function Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"comment_status":"open","ping_status":"closed","template":"","meta":[],"doc_category":[67],"doc_tag":[16],"_links":{"self":[{"href":"https:\/\/logicplum.com\/blog\/wp-json\/wp\/v2\/docs\/5025"}],"collection":[{"href":"https:\/\/logicplum.com\/blog\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/logicplum.com\/blog\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/logicplum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/logicplum.com\/blog\/wp-json\/wp\/v2\/comments?post=5025"}],"version-history":[{"count":1,"href":"https:\/\/logicplum.com\/blog\/wp-json\/wp\/v2\/docs\/5025\/revisions"}],"predecessor-version":[{"id":5505,"href":"https:\/\/logicplum.com\/blog\/wp-json\/wp\/v2\/docs\/5025\/revisions\/5505"}],"wp:attachment":[{"href":"https:\/\/logicplum.com\/blog\/wp-json\/wp\/v2\/media?parent=5025"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/logicplum.com\/blog\/wp-json\/wp\/v2\/doc_category?post=5025"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/logicplum.com\/blog\/wp-json\/wp\/v2\/doc_tag?post=5025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\nFigure 1: Spearman\u2019s rank correlation coefficient.<\/p>\n
<\/p>\n
<\/p>\nWhy is the Spearman\u2019s Rank Correlation Coefficient Important?<\/h4>\n
Spearman\u2019s Rank Correlation + LogicPlum<\/h4>\n
Guide to Further Reading<\/h5>\n