Learn R Programming

SciencesPo (version 1.3.9)

calc.TT: Tschuprow's T for Tables

Description

Computes the Tschuprow's T coefficient of association for tables.

Usage

calc.TT(x, y = NULL)

## S3 method for class 'default': calc.TT(x, y = NULL, ...)

Arguments

x
A vector or a matrix.
y
A vector that is ignored if x is a matrix and required if x is a vector.
...
Extra parameters pass to the table function.

Details

Tschuprow's T has the disadvantage of producing an overcorrection. Although kept from being > 1, the correlation coefficient often cannot reach the permissible maximum value of 1. This problem is likely to occur if R is much greater than C (or the other way around) in a large R x C table.

References

Tschuprow, A. A. (1939) Principles of the Mathematical Theory of Correlation. Translated by M. Kantorowitsch. W. Hodge & Co.

Examples

Run this code
# some data:
male <- c(33, 76, 6);
female <- c(47, 153, 25);
mat <- cbind( male, female );
rownames(mat) <- c( 'good', 'satisfactory', 'bad');

calc.TT(mat);

# long format
long = untable(mat);

calc.TT(long$Var1, long$Var2)

Run the code above in your browser using DataLab