emmeans - generating and interpreting contrasts

I hope somebody is available to help a desperate rookie..

I fitted a glmer with a Poisson distribution and log link, including main effects and several interactions, an offset variable and a random effect. Something like this:

model1 <- glmer(count ~ A + B + C + A*B + offset(log(X)) + ( 1 | D), data = workmap, family = poisson(link = "log"))

A, B and C are all factors with two levels.

My Prof generated "contrasts of marginal linear predictions" in Stata to, for example, look at the contrasts between A*B, or just simply A. I now want to do the same but in R by making use of the emmeans package.

I did the following:
EMM <- emmeans(model1, pairwise ~ A | B) # to generate means and
PRS <- contrast(EMM, "pairwise") # to generate contrasts
summary(PRS, type = "response", infer = c(TRUE, TRUE)) # pairwise comparison on original scale
Con <- confint(PRS, type = "response", bias.adj = TRUE, sigma = 0.64385, offset = 0) # back-transformed

I got the same p-values as my Prof but totally different values for "ratio" (he uses the Incidence rate ration (IRR). Are "ratio" and the "IRR" the same?), e.g my ratio would be 4.82 and his IRR 0.25.

Also, my df displays "Inf" whereas he gets proper values.

Please please help, it would be greatly appreciated.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.