statsmodels/statsmodels — pull request #2018 by kshedden (2014-09-28 21:34:02+00:00)
Title: Regression graphics for GLM and GEE

This PR adds three diagnostic plots for GLM and GEE. Most of the code is shared between GLM and GEE.

I discovered a few missing things in GEEResults (family, various types of residuals) that are needed to make the plots work generically between GLM and GEE, so I added them.

The idea behind the CERES plot is a bit complicated. I believe that the implementation is correct, but the example in the test script doesn't highlight the technique well (it is an example where theoretically you don't need the CERES plot, the partial residual plot is adequate).

One possible extension is to allow the "focus" variable to be more than a single variable, e.g. a set of basis functions or indicators derived from a common underlying variable. I haven't figured out a clean way to do that yet, so am leaving it out for now (the approach has been defined in the literature, but implementing it involves figuring out which variables should be grouped)

The plots generated by the test script are here:

http://dept.stat.lsa.umich.edu/~kshedden/test_genmod_added_variable_plot.pdf
http://dept.stat.lsa.umich.edu/~kshedden/test_genmod_partial_residual_plot.pdf
http://dept.stat.lsa.umich.edu/~kshedden/test_genmod_ceres_plot.pdf