R: Comparing partitions on one or multiple sets of units

rand {blockmodeling} | R Documentation

## Comparing partitions on one or multiple sets of units

### Description

Rand Index and Rand Index corrected/adjusted for chance for comparing partitions (Hubert & Arabie, 1985). The functions also support computing these indices on partitions on multiple sets (where a "combined" partition is a list of multiple partitions). The names of the clusters do not matter.

### Usage

    rand(clu1, clu2, tab)

    crand(
      clu1,
      clu2,
      tab,
      multiSets = c("weights", "unlist"),
      weights = c("size", "equal"),
      returnIndividual = "attr"
    )

    rand2(clu1, clu2)

    crand2(clu1, clu2)

### Arguments

`clu1` | The first of the two partitions to be compared, given in the form of vectors, where for each unit a cluster membership is given. Alternatively, this can be a contingency table obtained as a `table(clu1, clu2)`. If a partition, `clu2` must also be provided. In case of multiple sets, this should be pa list of partitions.
`clu2` | If `clu1` is partition or a list of partitions, this must be a comaptible the second partition or list of partitions.
`tab` | A contingency table obtained as a `table(clu1, clu2)`. This is included for back-compatibility reasons. If this is present, all other arguments are ignored.
`multiSets` | How should we compute the index in case of multiple sets of unis (if `clu1` and `clu2` are lists of partitions)? Possible values are "unlist" and "weight" (the default).
`weights` | Weights to be used if `multiSets` is "weight". It can be "equal", "size" (default) or a numeric (non-negative) vector of the same length as the number of sets (the number of partitions in the list of partitions).
`returnIndividual` | If `multiSets` is "weight", should the indices for individual sets be also returned. If `TRUE`, the function returns a list instead of a single value. If the values is `"attr"` (the default), the indices by sets are given as an attribute `"bySets"`

### Value

The value of Rand Index (corrected/adjusted for chance) unless `multiSets="weight"` and `returnIndividual=FALSE`. In this case, a list with two items is return. The "global" index is in `global`, while the the indices by sets are in `bySets`.

### Author(s)

Aleš Žiberna

### References

Hubert, L., & Arabie, P. (1985). Comparing Partitions. Journal of Classification, 2(1), 193-218.

[Package blockmodeling version 1.0.5 Index]