SomersDelta(x, y = NULL, direction = c("row", "column"), conf.level = NA, ...)
x
. If y is provided, table(x, y, ...)
is calculated."row"
(default) or "column"
, where
"row"
calculates Somers' D (R | C) ("column dependent").table
, allowing i.e. to set useNA. This refers only to the vector interface.somers2
,
which is quite fast for large sample sizes. However it is restricted to computing Somers' Dxy rank correlation between a variable x and a binary (0-1) variable y.
ConDisPairs
yields concordant and discordant pairs
other association measures:
GoodmanKruskalTauA
(tau-a), cor
(method="kendall") for tau-b, StuartTauC
(tau-c),
GoodmanKruskalGamma
Lambda
, UncertCoef
, MutInf
# example in:
# http://support.sas.com/documentation/cdl/en/statugfreq/63124/PDF/default/statugfreq.pdf
# pp. S. 1821
tab <- as.table(rbind(c(26,26,23,18,9),c(6,7,9,14,23)))
# Somers' D C|R
SomersDelta(tab, direction="column", conf.level=0.95)
# Somers' D R|C
SomersDelta(tab, direction="row", conf.level=0.95)
Run the code above in your browser using DataLab