I am looking for a "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
Yet besides that article I can not find an R package to do this with, or any other form of software. I hope that I am just badly informed
My situation is of just making a Chi-Square test, on a 2 by X matrix. I found a difference, but I want to know which of the subjects is "responsible" for the difference.
This has been asked here before, but it was unanswered. Has anything changed in the meantime? I am looking for this as well.
Best Answer
Having a significant chi-square does not necessarily mean that ONE subject is different from the others. However, IF this is the case, one way to approach this is to fit a logistic regression model and follow it up with contrasts that compare each prediction with the average of the others.
Here's an example. First, a fake dataset:
Fit a logistic regression model and get the deviance
The deviance statistic is a chi-square test, but not the same as the Pearson chi-square often used. A chi-square of 22.486 with 4 d.f. is significant.
The lsmeans package provides one way to obtain post hoc contrasts. Other possibilities include multcomp and effects.
The above table summarizes the predicted values of $\log\{p/(1-p)\}$, and ther SEs and confidence intervals. You may also obtain a visual display of these results:
The following obtains estimates and associated $t$ statistics comparing each of these with the average of the others:
We find that subject 4's prediction is significantly greater than the average of the others'. The FDR (false discovery rate) is the default adjustment for multiple testing when
del.eff
contrasts are specified. It seems appropriate for this kind of application.If you prefer, you may instead do this analysis in terms of the predicted values of $p$, instead of the logits.
... and use similar commands on this object to obtain contrasts or a plot.
These methods are probably not exactly the same as the reference you link, but they get at the same thing.