cramer | R Documentation |
Function calculates Cramer's V for two categorical variables based on the table function
cramer(x, y, use = c("na.or.complete", "complete.obs", "everything",
"all.obs"), unbiased = TRUE)
x |
First categorical variable. |
y |
Second categorical variable. |
use |
What observations to use. See cor function for details.
The only option that is not available here is |
unbiased |
Determines whether to calculate the biased version of Cramer's V or the one with the small sample correction. |
The function calculates Cramer's V and also returns the associated statistics from Chi-Squared test with the null hypothesis of independence of the two variables.
See details in the vignette "Marketing analytics with greybox":
vignette("maUsingGreybox","greybox")
The following list of values is returned:
value - The value of Cramer's V;
statistic - The value of Chi squared statistic associated with the Cramer's V;
p.value - The p-value of Chi squared test associated with the Cramer's V;
df - The number of degrees of freedom from the test.
Ivan Svetunkov, ivan@svetunkov.com
Wicher Bergsma (2013), A bias-correction for Cramér's V and Tschuprow's T. Journal of the Korean Statistical Society, 42, pp. 323-328. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jkss.2012.10.002")}.
table, tableplot, spread,
mcor, association
cramer(mtcars$am, mtcars$gear)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.