Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

assocstats

Association Statistics


Description

Computes the Pearson chi-Squared test, the Likelihood Ratio chi-Squared test, the phi coefficient, the contingency coefficient and Cramer's V for possibly stratified contingency tables.

Usage

assocstats(x)

Arguments

x

a contingency table, with possibly more than 2 dimensions. In this case, all dimensions except the first two ones are considered as strata.

Value

In case of a 2-dimensional table, a list with components:

chisq_tests

a 2 x 3 table with the chi-squared statistics.

phi

The absolute value of the phi coefficient (only defined for 2 x 2 tables).

cont

The contingency coefficient.

cramer

Cramer's V.

In case of higher-dimensional tables, a list of the above mentioned structure, each list component representing one stratum defined by the combinations of all levels of the stratum dimensions.

Author(s)

References

Michael Friendly (2000), Visualizing Categorical Data. SAS Institute, Cary, NC.

Fleiss, J. L. (1981). Statistical methods for rates and proportions (2nd ed). New York: Wiley

Examples

data("Arthritis")
tab <- xtabs(~Improved + Treatment, data = Arthritis)
summary(assocstats(tab))

assocstats(UCBAdmissions)

vcd

Visualizing Categorical Data

v1.4-10
GPL-2
Authors
David Meyer [aut, cre], Achim Zeileis [aut] (<https://orcid.org/0000-0003-0918-3766>), Kurt Hornik [aut], Florian Gerber [ctb], Michael Friendly [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.