pem.table {descriptio}R Documentation

Computes the local and global Percentages of Maximum Deviation from Independence (pem)

Description

Computes the local and global Percentages of Maximum Deviation from Independence (pem) of a contingency table.

Usage

pem.table(x, y, weights = NULL, sort = FALSE, na.rm = FALSE, na.value = "NA", digits = 1)

Arguments

x

the first categorical variable

y

the second categorical variable

weights

an optional numeric vector of weights (by default, a vector of 1 for uniform weights)

sort

logical. Whether rows and columns are sorted according to a correspondence analysis or not (default is FALSE).

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 1). If NULL, the results are not rounded.

Details

The Percentage of Maximum Deviation from Independence (pem) is an association measure for contingency tables and also provides attraction (resp. repulsion) measures in each cell of the crosstabulation (see Cibois, 1993). It is an alternative to khi2, Cramer's V coefficient, etc.

Value

Returns a list:

peml

Table with local percentages of maximum deviation from independence

pemg

Numeric value, i.e. the global percentage of maximum deviation from independence

Author(s)

Nicolas Robette

References

Cibois P., 1993, Le pem, pourcentage de l'ecart maximum : un indice de liaison entre modalites d'un tableau de contingence, Bulletin de methodologie sociologique, n40, p.43-63. https://cibois.pagesperso-orange.fr/bms93.pdf

See Also

table, chisq.test, phi.table, assocstats

Examples

data(Movies)
pem.table(Movies$Country, Movies$ArtHouse)

[Package descriptio version 1.3 Index]