ConDisPairs.Rd
This function counts concordant and discordant pairs for two variables x, y with at least ordinal scale, aggregated in a 2way table. This is the base for many association measures like Goodman Kruskal's gamma, but also all tau measures.
ConDisPairs(x)
The code is so far implemented in R (O(n^2)) and therefore slow for large sample sizes (>5000).
An O(n log(n)) implementation is available as (so far) undocumented function DescTools:::.DoCount(x, y, wts)
returning only concorant and discordant pairs (not including standard errors to be used for calculating confidence intervals).
a list with the number of concordant pairs, the number of discordant pairs and the matrix
Agresti, A. (2002) Categorical Data Analysis. John Wiley & Sons, pp. 57-59.
Goodman, L. A., & Kruskal, W. H. (1954) Measures of association for cross classifications. Journal of the American Statistical Association, 49, 732-764.
Goodman, L. A., & Kruskal, W. H. (1963) Measures of association for cross classifications III: Approximate sampling theory. Journal of the American Statistical Association, 58, 310-364.
Association measures: KendallTauA
(tau-a), cor
(method="kendall") for tau-b, StuartTauC
(tau-c), SomersDelta
Lambda
, GoodmanKruskalTau
(tau), UncertCoef
, MutInf