DescTools (version 0.99.15)

KendallTauB: Kendall tau-b

Description

Calculate Kendall's tau-b. The estimator could also be calculated with cor(..., method="kendall"). The calculation of confidence intervals however would not be found there.

Usage

KendallTauB(x, y = NULL, conf.level = NA, ...)

Arguments

x
a numeric vector, matrix or data.frame.
y
NULL (default) or a vector with compatible dimensions to x. If y is provided, table(x, y, ...) is calculated.
conf.level
confidence level of the interval. If set to NA (which is the default) no confidence interval will be calculated.
...
further arguments are passed to the function table, allowing i.e. to set useNA. This refers only to the vector interface.

Value

  • a single numeric value if no confidence intervals are requested, and otherwise a numeric vector with 3 elements for the estimate, the lower and the upper confidence interval

References

Agresti, A. (2002) Categorical Data Analysis. John Wiley & Sons, pp. 57-59. http://support.sas.com/onlinedoc/913/getDoc/en/statug.hlp/freq_sect18.htm http://support.sas.com/onlinedoc/913/getDoc/en/statug.hlp/freq_sect20.htm

See Also

ConDisPairs yields concordant and discordant pairs Other association measures: GoodmanKruskalTauA (tau-a), cor (method="kendall") for tau-b, StuartTauC (tau-c), SomersDelta Lambda, UncertCoef, MutInf

Examples

Run this code
# 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)))

KendallTauB(tab, conf.level=0.95)

Run the code above in your browser using DataCamp Workspace