Hello group,

I have a question about how to code a model with autocorrelation in the
residuals. I have abundance data of birds  in three different habitats.
Each habitat has been sampled with mist nets for three times a year  (early
rainy, late rainy, dry seasons) for seven years continuously. Therefore in
total I have 21 temporal repeated measures of each habitat. I am interested
in testing the effect of  habitat and  seasons in the abundance of birds.
Since I have temporal repeated measures I wish to include that
non-independence in the residuals. ACF plots show that there is auto
correlation.

I have been thinking about two options:
1) Include an autocorrelation of  residuals in the model. For that I have
been using the following code:

model<- gls (abundance ~ habitat * seasons, correlation = corAR1(form = ~
periods|habitat))

periods is the variable that contains the temporal replicates.

2) A linear mixed model, using a random term for the temporal replicates. I
am not sure how to code for this. I have been using:


model<-glmer(abundance ~ habitat * seasons + (1|periods), data= coira,
family = gaussian)

But I think this code is saying that I have 21 groups. In other words in
saying that there is not independence in samples from the same period
across habitats, but it is not specifying for non independent repeated
measures for the same habitat.



Any advice in my approach and coding will be highly appreciated it.

Thank you for your help,
Boris Tinoco

	[[alternative HTML version deleted]]

