Library: | xclust |
See also: | measure recode kmeans agglom |
Quantlet: | conting | |
Description: | crosses two categorical variables (for instance partitions from cluster analysis) and builds up contingency table |
Usage: | h = conting (x, y) | |
Input: | ||
x | n x 1 matrix partition of n points into k clusters | |
y | n x 1 matrix partition of n points into l clusters | |
Output: | ||
h | k x l contingency table |
; load the library xclust library("xclust") ; generate x data x = #(1, 1, 1, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3) ; generate y data y = #(2, 2, 2, 3, 1, 1, 3, 3, 3, 3, 3, 2, 2, 3, 2, 2, 1, 1, 1, 2, 1) conting(x, y)
Content of object h [1,] 0 7 1 [2,] 0 0 5 [3,] 6 1 1