dyadic_similarity: Compare two rank orderings

Description Usage Arguments Value Examples

View source: R/dyadic_similarity.R

Description

This function compares two rank orderings that have the same elements. For an order of length n there are n choose 2 dyadic relationships implied by that order. For example, the order a, b, c implies that a > b, a > c, and b > c. The dyadic similarity between two orders is the proportion of implied dyadic relationships that are shared by the two orders.

Usage

1
dyadic_similarity(order1, order2)

Arguments

order1

The first rank ordering to be compared. Alternatively, this can be supplied as an interaction matrix with identities as the dimension names. All identities in order1 must be in order2.

order2

The second rank ordering to be compared. Alternatively, this can be supplied as an interaction matrix with identities as the dimension names. All identities in order2 must be in order1.

Value

The proportion of dyadic relationships that are shared by the two orders. This value is 1 if the orders are identical and 0 if the orders are exact opposites.

Examples

1
2
3
dyadic_similarity(letters[1:20], letters[1:20]) #identical orders
dyadic_similarity(letters[1:20], letters[20:1]) #opposite orders
dyadic_similarity(sample(letters[1:20]), sample(letters[1:20])) #random orders

straussed/DynaRankR documentation built on Feb. 18, 2020, 5:22 p.m.