Learn R Programming

simPop (version 0.2.9)

contingencyWt: Weighted contingency coefficients

Description

Compute (weighted) pairwise contingency coefficients.

Usage

contingencyWt(x, ...)

## S3 method for class 'default': contingencyWt(x, y, weights = NULL, \dots)

## S3 method for class 'matrix': contingencyWt(x, weights = NULL, \dots)

## S3 method for class 'data.frame': contingencyWt(x, weights = NULL, \dots)

Arguments

x
for the default method, a vector that can be interpreted as factor. For the matrix and data.frame methods, the columns should be interpretable as factors.
y
a vector that can be interpreted as factor.
weights
an optional numeric vector containing sample weights.
...
for the generic function, arguments to be passed down to the methods, otherwise ignored.

Value

  • For the default method, the (weighted) contingency coefficient of x and y.

    For the matrix and data.frame method, a matrix of (weighted) pairwise contingency coefficients for all combinations of columns. Elements below the diagonal are NA.

Details

The function tableWt is used for the computation of the corresponding pairwise contingency tables.

References

Kendall, M.G. and Stuart, A. (1967) The Advanced Theory of Statistics, Volume 2: Inference and Relationship. Charles Griffin & Co Ltd, London, 2nd edition.

See Also

tableWt

Examples

Run this code
data(eusilcS)

## default method
contingencyWt(eusilcS$pl030, eusilcS$pb220a, weights = eusilcS$rb050)

## data.frame method
basic <- c("age", "rb090", "hsize", "pl030", "pb220a")
contingencyWt(eusilcS[, basic], weights = eusilcS$rb050)

Run the code above in your browser using DataLab