In this notebook, we fit a Poisson GEE to the epilepsy data from the MASS library in R. The data come from a study in which the number of seizures was recorded on each of 236 subjects over a 16 week period, with a treatment introduced at the end of week 8. The seizure counts were binned as follows: weeks 1-8, 9-10, 11-12, 13-14, and 15-16. This is a longitudinal data set with five measurements per subject, and there is likely to be within-subject dependence.

In the analysis below, the total number of seizures during the first 8 weeks is treated as a baseline measure, and the effectiveness of the treatment is based on the seizure counts for weeks 9-16 (binned into 4 intervals that are each 2 weeks in duration).

We can start with a plot that shows how the baseline seizure count is related to the seizure count in each of the 4 follow-up periods. It is clear that subjects having more seizures in the baseline period also had more seizures in the follow-up periods. We use the square root transform to reduce skew (note also the the square root transform is the variance stabilizing transformation for the Poisson distribution).

Consistent with the scatterplot shown above, subjects with a greater number of baseline seizures have more seizures in the followup period. The standard deviation of the number of baseline seizures is 26.7, so a subject who is 1 standard deviation above the mean number of seizures during the baseline period has on average exp(26.7*0.0226) = 1.7 times more seizures during the follow-up period (compared to a subject whose baseline value falls at the mean). There is also a positive association between age and the post-treatment seizure counts: every additional decade of age is associated with exp(10*0.0223) = 1.25 times more seizures. The subjects in the treatment arm have fewer seizures, but there is no statistical evidence of a treatment effect.

The scale parameter is estimated to be around 5:

In [5]:

result1.scale

Out[5]:

5.0873839366294833

This means that the variance is around 5 times the mean. This is a sign of substantial overdisperion, since the variance of a Poisson distribution is equal to its mean, hence the scale parameter should be approximately equal 1 if the data follow a Poisson regression model.

Next we plot the empirical mean/variance relationship, by plotting the mean of the repeated measures for each subject against the corresponding variance (note that this does not account for the effects of the covariates). In the log/log plot, the relationship is roughly linear with a slope that is much greater than 1, reflecting the overdispersion noted above.

The exchangeable working dependence structure gives the same parameter estimates and standard errors in this case as the independence structure, but we learn from the exchangeable model that the within-subject correlation coefficient is roughly 0.4.

Comparing the autoregressive and exchangeable models, we see that the regression coefficients are quite similar. Nevertheless, we can probe the dependence structure a bit more by making a plot of the empirical correlation between residuals as a function of the time spacing. Here the time point values are 0, 1, 2, 3, which are the default integer time values for the four post-treatment measurements. The plot below suggests that the dependence decreases with time, so the autoregressive structure seems to be more suitable.

In [9]:

fig=result1.plot_isotropic_dependence()plt.grid(True)

Next we look at how one of the regression parameters (the age effect) changes as we hold the autocorrelation parameter fixed at various values. The broken vertical line shows the estimated autocorrelation parameter.