GKtau: Compute Goodman and Kruskal tau measure of association.

Description Usage Arguments Details Value Author(s) Examples

View source: R/GKtau.R

Description

GKtau returns forward and backward Goodman and Kruskal tau measures between categorical variables.

Usage

1
GKtau(x, y, dgts = 3, includeNA = "ifany")

Arguments

x

A categorical vector (factor).

y

A categorical vector (factor).

dgts

Integer, number of digits for results; optional (default = 3).

includeNA

Character, passed to useNA parameter for table; default is "ifany"; other valid options are "no" and "always"

Details

The Goodman and Kruskal tau measure is an asymmetric association measure between two categorical variables, based on the extent to which variation in one variable can be explained by the other. This function returns a dataframe with both forward and backward associations.

Value

A one-row dataframe with the following columns:

Author(s)

Ron Pearson

Examples

1
2
3
4
5
6
x <- rep(c("a", "b", "c", "d"), each = 3)
y <- rep(c("a", "b", "c", "d"), times = 3)
z <- rep(c("a", "b", "a", "c"), each = 3)
GKtau(x, y)
GKtau(x, z)
GKtau(y, z)

GoodmanKruskal documentation built on March 18, 2020, 5:09 p.m.