Poisson regression for change in count following an event I have a count of sickness absences before and after an accident,
and I want to find out whether an accident increases the sickness
absences differently in different groups.
I'm trying to formulate a Poisson model for this, but I'm not
sure if I'm doing it correctly, or if I should be doing something
completely different.
Some of my subjects have an accident (once), and I have split the
data to two rows for such persons, before and after the
accident. Some never face an accident, and so they always count
as healthy, and therefore they only have one row in the data. I
have a variable ("state") which indicates whether the row concerns time
before or after accident.
The model I've come up with:
fit <- glm(count~state*group+age, family="poisson", data=d)

Is this a correct approach?
To take this further, I would also like to take into account
person years the subjects are in the study before and after
accident. 
Would adding +offset(log(person_years)) to the dependent variables achieve this?
 A: You might consider segmented regression, treating the accident as the interruption point. 
All times series analyses are expansions of an ordinary interrupted time series analysis. Ordinary interrupted time series (ITS) and interrupted times series break a time series into two time series, one before the interruption and one after, calculates a trend line to fit each line, and compares the differences. Differences in both the slopes and the intercepts of the two lines (before and after) are commonly compared. A regressive interrupted time series (RITS) does the same thing as ordinary time series, but rather using a sum of a value for a time series, the component data points are instead used as independent observations, and a regression is performed on the pre-and post-interruption time series. Segmented regression is an extension of RITS that deals with lagged effects. Segmented regression models the current level of a variable as a function of the pre-treatment intercept (b0), the count of time periods since the initial intercept (b1), the presence or absence of the treatment (b2), the time since the intervention (b3), and control variables (I hope). This controls for initial conditions, unrelated/independent changes over time, the presence/absence of the treatment, and the duration of the treatment (Wagner 2002). 
Y_t=B_0+B_1*〖time〗_t+B_2*interventiont+B_3*〖time after intervention〗_t+e_t
Wagner, A. K., Soumerai, S. B., Zhang, F., & Ross‐Degnan, D. (2002). Segmented regression analysis of interrupted time series studies in medication use research. Journal of clinical pharmacy and therapeutics, 27(4), 299-309.
