[R-sig-eco] Mixed effect (intercept) model with AR1 autocorrelation structure

Gavin Simpson gavin.simpson at ucl.ac.uk
Thu Jul 18 06:06:50 CEST 2013


On Wed, 2013-07-17 at 16:10 +0000, Henkelman, Jonathan wrote:
> Perhaps I should clarify.  There is a time-series trend -- daily
> temperature fluctuates randomly throughout the summer.  But there is
> not a clear long-term signal.  I have modelled the time-series effect
> using a gam to see if that can adequately compensate for the effect.
> However, I believe this is a fundamentally flawed approach:
> 
> 1) We are not interested in modelling the time-series; it merely is a
> way of estimating the temperature response in plot.  That is, I don't
> want to ask the question, can I predict the temperature given the
> treatment and the date, but rather, is there a treatment effect.  My
> inference ability is badly reduced if a model a gam.

It is *irrelevant* whether you want to model the time series. You *must*
model it either via the fixed effects or in the covariance matrix of the
residuals.

You have two options:

1) include a time effect (either linear or spline) plus possibly a
simple time series model for the residuals (AR(1) would be a start).
Your null would include the time effect thus you can assess the effect
of Treatment relative to this null.

2) proceed as you did but use a much more complex ARMA model for the
residuals. AR(1) is clearly inappropriate with such a high \phi
estimate.

Which is most useful will depend on the data; it sounds as if you don't
have a deterministic trend as you seem to be describing a stochastic
trend. However, I'd be very surprised if you didn't have a cyclic
temperature effect with temperatures varying smoothly through the year
in a seasonal signal/cycle, with noise superimposed. But I am just
guessing.

Perhaps start with the mixed effects and **no** correlation structure if
you don't want to do 1). Extract the normalised residuals and look at
the ACF and the PACF of these. That will help identify what order ARMA
model might be needed. Then add the correlation structure with
corARMA().

I didn't notice you were at USask; I move to the UofR a few months ago.
If it would help to discuss offlist, my UofR contact details are in the
footer.

HTH

G

> 2) The current analysis is for a single season.  In a few years we
> will be re-running this analysis of 5 years of data.  I do not expect
> the random fluctuation in seasonal temperature will be the same each
> year.  Hence, while this analysis sort of works now, it won't in the
> future.  However, it seems reasonable to model the autocorrelation
> effect within the time-series as constant through time.
> 
> 3) When I look at the process of temperature I can say, yes today is
> more likely to be similar to yesterday than the day before.  There is
> autocorrelation and random fluctuation, hence it makes sense to model
> it this way.  For the record, as simple AR1 model better account for
> the seasonal fluctuation than a gam, and my ARMA(2,0) model does an
> even better job.
> 
> Hope this helps, J
> 

-- 
Gavin Simpson, PhD                          [t] +1 306 337 8863
Adjunct Professor, Department of Biology    [f] +1 306 337 2410
Institute of Environmental Change & Society [e] gavin.simpson at uregina.ca
523 Research and Innovation Centre          [tw] @ucfagls
University of Regina
Regina, SK S4S 0A2, Canada



More information about the R-sig-ecology mailing list