0

I have autocorrelated data that show a positive linear increase. When I model them using gls, I think the summary shows overdispersion.

When using GLMM etc I'd change error structure, but I don't think I can change family in gls. Is there a way to address overdispersion in a gls model?

library(nlme)    

eggs<-c(4087,2761,3807,4158,2046,4757,2984,3316,3143,
3042,4429,3335,5124,2464,3713,3028,5739,4671,3799,6167,2937,5031)

year<-seq(1997,2018,1)

m1<-glm(nest~y)

summary(m1)

acf(resid(m1),type="p")

Residuals show autocorrelation at one year, so I need to use gls

m1.gls<-gls(nest~y,correlation=corARMA(p=1), method="ML")

summary(m1.gls)

acf(resid(m1.gls),type="p")

m0.gls<-gls(nest~y,correlation=NULL,method="ML")

AIC(m0.gls,m1.gls)

anova(m1.gls,m0.gls)

#L.Ratio = chisqu = 7.382355; p = 0.0066
#autocorrelation definitely significant

null.gls<-gls(nest~1,correlation=corARMA(p=1), method="ML")

anova(m1.gls,null.gls)

#L.Ratio = chisq = 7.956113; p = 0.0048
#linear trend is significant

summary(m1.gls)

#residual se = 970 over 22 df
#does this show overdispersion?

Is this model unacceptably overdispersed? Is there another model I can try for a better fit?

Laura
  • 1
  • 1
  • The way this is currently written it looks more like a statistics question than a coding question. You might have better luck over at [Cross Validated](https://stats.stackexchange.com/). The Gaussian distribution can't be overdispersed like distributions where the variance depends on the mean can. So if it is reasonable to assume normality of errors you may be fine to model things with `gls()` if other assumptions check out. If not, you may want something like package **glmmTMB**. – aosmith Apr 23 '19 at 15:11
  • Right. Thanks so much for your help. – Laura Apr 23 '19 at 15:15

0 Answers0