Incorporation of survey specific covariates

113 views
Skip to first unread message

Georgina Chow

unread,
Mar 3, 2023, 7:40:47 AM3/3/23
to unmarked
Dear all, 

I am new to using 'unmarked' but am trying to run an occupancy model looking at occupancy of warty pigs (indirect signs) in grid squares across a National Park. Due to the data I was given and limited resources, temporal replicates of the species surveys weren't able to be completed. Multiple transects (2-5) were conducted within each grid square (site), with each transect split by several checkpoints and counted as spatial replicates. These checkpoints were in theory supposed to be equal distances apart, but as with all field surveys due to topography/obstacles meant that this was not the case. I was given the GPS tracking of each transect and used ArcGIS to get their distances. As a result, each repeat in my data frame has a corresponding transect distance in another column (i.e. R1, R2, R3, R4... ; R1_dist, R2_dist, R3_dist, R4_dist...). 

This comes to my problem of incorporating this into the model: accounting for differences in transect/repeat length, in addition to the fact that each site has a different number of replicates (so there are a number of NA values within the data frame). I can't use total distance of all the transects as a covariate as each transect is responsible for a different 1/0 presence/absence value within the data frame and differences in distance will affect detection. From what I understand these are survey specific detection covariates that I am trying to incorporate. 

I have had a deep dive into google and there doesn't seem to be much out there concerning this, since most survey designs have replicates of the same length. I realise that the data collection may seem quite messy and inconsistent, but I am just involved in the data analysis and occupancy calculations.

Thank you in advance for any help given.
Georgina 


Ken Kellner

unread,
Mar 3, 2023, 7:45:23 AM3/3/23
to unmarked
Hi Georgina,

It seems to me that these transects lengths are an observation-level covariate, which you would provide to the obsCovs argument when you create your unmarkedFrameOccu (see ?unmarkedFrameOccu for the help page). It's OK if you have missing observations (NA) in either the actual observations or an observation covariate.

Ken

Georgina Chow

unread,
Mar 6, 2023, 6:07:36 AM3/6/23
to unmarked
Hi Ken, 

Thank you for your fast reply, I thought this might be the case and have added the survey distances as a observation covariate now. However, when I try to incorporate a repeat distance into the model (e.g. m1 <- occu(formula= ~R10_dist~1, data=umf)) - although ideally would require all 11 repeat distance columns, I get the warning message of:
1: Some observations have been discarded because corresponding covariates were missing.
2: 12 sites have been discarded because of missing data.
which I think is to do with the NA values from having different numbers of repeats. Is there any way to fix this so none of the sites are removed? 
I have 11 repeat column distances (obsCov), but different numbers of repeats per site. 

Georgina 

Ken Kellner

unread,
Mar 8, 2023, 10:00:51 AM3/8/23
to unmarked
Hi Georgina,

I think I'm a bit confused about your study design, which may be the reason for the problems with the obs covs.The hierarchy is sites --> transects --> checkpoints, right? What do you consider to be your sampling unit here (i.e., where you are ultimately recording a 0 or a 1), transects, or checkpoints within transects?

If your unit of sampling is checkpoints nested within transects nested within sites, unmarked doesn't directly support such a 3-layer sampling structure. You could pool detections and obs covs (such as distance) across checkpoints within transects, leaving you with just sites and transects. Another potential approach is to make transects your "sites", and checkpoints within transects your sampling occasions, and then include a random effect of (original) site on occupancy.

Ken

Georgina Chow

unread,
Mar 8, 2023, 10:57:07 AM3/8/23
to unmarked
Hi Ken, 

Sorry for the confusion, the hierarchy is sites (aka grid squares) --> transects. 
There were multiple transects conducted within each site (e.g. 1A, 1B, 1C, 2A, 2B) but each had a different number of transects. As the data given to me didn't have any temporal replicates, it was suggested that I use these transects and pool them together, splitting them up to make spatial replicates instead. 

Initially I wanted to make each replicate distance the same for each site, but the checkpoints used for a different point count survey were the only markers I had for the start/end of each pig survey. As all the transects were also different distances in length, it would have been hard for me to split them all up into 400/500m replicate distances since there would be excess transect distance not included in the dataset. To avoid this I therefore decided to split the transects up at each checkpoint, which were supposed to be roughly equal in size and is the primary reason as to why all my (spatial) replicates have differing lengths. This has caused a different number of replicates for each site (gird square). 

I've inserted an image of what my data frame looks like, with 'R' = the spatial repeat number (section of transect). I hope this helps the study design make a bit more sense now and I'm aware that the design might be a bit messy. 
Again thank you for your help with this.

Georgina 

occu data frame.png

Ken Kellner

unread,
Mar 8, 2023, 11:19:12 AM3/8/23
to unmarked
OK thanks. Your data frame looks correct to me. I think the issue is with the specification of the obsCovs. What you should do for the obsCovs is extract from the data frame columns R1_dist to R11_dist and turn them into a separate matrix called e.g. "dist" with dimensions nsites x 11. Then in your call to unmarkedFrameOccu, you would pass this in the form of a named list to obsCovs, e.g.

umf <- unmarkedFrame(y = y, siteCovs=[DATAFRAME WITHOUT R1-R11], obsCovs=list(dist = dist))

If you had other observation covariates you would make matrices out of them also and include them in the list, e.g. obsCovs = list(dist = dist, cov2 = cov2)
Then in your model your formula use the name from your list, something like ~dist~[SITE COVS]. This will line up the appropriate distance values with the appropriate observations.

Ken

Georgina Chow

unread,
Mar 8, 2023, 11:53:12 AM3/8/23
to unmarked
Thank you so much for your help Ken! You've been super helpful and the models are now up and running.

Best wishes, 
Georgina 

Reply all
Reply to author
Forward
0 new messages