I have count data of a species and would like to analyze the population trend over the years. The species was count twice a year (early summer and late summer --> column "season") for several years on different sites. The model I have set up is the following:
gam(count ~ s(site, bs = "re") + s(year) + season, data=mydata, family = nb)
If I want to include a correlation structure
gamm(count ~ s(site, bs = "re") + s(year) + season, data=mydata, family = nb, correlation = corAR1(form=~year|site))
I get an error since I have two observations for each year and site. The solutions I can think of are:
- Limit the analysis to one season -> only one count per year and site
- Sum the counts per year and site -> only one count per year and site
I don't like the first one since I use only half of my data but I also think that it might be the only way since I know that higher counts in early summer lead to higher counts in late summer - does this mean my data is not independent?
What is the best way to analyze this data?
Thank you very much for your help!