2

Question

How can I perform a post-hoc test after a Poisson regression to know which group differ from which other group?


Dummy Data

Here are some dummy data (coded in R)

set.seed(9)
y = c(rpois(100,6),rpois(50,8))
x = rep(LETTERS[1:3],each=50)
d=data.frame(x=x,y=y)

and here is a Poisson regression showing a highly significant effect of x on y.

m = glm(d$y~d$x, family=poisson(link = "log"))
anova(m, test="Chisq")

My thoughts

The only thing I could think of is to perform a series of Poisson regression on subsetted data and then chose some method to correct for multiple testing. Does it seem like a valid solution to you?

dAB = d[d$x!="C",]
    m = glm(dAB$y~dAB$x, family=poisson(link = "log"))
anova(m, test="Chisq")


dBC = d[d$x!="A",]
    m = glm(dBC$y~dBC$x, family=poisson(link = "log"))
anova(m, test="Chisq")

dAC = d[d$x!="B",]
    m = glm(dBC$y~dBC$x, family=poisson(link = "log"))
anova(m, test="Chisq")

pvalues = c(9.504e-5,0.6552,9.504e-5)
p.adjust(pvalues, method="holm")
[1] 0.00028512 0.65520000 0.00028512

As expected the only two groups in x that do not significantly differ are group A and group B.

Remi.b
  • 4,572
  • 12
  • 34
  • 64
  • There are a number of packages that can help with this, such as lsmeans, multcomp, effects, ... For example, `library(lsmeans);` `lsmeans(m, pairwise~x, type="response"))` – Russ Lenth Feb 08 '16 at 01:43

0 Answers0