Chi Square test of association to examine if there is a relationship between two categorical variables.
chisq_test(x, y)
chisq_test
returns an object of class "chisq_test"
.
An object of class "chisq_test"
is a list containing the
following components:
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
chisq_test(as.factor(hsb$female), as.factor(hsb$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 #> ----------------------------------------------------chisq_test(as.factor(hsb$female), as.factor(hsb$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 #> ----------------------------------------------------