Description Usage Arguments Details Value Author(s) See Also Examples
Calculates the Cramer's V measure of correlation between x
and y
and the statistical significance of this correlation.
1 | cramersV.test(x, y, na.rm=TRUE)
|
x |
A vector of factor, character, logical or numeric values. |
y |
A vector of factor, character, logical or numeric values. |
na.rm |
If |
If either x
or y
is supplied as a non-factor variable, and has <= 20 unique values, then it is converted into a factor to allow the value of Cramer's V and its significance to be calculated. If x
or y
is a non-factor variable with > 20 unique values then Cramer's V is not calculated and a value of NA
is returned.
A data frame returning two values:
cramers.v |
The Cramer's V measure of correlation between |
p.value |
The statistical significance of the observed correlation |
Paul Williamson
1 2 3 4 5 6 7 8 | ## Compare two factor variables
cramersV.test(survey$Tenure, survey$Age)
## Include a non-factor variable (income) with <= 20 unique values
cramersV.test(survey$Tenure[1:20], survey$Income[1:20])
## Include a non-factor variable (income) with > 20 unique values
cramersV.test(survey$Tenure, survey$Income)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.