Counts the number of concordant, discordant and (left/right) ties between two rankings.

compare_ranks(x, y)

x | A numeric vector. |
---|---|

y | A numeric vector with the same length as |

A list containing

number of concordant pairs: `x[i]`

> `x[j]`

and `y[i]`

> `y[j]`

number of discordant pairs: `x[i]`

> `x[j]`

and `y[i]`

< `y[j]`

number of tied pairs: `x[i]`

== `x[j]`

and `y[i]`

== `y[j]`

number of left ties: `x[i]`

== `x[j]`

and `y[i]`

!= `y[j]`

number of right ties: `x[i]`

!= `x[j]`

and `y[i]`

== `y[j]`

Explicitly calculating the number of occurring cases is more robust
than using correlation indices as given in the `cor`

function. Especially
left and right ties can significantly alter correlations.

library(igraph) tg <- threshold_graph(100,0.2) compare_ranks(degree(tg),closeness(tg)) #only concordant pairs#> $concordant #> [1] 4708 #> #> $discordant #> [1] 0 #> #> $ties #> [1] 242 #> #> $left #> [1] 0 #> #> $right #> [1] 0 #>#> $concordant #> [1] 1865 #> #> $discordant #> [1] 0 #> #> $ties #> [1] 242 #> #> $left #> [1] 0 #> #> $right #> [1] 2843 #>#> [1] 1#> [1] 0.629392