cramer.test: Cramer's association coefficient

cramer.testR Documentation

Cramer's association coefficient

Description

Computes the Cramer'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

method

name of the test.

statistic

test statistics.

parameter

test degrees of freedom.

p.value

test p-value.

data.name

a character string giving the names of the data.

estimate

Cramer's coefficient.

conf.level

confidence level.

rep

number of replicates.

conf.int

confidence interval.

alternative

a character string giving the alternative hypothesis, always "two.sided"

null.value

the value of the association measure under the null hypothesis, always 0.

Author(s)

Maxime HERVE <maxime.herve@univ-rennes1.fr>

See Also

boot

Examples

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))

RVAideMemoire documentation built on Nov. 6, 2023, 5:07 p.m.