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.
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))
model_po <- glm(DEATHS ~ AGE + AGE^2 + SMOKE + SMOKE*AGE + offset(log(PERSON_YEARS)), family = poisson(), data = df)