pem.table.Rd
Computes the local and global Percentages of Maximum Deviation from Independence (pem) of a contingency table.
pem.table(x, y, weights = NULL, sort = FALSE, na.rm = FALSE, na.value = "NAs", digits = 1)
the first categorical variable
the second categorical variable
an optional numeric vector of weights (by default, a vector of 1 for uniform weights)
logical. Whether rows and columns are sorted according to a correspondence analysis or not (default is FALSE).
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).
character. Name of the level for NA category. Default is "NAs". Only used if na.rm = FALSE.
integer. The number of digits (default is 1). If NULL, the results are not rounded.
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.
Returns a list:
Table with local percentages of maximum deviation from independence
Numeric value, i.e. the global percentage of maximum deviation from independence
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
data(Movies)
pem.table(Movies$Country, Movies$ArtHouse)
#> $peml
#> y
#> x No Yes
#> Europe 5.7 -5.7
#> France -51.6 51.6
#> Other -55.1 55.1
#> USA 72.3 -72.3
#>
#> $pemg
#> [1] 64
#>