# pem: Computes the local and global Percentages of Maximum... In GDAtools: A Toolbox for Geometric Data Analysis and More

 pem 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(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).

### 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

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

`table`, `chisq.test`, `phi.table`, `assocstats`

### Examples

```## 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)
```

GDAtools documentation built on March 18, 2022, 5:13 p.m.