View source: R/compare.ranks.R

compare_ranks | R Documentation |

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 |

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.

A list containing

`concordant` |
number of concordant pairs: |

`discordant` |
number of discordant pairs: |

`ties` |
number of tied pairs: |

`left` |
number of left ties: |

`right` |
number of right ties: |

David Schoch

library(igraph) tg <- threshold_graph(100, 0.2) compare_ranks(degree(tg), closeness(tg)) # only concordant pairs compare_ranks(degree(tg), betweenness(tg)) # no discordant pairs ## Rank Correlation cor(degree(tg), closeness(tg), method = "kendall") # 1 cor(degree(tg), betweenness(tg), method = "kendall") # not 1, although no discordant pairs

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.