Stacking years in occupancy model and use of random effects

75 views
Skip to first unread message

Christopher Dennison

unread,
Apr 10, 2024, 1:31:47 PMApr 10
to unmarked
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:

vl100m_random.png

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 🐜

Marc Kery

unread,
Apr 10, 2024, 2:13:17 PMApr 10
to unmarked
Dear Christopher

yes, for a stacked-data analysis, I'd do exactly the same as you do. Defining random site effects will account for the relatedness in the response due to whatever varies between sites, remains constant over time, and affects y. 

This analysis does not account for any temporal autocorrelation. But for better or worse, most analyses of time-series in ecology currently still ignore potential serial correlation, so....

Best regards  --- Marc


From: unma...@googlegroups.com <unma...@googlegroups.com> on behalf of Christopher Dennison <christophe...@gmail.com>
Sent: Wednesday, April 10, 2024 19:31
To: unmarked <unma...@googlegroups.com>
Subject: [unmarked] Stacking years in occupancy model and use of random effects
--
*** Three hierarchical modeling email lists ***
(1) unmarked (this list): for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology: for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2021) and Schaub & Kéry (2022)
---
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/unmarked/94d7ae71-b6d5-4180-bca6-dd46f3260fe9n%40googlegroups.com.

Jim Baldwin

unread,
Apr 10, 2024, 2:24:49 PMApr 10
to unma...@googlegroups.com
Unless the individual detection probabilities are 0.8 or greater with having just 2 visits, my experience is that occupancy is not well estimated even with a large number of sites.  From the example you give I can't tell if that is the case as I don't know the range of values for year and date to be able to estimate a range of detection probabilities.  Can you share the range of those values?

Thanks,

Jim

--

Christopher Dennison

unread,
Apr 10, 2024, 2:30:44 PMApr 10
to unma...@googlegroups.com
Afternoon Jim and Marc,

Thank you both so much for your time and support.

The range of years is 2021-2023 (so 3 years) and range of dates is (Julian dates) 153 - 180.

If it helps, the probability of detection for the species in this case is 0.666 (how ominous haha).

Again, really appreciate your support! Thank you 🐦🌱


You received this message because you are subscribed to a topic in the Google Groups "unmarked" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/unmarked/Yw4K-qCCZAc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to unmarked+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/unmarked/CAJCKiwzWQimPW7DRi-ik%3DStSOTK1Rexi3BSc3G2nv94hW8z3sQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages