Video Reference For Single Season Occupancy Model With Categorical and Continuous covariates in R

109 views
Skip to first unread message

Alyssa Davidge

unread,
Sep 15, 2023, 9:39:55 PM9/15/23
to unmarked
Hi All, 

   I'm working through some Cooper's Hawk presence/absence data in unmarked and I'm having trouble finding solid references that aren't deep within a textbook. I do best with applied examples, so I'm wondering if anyone has videos of them working with r code they used for a single-season occupancy model to 1) create occupancy and detection estimates 2) test out models in an AIC table 3) plot the resulting xy graphs of the most parsimonious models with confidence envelopes using a particular covariate (or covariates) on the x and occupancy on the y. 

   I'm having a few particular problems that have prompted this: 
1) I have several categorical variables that r and unmarked do not like to put into the observation covariate category. It is also not possible to generate model predictions with them once I've formatted them into a list to meet the matrix requirements the observation covariates require. 
2) After generating occupancy estimates, it's extremely hard to pull them out of unmarked to plot them neatly with some confidence envelope. When I used the predict function, it ended up looking like a 3-year-old colored all over a graph, so I'm guessing it has to do with not holding all other covariates constant, but I have multiple categorical variables so I'm not sure what the best way to hold those constant would be. I'm not sure what method to use to get the graphs I'm after.

I've spent a lot of time studying this video:
But he never makes xy plots and he doesn't have as much complexity to his data as I do.

I'd really like to see someone tackle this in code, not just in a vignette. Any recommendations?

If you'd like to know more about what my data looks like, I've attached a photo of some of it. I did a stratified random sampling of different redlining grades to look for birds, and then compared the difference in occupancy across grades. 
Column Definitions:
V1-3: Detected(1), Not detected(0)
D_1-D_3: Date of each visit
T_1-T_3: Time of each visit
Obs_1-Obs_3: Observer Identity
VisDist_1-VisDist_3: The visible distance for the observer on each visit
PCT_CAN: Percent tree canopy cover in a 400m2 buffer around each sample point
NDVI: Normalized Difference Vegetation Index in the same buffer as above
Pct_Built: Percent of built area in the same buffer as above
NN: Nearest neighbor measured from each point to the nearest occupied point
GRADE: Redlining grade (4 levels)
X: Point name (A combination of redlining grade level and number 1-40 for the 40 points sampled in each grade)
The y input: 
V1-3
What I'm using as site covariates:
PCT_CAN, NDVI, Pct_Built, NN, GRADE
What I'm using as observation covariates:
D_1-3, T1-3, Obs_1-3, VisDist_1-3Screen Shot 2023-09-15 at 3.42.30 PM.png

Any help is appreciated. 
Thanks,
Ally

Jeffrey Royle

unread,
Sep 19, 2023, 9:22:08 AM9/19/23
to unmarked
Dear Ally,
 I think you might be out of luck in trying to find a detailed video on this topic. That makes me think though... we're probably over-due for producing an online workshop on unmarked at some point, I think producing videos from that would be a good resource.
 At any rate, that doesn't help you now I guess.  I would suggest looking at Chapter 10 of the AHM1 book (in particular, section 10.9 is a very detailed analysis of a data set).  I think you can follow along with that and it should get you pretty far.  
 For your particular data set, I recommend only working with 1 or 2 covariates until you get everything working smoothing and producing sensible results before you expand the model to the full 20 or whatever covariates you have.

regards
andy

Jeffrey Royle

unread,
Sep 19, 2023, 9:22:43 AM9/19/23
to unmarked
I meant to say, please email me off list and I'll send you a PDF of that.
Reply all
Reply to author
Forward
0 new messages