| Title: | A Post Hoc Analysis for Pearson's Chi-Squared Test for Count Data |
|---|---|
| Description: | Perform post hoc analysis based on residuals of Pearson's Chi-squared Test for Count Data based on T. Mark Beasley & Randall E. Schumacker (1995) <doi: 10.1080/00220973.1995.9943797>. |
| Authors: | Daniel Ebbert [cre, aut] (ORCID: <https://orcid.org/0000-0003-3666-7205>) |
| Maintainer: | Daniel Ebbert <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.3 |
| Built: | 2026-05-19 06:25:22 UTC |
| Source: | https://github.com/ebbertd/chisq.posthoc.test |
Perform post hoc analysis based on residuals of Pearson's Chi-squared Test for Count Data.
chisq.posthoc.test(x, method = "bonferroni", round = 4, alpha = 0.05, ...)chisq.posthoc.test(x, method = "bonferroni", round = 4, alpha = 0.05, ...)
x |
A matrix passed on to the chisq.test function. |
method |
The p adjustment method to be used. This is passed on to the p.adjust function. |
round |
Number of digits to round the p.value to. Defaults to 4. |
alpha |
The alpha value to the compare the p values to. Defaults to 0.05. |
... |
Additional arguments passed on to the chisq.test function. |
A table with the adjusted p value for each x y combination.
Agresti, A. (2007). An Introduction to Categorical Data Analysis, 2nd ed. New York: John Wiley & Sons. Page 38.
Beasley, T. M., & Schumacker, R. E. (1995). Multiple Regression Approach to Analyzing Contingency Tables: Post Hoc and Planned Comparison Procedures. The Journal of Experimental Education, 64(1), 79–93.
# Data from Agresti(2007) p.39 M <- as.table(rbind(c(762, 327, 468), c(484, 239, 477))) dimnames(M) <- list(gender = c("F", "M"), party = c("Democrat","Independent", "Republican")) # Pass data matrix to chisq.posthoc.test function chisq.posthoc.test(M, alpha = 0.05)# Data from Agresti(2007) p.39 M <- as.table(rbind(c(762, 327, 468), c(484, 239, 477))) dimnames(M) <- list(gender = c("F", "M"), party = c("Democrat","Independent", "Republican")) # Pass data matrix to chisq.posthoc.test function chisq.posthoc.test(M, alpha = 0.05)