concordance: Compute Concordance Matrix

Description Usage Arguments Details Value Author See Also Examples

View source: R/main.R

Description

concordance calculates the concordance matrix between two partitions of the same data.

Usage

1
  concordance(part1, part2)

Arguments

part1

[vector] : the first partition vector.

part2

[vector] : the second partition vector.

Details

Given two partitions, the function concordance calculates the number of pairs classified as belonging or not belonging to the same cluster with respect to partitions part1 or part2.

Value

A 2x2 matrix of the form :

1
2
3
4
5
      |  P1   |  P2   |
  ____________________
   P1 |  Nyy  |  Nyn  |
   P2 |  Nny  |  Nnn  |
  ____________________

where

Author

Bernard Desgraupes
bernard.desgraupes@u-paris10.fr
University of Paris Ouest - Nanterre
Lab Modal'X (EA 3454)

See Also

extCriteria, intCriteria.

Examples

1
2
3
4
5
6
# Generate two artificial partitions
part1<-sample(1:3,150,replace=TRUE)
part2<-sample(1:5,150,replace=TRUE)

# Compute the table of concordances and discordances
concordance(part1,part2)

Example output

     y    n
y  768 3034
n 1471 5902

clusterCrit documentation built on May 2, 2019, 3:22 p.m.