Yoichiro et al.,
During our call last week, we talked briefly about (potentially) adding a random slope effect to the N-Mix model, rather than assuming all sites have the same trend. Although I think the consensus is that there may not be a lot of among-site trend variation, I think it would be useful/interesting to quantify this variance component. If all sites are doing the same thing over time (or not) that's important to know. Below is some code that I think should do the trick (just showing the linear predictor and the random slope prior, etc). I did not push a new R script since I did not test this. We can decide to do this or not as a group, just thought I would follow-up on this topic.
Abundance model
for(i in 1:nSites){
for(j in 1:nYears){
N[i,j] ~ dpois(lambda[i,j])
log(lambda[i,j]) <- mu + (trend + slope.ran[i])*(j-1) + site.ran[i,j] + year.ran[j] + eps[i,j]
}
}
for(i in 1:nSites) {
slope.ran[i] ~ dnorm(0,tau.slope) # random slope effects
}
sd.slope ~ dunif(0,10)
tau.slope <- pow(sd.slope,-2)
….
Yoichiro et al.,
During our call last week, we talked briefly about (potentially) adding a random slope effect to the N-Mix model, rather than assuming all sites have the same trend. Although I think the consensus is that there may not be a lot of among-site trend variation, I think it would be useful/interesting to quantify this variance component. If all sites are doing the same thing over time (or not) that's important to know. Below is some code that I think should do the trick (just showing the linear predictor and the random slope prior, etc). I did not push a new R script since I did not test this. We can decide to do this or not as a group, just thought I would follow-up on this topic.
Abundance model
}
sd.slope ~ dunif(0,10)
tau.slope <- pow(sd.slope,-2)
….