Afternoon 'Unmarkers',
This will be the last question from me for a while, I promise (sorry for being a pest).
I have been building occupancy models for a number of bird species using detection histories at 110 sites (2 visits each) from 2021 - 2023 (3 years).
As my primary interest is inferring the effect of environmental covariates on occupancy probability, I elected to 'stack' my data. That is, create a matrix of site-year combinations (110 sites x 3 years 330 rows with 2 visits each).
With the recent addition of random effects through TMB, I have been fitting my models using a site random effect (1|site) to account for pseudo-replication, which I believe is the most appropriate approach. For example, for one species, the model of best fit might look as such:
INBU_vl100m_mod <- occu(formula = ~dates + year
~scale(vl_100m) + (1|site),
data = INBU_stat.sample.unmarkedFrame_cov)
Which gives the output:
Call:
occu(formula = ~dates + year ~ scale(vl_100m) + (1 | site), data = INBU_stat.sample.unmarkedFrame_cov)
Occupancy (logit-scale):
Random effects:
Groups Name Variance Std.Dev.
site (Intercept) 3.788 1.946
Fixed effects:
Estimate SE z P(>|z|)
(Intercept) -2.67 0.537 -4.98 6.50e-07
scale(vl_100m) 1.49 0.383 3.89 1.01e-04
Detection (logit-scale):
Estimate SE z P(>|z|)
(Intercept) -1.1150 7.4517 -0.150 0.881
dates 0.0124 0.0457 0.271 0.786
year -0.0601 0.3207 -0.187 0.851
AIC: 345.9072
Number of sites: 294
optim convergence code: 0
optim iterations: 66
Bootstrap iterations: 0
When plotting vl_100m:
Previous to my discovery of the TMB random effect option, I had followed the advice of stacking without an accompanying random effect, which would lead to underestimated CI / SE in the fitted model, thus the use of the random effect.
I just wanted to gather insight on my use of the random site-effect in this case, to ensure that I am using it properly in my quest for inference using unmarked, and if there are any other avenues for consideration (e.g. stacking without random effect or otherwise).
Again, I must say what an incredible resource this forum has been as I work through these models! Thank you everyone for your time and patience.
- Chris
🐜