[R-sig-ME] Incorporating a Temporal Correlation Structure in a GLM

Ben Bolker bbolker at gmail.com
Wed Feb 22 02:15:49 CET 2012


Kevin J. Ryan <Kevin_J_Ryan at ...> writes:


> I'm attempting to use mixed-model logistic regression to model
> spadefoot emergence as a function of weather variables (individuals
> are monitored continuously from 1-84 days [with gaps]).  However,
> the weather variables are serially autocorrelated, apparently at a
> lag of 12 days or so.  Does anyone have experience incorporating a
> temporal autocorrelation structure of predictor variables into a
> glm?  I've been examining the lme4 package but it does not appear to
> be able to do this.

  A couple of quick thoughts:

* you could use glmmPQL (in the MASS package), which does allow any
of the correlation structures that are defined in the nlme
package (including corCAR1, which allows for gappy data). This
is not preferred for binary data, but probably (?) correcting
for correlation and using a slightly questionable estimation method
is better than ignoring correlation.

* if your responses are measured without error you might
be able to use emergences at a previous time point as
a predictor.

* you could just use glm (or whatever) and evaluate the correlations
among the residuals -- if there's nothing going on there then you
have a reasonable excuse for proceeding without a correlation model.

* the fact that the _predictor_ variables are autocorrelated isn't
that much of a big deal -- it's really the response (or rather the
residuals of the response) that you should be worried about, although
there is always a bit of an issue in time-series analysis in
looking at relationships of autocorrelated series with other
autocorrelated series ...

* generalized estimating equations (GEE: see geepack etc.) are
another approach, although I don't know if any of the R packages
that do GEEs have an option for autocorrelations on unevenly
spaced data (try installing the "sos" package and searching
via something like findFn("gee uneven"))

* in my opinion the gold standard (if the data are rich enough
to warrant it) is to build a hierarchical model with a latent
normally distributed variable with temporal autocorrelation and
an observed binary variable (emergence) on top of it, but this
is fairly hard work -- you'd need AD Model Builder or some
dialect of BUGS.

 I will be interested to see if anyone has better suggestions.

 I would check the books from Highland Statistics (Zuur et al.)
to see if they have anything useful ...




More information about the R-sig-mixed-models mailing list