Learn R Programming

descriptio (version 1.3)

phi.table: Computes the phi coefficient for every cells of a contingency table

Description

Computes the phi coefficient for every cells of the cross-tabulation between two categorical variables

Usage

phi.table(x, y, weights = NULL, na.rm = FALSE, na.value = "NA", digits = 3)

Value

A table with the phi coefficients

Arguments

x

the first categorical variable

y

the second categorical variable

weights

numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used.

na.rm

logical, indicating whether NA values should be silently removed before the computation proceeds. If FALSE (default), an additional level is added to the variables (see na.value argument).

na.value

character. Name of the level for NA category. Default is "NA". Only used if na.rm = FALSE.

digits

integer. The number of digits (default is 3). If NULL, the results are not rounded.

Author

Nicolas Robette

References

Rakotomalala R., 'Comprendre la taille d'effet (effect size)', http://eric.univ-lyon2.fr/~ricco/cours/slides/effect_size.pdf

See Also

assoc.twocat,assoc.catcont, condesc, catdesc

Examples

Run this code
data(Movies)
phi.table(Movies$Country, Movies$ArtHouse)

Run the code above in your browser using DataLab