Learn R Programming

DescTools (version 0.99.19)

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.

See Also

ConDisPairs yields concordant and discordant pairs Other association measures: GoodmanKruskalGamma, KendallTauA (tau-a), cor (method="kendall") for tau-b, StuartTauC (tau-c), SomersDelta Lambda, GoodmanKruskalTau, 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 DataLab