Skip to content
Prev 985 / 7420 Next

Time series and GLS

On Sat, Jan 2, 2010 at 3:34 PM, LisaB <lisabaril at hotmail.com> wrote:
Hi Lisa -- I didn't realize that was you in the first email -- all is
well, thanks.

To answer your first question, assuming normality and linearity I
would say that success ~ year*population is indeed a good place to
start.  The right-hand side expands to 1 + year + population
+year:population, and those 4 terms respectively will produce
estimates of the baseline (probably level A) intercept, baseline
slope, adjustment of that line up or down for population B, and
adjustment of the slope of the line for population B. So, for example,
for population B the predicted increase in mean success for a one unit
increase in year would come from the sum of the beta-hats from the 2nd
and 4th terms.  Checking for population effects could be an LRT
between models with and without the last two terms.

To answer the second question, you would be interested in modeling
autocorrelation within each of the two trajectories.  So if for
example an AR(1) structure was appropriate the correlation argument
could be specified as AR1(form = ~year | population)

Be sure to do lots of plotting as you build and check your model. I
would use lattice or ggplot to plot the fits within populations and to
get a feeling for the plausibility of linearity of the relationships,
normality and homogeneity of scatter around the two lines, and
independence.  As you mention, independence can be further checked
with an ACF plot (and semivariograms are useful for time series as
well as spatial data).  QQ plots of resids within populations are good
for normality checks and you can calibrate your judgement for 22
sample points by repeatedly using something like

par(mfrow = c(5, 5), mar = rep(1, 4))
for (i in 1:25) qqnorm(rnorm(22), main = '')


best,

Kingsford