dht2 for stratified abundance estimates derived from mrds model

43 views
Skip to first unread message

Evan Curtis

unread,
Nov 22, 2021, 11:03:38 PM11/22/21
to distance-sampling
Hi all,

I have mark-recapture distance-sampling aerial survey data temporally stratified within a region of interest. Specifically, there are 12 replicate surveys within the 1 region of interest. Each replicate survey has 4 transects.
I've identified the following mrds ddf() model:

MRDS.6a=ddf(
  dsmodel=~mcds(key="hn",formula=~side+obsname),
  mrmodel=~glm(~obsname + size),
  data=survey.data,
  method="io",
  meta.data=list(binned=TRUE,point=FALSE,width=300,
  breaks=c(0,50,100,200,300)))

I want to derive abundance and variance estimates with respect to each replicate survey using the ddf() model outlined above. I use dht2():

FG.roo.MRDS <- dht2(ddf = MRDS.6a,
                    flatfile = flatfile.mrds,
                    stratification = "effort_sum",
                    strat_formula = ~Rep,
                    er_est = "R2",
                    ci_width = 0.95)

my flatfile contains all five essential columns + the three covariates used in the mrds model. The error I can't get past when running the dht2() model is:

Error in if (ddf$ds$aux$point) "point" else "line" : 
  argument is of length zero

I'm uncertain about where or how to actually specify this information when using ddf(). There are two things I could think of that could be causing the error...

1. My ddf() model does have a similar ?'slot'? but it's address is:
MRDS.6a[["ds"]][["ds"]][["aux"]][["point"]]

2. There are duplicate observations in the flatfile (because observer name is a covariate and it is a mark-recapture model).

All suggestions much appreciated. Thanks in advance!

Evan



Eric Rexstad

unread,
Nov 23, 2021, 3:19:26 AM11/23/21
to distance-sampling, Evan Curtis
Evan

My suspicion about your error message is that dht2​ hasn't been tested with an object containing an mrmodel​ component.  You have already done the detective work to deduce when the dht2​ code goes looking for ddf$ds$aux$point​ it fails to find it.  As you note, the item of interest is in a different location.  Simply toy example (in addition to yours):

library(mrds)
data(book.tee.data)
region <- book.tee.data$book.tee.region
egdata <- book.tee.data$book.tee.dataframe
samples <- book.tee.data$book.tee.samples
obs <- book.tee.data$book.tee.obs
# fit an independent observer model with point independence
result.io <- ddf(dsmodel=~cds(key = "hn"), mrmodel=~glm(~distance),
                 data=egdata, method="io", meta.data=list(width=4))
result.io$ds$ds$aux$point

For now, dht2​ is not usable with models that include an mrmodel​ component.


From: 'Evan Curtis' via distance-sampling <distance...@googlegroups.com>
Sent: 23 November 2021 04:03
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] dht2 for stratified abundance estimates derived from mrds model
 
--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/bdf3444d-abd6-42ac-957c-d933c9ddce60n%40googlegroups.com.

Evan Curtis

unread,
Nov 23, 2021, 3:02:18 PM11/23/21
to distance-sampling
Thanks once again Eric! 
I'll explore a different analysis option for the mrds replicates.

Evan

Reply all
Reply to author
Forward
0 new messages