Description Usage Arguments Details Value Examples
Calculate the Cramer's V measure of association
1 |
... |
Arguments to be passed to the |
Calculates the Cramer's V measure of effect size for chi-square
tests of association and goodness of fit. The arguments to the
cramersV
function are all passed straight to the chisq.test
function, and should have the same format.
A numeric variable with a single element corresponding to the value of V.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Consider an experiment with two conditions, each with 100
# participants. Each participant chooses between one of three
# options. Possible data for this experiment:
condition1 <- c(30, 20, 50)
condition2 <- c(35, 30, 35)
X <- cbind( condition1, condition2 )
rownames(X) <- c( 'choice1', 'choice2', 'choice3' )
print(X)
# To test the null hypothesis that the distribution of choices
# is identical in the two conditions, we would run a chi-square
# test:
chisq.test(X)
# To estimate the effect size we can use Cramer's V:
cramersV( X ) # returns a value of 0.159
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.