Learn R Programming

GDAtools (version 1.7)

pem: 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(x,y,weights=rep(1,length(x)),digits=1,sort=TRUE)

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)

digits

integer. The number of digits (default is 3).

sort

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

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

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.

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

Run this code
# NOT RUN {
## Computes the PEM for the contingency table
## of jazz and age variables
## from the 'Music' example data set
data(Music)
pem(Music$Jazz,Music$Age)
# }

Run the code above in your browser using DataLab