I am wondering if there exists in 开发者_高级运维R a package/function to perform the: "Post Hoc Pair-Wise Comparisons for the Chi-Square Test of Homogeneity of Proportions" (or an equivalent of it) Which is described here: http://epm.sagepub.com/cgi/content/abstract/53/4/951
My situation is of just making a chi test, on a 2 by X matrix. I found a difference, but I want to know which of the columns is "responsible" for the difference.
Thanks, Tal
The "chi-square test" is usually generated as the sum of squared individual cell deviations from the "expected" = products of row and column sums divided by the total sum. As such, one can compare the individual cell contributions to the sum to the critical value of a chi-square with 1 d.f. It is a fairly simple task to modify the chisq.test() code to return the cell chi-squares. I just added:
cell.chisq = (x - E)^2/E,
to the structure call at the end. They won't get print()-ed, but you can assign the result to an object and use:
obj$cell.chisq
See the fifer package for function chisq.post.hoc()
Not sure if it works for your problem but I read an article which uses the following to perform pairwise chi-sqr test
rcompanion::pairwiseNominalIndependence()
精彩评论