I am trying to model disease counts (d) by using population (p) as offset to control for exposure. In R, I found two possible ways to go:
m1 <- glm(d ~ 1 + offset(log(n)), family=poisson, data=dat) m2 <- glm(d ~ 1, family=poisson, data=dat, offset=log(n)) The summary of my and m2 shows that summary(m1) = summary(m2) but if I try to calculate the McFadden through the pR2 (pscl package): McFadden(m1) ≠ McFadden(m2).
Does someone have an explanation for that?
dat- it'd be useful to illustrate the issue using one of the built-in datasets, as well as providing the rest of the code to calculate McFadden's $R^2$. See stackoverflow.com/help/mcve. $\endgroup$