cramer | R Documentation |
Compute the Cramer's V, a descriptive statistic that measures the association between categorical variables.
cramer(x)
x |
Data frame or matrix with a set of categorical variables. |
Any integer variable is internally converted to a factor.
A matrix with the Cramer's V between the categorical variables.
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.
The original code is available at https://sas-and-r.blogspot.com/, Example 8.39: calculating Cramer's V, posted by Ken Kleinman on Friday, June 3, 2011. As such, Ken Kleinman Ken_Kleinman@hms.harvard.edu is entitled a ‘contributor’ to the R-package pedometrics.
Alessandro Samuel-Rosa alessandrosamuelrosa@gmail.com
Cramé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.
if (interactive()) { data(meuse, package = "sp") str(meuse) test <- cramer(meuse[, c("ffreq", "soil", "lime", "landuse")]) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.