I am working through the book An Introduction to Generalized Linear Models (4th Edition) by Dobson and am trying to understand question 9.7, which involves comparing Poisson and logistic regression for data from the Doctors Smoking Study to show that the estimates from these models are very close for rare events. I can fit the Poisson model but cannot figure out how to fit a logistic regression model to these data because I don't understand how person years and number of deaths can be expressed as a binary outcome. What am I missing? I read the referenced Mittlbock & Heinzl (2001) paper, but it did not describe how the logistic regression model was actually fit.
Data:
AGE <- rep(rep(1:5),2)
DEATHS <- c(2,12,28,28,31,32,104,206,186,102)
PERSON_YEARS <- c(18790,10673,5710,2585,1462,52407,43248,28612,12663,5317)
SMOKE <- rep(0:1, each=5)
df <- as.data.frame(cbind(AGE, DEATHS, PERSON_YEARS, SMOKE))
df$PROB <- df$DEATHS/df$PERSON_YEARS
df$LOGIT <- log(df$PROB/(1 - df$PROB))
Poisson regression:
model_po <- glm(DEATHS ~ AGE + AGE^2 + SMOKE + SMOKE*AGE +
offset(log(PERSON_YEARS)), family = poisson(), data = df)
model_logit <- glm(cbind(DEATHS,PERSON_YEARS-DEATHS) ~ AGE + AGE^2 + SMOKE + SMOKE*AGE, data=df, family=binomial())
with the aggregate data. Or you could use weights. $\endgroup$cbind(num,den)
I think would be more intuitive thancbind(num,den-num)
.) $\endgroup$cbind(deaths, survival)
is used in logistic regression for grouped dichotomous data would also be appreciated. It is introduced in chapter 7 of the Dobson book (4th ed.) but not explained, and I have not been able to find any good resources online about the concept. $\endgroup$