{"id":3282,"date":"2023-08-11T15:27:03","date_gmt":"2023-08-11T13:27:03","guid":{"rendered":"https:\/\/www.psyctc.org\/psyctc\/?post_type=docs&#038;p=3282"},"modified":"2025-02-24T11:32:05","modified_gmt":"2025-02-24T10:32:05","password":"","slug":"ranking","status":"publish","type":"docs","link":"https:\/\/www.psyctc.org\/psyctc\/glossary2\/ranking\/","title":{"rendered":"Ranking"},"content":{"rendered":"\n<p>Ranking is what it says!  If you have a set of scores you can rank (well, if at least some of them are different from others, if not, you have no variance and no ranking).  Why does it matter?  Well, it can be a handy way to look at data and  there has been a big political vogue for &#8220;league tables&#8221; which are about ranking (and have a lot of issues statistically).  Traditionally, when statistical methods were divided into &#8220;parametric&#8221; and &#8220;non-parametric&#8221; ranking underpinned many non-parametric tests, notably Spearman&#8217;s correlation coefficient.  That framework has been markedly diminished by the arrival of bootstrap statistical methods but ranking can still be a useful tool and is useful, and easy, to remember.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Details<\/h4>\n\n\n\n<p>Say you have twelve scores (to one decimal place with possible scores bounded by 0 and 4).  Here they are with their ranks:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"924\" height=\"457\" src=\"https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking1-3.png\" alt=\"\" class=\"wp-image-3287\" srcset=\"https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking1-3.png 924w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking1-3-300x148.png 300w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking1-3-768x380.png 768w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking1-3-360x178.png 360w\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" \/><\/figure>\n\n\n\n<p>We can see that the lowest score of 0.2 is ranked first, ranked 1 (because I am ranking by increasing scores.  The highest score,  3.8 is ranked 12 as there are twelve scores.  Here I&#8217;ve ordered the scores to show that the ranking is correct.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"924\" height=\"457\" src=\"https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking2.png\" alt=\"\" class=\"wp-image-3288\" srcset=\"https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking2.png 924w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking2-300x148.png 300w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking2-768x380.png 768w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking2-360x178.png 360w\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" \/><\/figure>\n\n\n\n<p>That is so called &#8220;perfect ranking&#8221; as no two scores are the same, we have no ties.<\/p>\n\n\n\n<p>Say three more scores are added and now these are all three repeats of earlier scores. So now we have this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"924\" height=\"599\" src=\"https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking3-1.png\" alt=\"\" class=\"wp-image-3291\" srcset=\"https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking3-1.png 924w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking3-1-300x194.png 300w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking3-1-768x498.png 768w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking3-1-360x233.png 360w\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" \/><\/figure>\n\n\n\n<p>This brings us to a bit of real small print, completely irrelevant for MH\/therapy work but probably worth me including here just in case you hit reading papers or talking with statisticians (do you?!)  This small print is that there are actually different ways of allocating ranks in the presence of ties.  Here you go!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"924\" height=\"603\" src=\"https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking5-3.png\" alt=\"\" class=\"wp-image-3297\" srcset=\"https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking5-3.png 924w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking5-3-300x196.png 300w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking5-3-768x501.png 768w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking5-3-360x235.png 360w\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" \/><\/figure>\n\n\n\n<p>The only reason this would ever matter to us if we have computed ranks one way and a statistician has computed them another way.  It won&#8217;t actually affect any statistical analyses of the ranks that I can imagine.  Just to explain them, working left to right on list listing in which they have been ordered by score. I&#8217;d added those arbitrary ID values as being able to distinguish the rows matters for the different ranking methods.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"924\" height=\"603\" src=\"https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking6-1.png\" alt=\"\" class=\"wp-image-3298\" srcset=\"https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking6-1.png 924w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking6-1-300x196.png 300w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking6-1-768x501.png 768w, https:\/\/www.psyctc.org\/psyctc\/wp-content\/uploads\/2023\/08\/ranking6-1-360x235.png 360w\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>rankMean is the mean of the possible ranks, so the score 1.3 has appeared twice coming after 0.7 which was ranked second so the two values of 1.3 get ranks of 3.5, the mean of 3 and 4. This is the commonest way of giving ranks to values.<\/li>\n\n\n\n<li>rankFirst: the first of of the tied values gets the lower rank and the next the next rank and so on.  That&#8217;s why ID G who scored 1.3 gets rank 3 and ID M who also scored 1.3 gets rank 4: because M came after G in the original data.<\/li>\n\n\n\n<li>rankLast: the reverse of the last method so this way M gets rank 3 and G gets rank 4<\/li>\n\n\n\n<li>rankMin: here any ties get the lowest value for the ranks.  So both G and M get rank 3. (Apparently this is often used in sport rankings.)<\/li>\n\n\n\n<li>rankMax: all tied values get the maximum value for their ranks.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Try also<\/h4>\n\n\n\n<p><a href=\"https:\/\/www.psyctc.org\/psyctc\/glossary2\/league-tables\/\" title=\"\">League tables<\/a><br>Incomplete ranking<br>Complete ranking<br>Spearman correlation coefficient<br>Non-parametric tests<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Chapters<\/h4>\n\n\n\n<p>Not particularly covered in the book.  Sort of pertinent to Chapter 5.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Online resources<\/h4>\n\n\n\n<ul id=\"block-5402c1ce-697c-4775-b423-222c1f74f271\" class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.psyctc.org\/Rblog\/index.html\" target=\"_blank\" rel=\"noreferrer noopener\">Rblog<\/a>:\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.psyctc.org\/Rblog\/posts\/2025-02-23-league-tables\/\" target=\"_blank\" rel=\"noreferrer noopener\">Illustration of ranking, i.e. league table in the presence only of random sampling vagaries<\/a>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Dates<\/h4>\n\n\n\n<p>First created 11.viii.23, links tweaked 24.ii.25.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ranking is what it says! If you have a set of scores you can rank (well, if at least some of them are different from others, if not, you have no variance and no ranking). Why does it matter? Well, it can be a handy way to look at data and there has been a &hellip; <a href=\"https:\/\/www.psyctc.org\/psyctc\/glossary2\/ranking\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Ranking<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[18],"glossaries":[],"doc_tag":[],"knowledge_base":[],"class_list":["post-3282","docs","type-docs","status-publish","hentry","doc_category-om-book"],"year_month":"2026-04","word_count":540,"total_views":"983","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"chris","author_nicename":"chris","author_url":"https:\/\/www.psyctc.org\/psyctc\/author\/chris\/"},"doc_category_info":[{"term_name":"All OM book glossary entries","term_url":"https:\/\/www.psyctc.org\/psyctc\/glossary\/non-knowledgebase\/om-book\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/docs\/3282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/comments?post=3282"}],"version-history":[{"count":5,"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/docs\/3282\/revisions"}],"predecessor-version":[{"id":4741,"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/docs\/3282\/revisions\/4741"}],"wp:attachment":[{"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/media?parent=3282"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/doc_category?post=3282"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/glossaries?post=3282"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/doc_tag?post=3282"},{"taxonomy":"knowledge_base","embeddable":true,"href":"https:\/\/www.psyctc.org\/psyctc\/wp-json\/wp\/v2\/knowledge_base?post=3282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}