[R-sig-eco] Time series and GLS

Nicholas Lewin-Koh nikko at hailmail.net
Wed Jan 6 17:40:37 CET 2010


Hi Lisa,
The point of including time in the model is that your data are
ordered in time. If there is reason to believe that food availability 
at year t has no influence on food availability in year t + 1 
than all you need is success~food. But alas ecology is rarely that
simple
and I would guess that to relate the series you need to model the
auto-correlation,
so something like gls(success~food, corr = corAR1(form = ~ yr)). And of
course that can be extended to
a gam. Also if you run into non-stationarity you might try differencing
your series
ie delta(success)~delta(food). 

Nicholas



> 
> Message: 1
> Date: Mon, 4 Jan 2010 14:05:25 -0800 (PST)
> From: LisaB <lisabaril at hotmail.com>
> Subject: Re: [R-sig-eco] Time series and GLS
> To: r-sig-ecology at r-project.org
> Message-ID: <1262642725636-4252318.post at n2.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Thanks for the very helpful advice.  I've been doing a lot of plotting
> and it
> looks like portions of my time series are linearly related with year, but
> there are clear deviations from this so I've also been looking at using
> gam
> with smoothers, but still have a ways to go before settling on a model
> that
> adequately describes the data.  After describing trends over time for
> nest
> success, I'll eventually want to relate nest success with food
> availability
> (also a time series variable).  Both nest success and food availability
> generally decline over time in a similar way.  Since year and food
> availability are correlated and I probably should not use them in the
> same
> model to describe nest success, but I still need to control for year
> -correct?  Is it valid to specify the general model as: nest success~food
> availability+error even though both the response and explanatory
> variables
> are negatively correlated with time?  I ask because in the "Mixed models
> and
> extensions in R" book, chapter 14 describes a similar problem in which
> they
> leave out year in a model where the explanatory variable exhibited a
> trend
> over time.  However, in other sources I read that this could be a major
> problem.  Sorry for the rather long-winded question.  I'm new to time
> series
> analysis.  Thanks to anyone who can provide some insight.   
> 
> 
> 
> 
> LisaB wrote:
> > 
> > Hello -
> > 
> > I need to analyze some time series data in an ANOVA framework, but am
> > unsure of how to go about it.  I have data on nest success (response) over
> > a 22 year period for two populations.  For each year I have one value of
> > nest success per population.  I am interested in determining 1) whether
> > there are differences in nest success over time between these two
> > populations and 2) what are the trends for each population over time.  My
> > thought is to use GLS and model temporal autocorrelation if the acf
> > function indicates this is an issue, but since population is a categorical
> > variable I'm unsure if this is appropriate.  Any advice would be much
> > appreciated. Thank you. Lisa
> > 
> > 
> > 
> >    
> > 
> 
> -- 
> View this message in context:
> http://n2.nabble.com/Time-series-and-GLS-tp4240700p4252318.html
> Sent from the r-sig-ecology mailing list archive at Nabble.com.
> 
> 
>



More information about the R-sig-ecology mailing list