Last chance! 50% off unlimited learning
Sale ends in
Computes the Cramer's association coefficient between 2 nominal variables, its confidence interval (by bootstraping) and tests for its significance.
cramer.test(x, y, nrep = 1000, conf.level = 0.95)
name of the test.
test statistics.
test degrees of freedom.
test p-value.
a character string giving the names of the data.
Cramer's coefficient.
confidence level.
number of replicates.
confidence interval.
a character string giving the alternative hypothesis, always "two.sided"
the value of the association measure under the null hypothesis, always 0.
a contingency table ('matrix' or 'table' object). x
and y
can also both be factors.
ignored if x
is a contingency table. If not, y
should be a vector of the same length.
number of replicates for bootstraping.
confidence level.
Maxime HERVE <maxime.herve@univ-rennes1.fr>
var1 <- sample(LETTERS[1:3],30,replace=TRUE)
var2 <- sample(letters[1:3],30,replace=TRUE)
cramer.test(var1,var2)
# or cramer.test(table(var1,var2))
Run the code above in your browser using DataLab