chi: Chi-Squared Test

Description Usage Arguments Value See Also Examples

View source: R/chi.R

Description

Performs chi-squared contingency table tests with informative output.

Usage

1
chi(x, rpct = 0, print = TRUE, plot = TRUE)

Arguments

x

A numeric matrix.

rpct

A numeric scalar indicating the rounding used for printed output, default 0.

print

A logical scalar indicating if output should be printed, default TRUE.

plot

A logical scalar indicating if plot should be generated, default TRUE.

Value

A list with class "htest" containing the components described in chisq.test.

See Also

chisq.test.

Examples

1
2
3
4
5
## From Agresti(2007) p.39
M <- as.table(rbind(c(762, 327, 468), c(484, 239, 477)))
dimnames(M) <- list(gender=c("M", "F"),
 party=c("Democrat", "Independent", "Republican"))
chi(M)

JVAdams/jvamisc documentation built on Aug. 11, 2021, 6:43 a.m.