pedometrics (version 0.12.1)

cramer: Association between categorical variables

Description

Compute the Cramer's V, a descriptive statistic that measures the association between categorical variables.

Usage

cramer(x)

Arguments

x

Data frame or matrix with a set of categorical variables.

Value

A matrix with the Cramer's V between the categorical variables.

Reverse dependencies

The spsann package, provider of methods for the optimization of sample configurations using spatial simulated annealing in R, requires cramer() for some of its functions to work. The development version of the spsann package is available on https://github.com/Laboratorio-de-Pedometria/spsann-package.

Details

Any integer variable is internally converted to a factor.

References

Cram<U+00E9>r, H. Mathematical methods of statistics. Princeton: Princeton University Press, p. 575, 1946.

Everitt, B. S. The Cambridge dictionary of statistics. Cambridge: Cambridge University Press, p. 432, 2006.

Examples

Run this code
# NOT RUN {
if (interactive()) {
  data(meuse, package = "sp")
  str(meuse)
  test <- cramer(meuse[, c("ffreq", "soil", "lime", "landuse")])
}
# }

Run the code above in your browser using DataLab