Learn R Programming

SciencesPo (version 1.02.12)

testAssociation: Association tests for contingency tables

Description

Calculates the Likelihood Ratio chi-Squared test, the Pearson chi-Squared test, the phi coefficient, the contingency coefficient and Cramer's V. Cramer V / Phi test using two vectors with more than 2 levels.

Usage

testAssociation(x)

Arguments

x
an r x c table.

Value

  • The association statistics tests for r x c table.

encoding

UTF-8

Examples

Run this code
x = sample(1:2, 30, TRUE);
 y = sample(1:3, 30, TRUE)
 testAssociation(table(x, y))

Run the code above in your browser using DataLab