Chi Square test of association to examine if there is a relationship between two categorical variables.
infer_chisq_assoc_test(data, x, y)
data | a |
---|---|
x | factor; column in |
y | factor; column in |
infer_chisq_assoc_test
returns an object of class
"infer_chisq_assoc_test"
. An object of class
"infer_chisq_assoc_test"
is a list containing the
following components:
chi square
likelihood ratio chi square
mantel haenszel chi square
continuity adjusted chi square
contingency coefficient
cramer's v
degrees of freedom
product of dimensions of the table of x
and y
phi coefficient
p-value of chi square
p-value of continuity adjusted chi square
p-value of likelihood ratio chi square
p-value of mantel haenszel chi square
chisq_test()
has been deprecated. Instead use
infer_chisq_assoc_test()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
infer_chisq_assoc_test(hsb, female, schtyp) #> Chi Square Statistics #> #> Statistics DF Value Prob #> ---------------------------------------------------- #> Chi-Square 1 0.0470 0.8284 #> Likelihood Ratio Chi-Square 1 0.0471 0.8282 #> Continuity Adj. Chi-Square 1 0.0005 0.9822 #> Mantel-Haenszel Chi-Square 1 0.0468 0.8287 #> Phi Coefficient 0.0153 #> Contingency Coefficient 0.0153 #> Cramer's V 0.0153 #> ---------------------------------------------------- infer_chisq_assoc_test(hsb, female, ses) #> Chi Square Statistics #> #> Statistics DF Value Prob #> ---------------------------------------------------- #> Chi-Square 2 4.5765 0.1014 #> Likelihood Ratio Chi-Square 2 4.6789 0.0964 #> Phi Coefficient 0.1513 #> Contingency Coefficient 0.1496 #> Cramer's V 0.1513 #> ----------------------------------------------------