stdres.table: Standardized residuals of a contingency table

View source: R/stdres.table.R

stdres.tableR Documentation

Standardized residuals of a contingency table

Description

Computes standardized or adjusted residuals of a (possibly) weighted contingency table

Usage

stdres.table(x, y, weights = NULL, na.rm = FALSE,
  na.value = "NAs", digits = 3, residuals = "std")

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 "NAs". Only used if na.rm = FALSE.

digits

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

residuals

If "std" (default), standardized (i.e. Pearson) residuals are computed. If "adj", adjusted standardized residuals are computed.

Value

A table with the residuals

Note

The adjusted standardized residuals are strictly equivalent to test-values for nominal variables as proposed by Lebart et al (1984).

Author(s)

Nicolas Robette

References

Agresti, A. (2007). An Introduction to Categorical Data Analysis, 2nd ed. New York: John Wiley & Sons.

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

Lebart L., Morineau A. and Warwick K., 1984, *Multivariate Descriptive Statistical Analysis*, John Wiley and sons, New-York.

See Also

assoc.twocat,phi.table, or.table, pem.table

Examples

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

descriptio documentation built on June 8, 2025, 10:50 a.m.