Learn R Programming

RVAideMemoire (version 0.9-45-2)

cramer.test: Cramer's association coefficient

Description

Computes the Cram�r's association coefficient between 2 nominal variables, its confidence interval (by bootstraping) and tests for its significance.

Usage

cramer.test(x, y, nrep = 1000, conf.level = 0.95)

Arguments

x
a contingency table ('matrix' or 'table' object). x and y can also both be factors.
y
ignored if x is a contingency table. If not, y should be a vector of the same length.
nrep
number of replicates for bootstraping.
conf.level
confidence level.

Value

  • methodname of the test.
  • statistictest statistics.
  • parametertest degrees of freedom.
  • p.valuetest p-value.
  • data.namea character string giving the names of the data.
  • estimateCram�r's coefficient.
  • conf.levelconfidence level.
  • repnumber of replicates.
  • conf.intconfidence interval.
  • alternativea character string giving the alternative hypothesis, always "two.sided"
  • null.valuethe value of the association measure under the null hypothesis, always 0.

See Also

boot

Examples

Run this code
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