Trouble estimating abundance and reading 'size' column

39 views
Skip to first unread message

Molly McDevitt

unread,
May 11, 2023, 5:06:06 PM5/11/23
to distance-sampling
Hello Distance Sampling Team, 

I am trying to estimate abundance and density for pronghorn in our study area. However, I am getting errors with functions ds(), dht() and dht2() when I include column 'size' in my data. 'Size' in this case, is the number of individuals counted in each group detected. I do not get errors when I run the functions without 'size' in the dataframe.

The data are from aerial systematic line transects (attached as dat.RDS) and my code, including errors I get, is simplified and attached as dsDensityEstHelp.r. 

I have previously been able to run ds() & dht2() without a problem. All said, I'm a bit embarrassed to ask this question here, and am hoping collective brains might help me troubleshoot!

Please let me know if I can provide further information and thank you, in advance, for your help!

Molly

dat.RDS
dsDensityEstHelp.R

Eric Rexstad

unread,
May 12, 2023, 5:47:24 AM5/12/23
to Molly McDevitt, distance-sampling
Molly

Thanks for you note with code and data. No need to be embarrassed about your question. I ran your code and encountered the same error. It seems to be related to an error with which we are already acquainted and hope to be able to fix shortly:


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 a half-norma...
Your analysis does flag up a couple of other matters for you to consider:
  • the estimates of density/abundance seem awkward (when they are produced)
    • presumably because of a units problem. See the convert_units​ function in the package to help produce more meaningfully scaled estimates
    • Abundance:
        Label     Estimate           se         cv          lcl          ucl       df
      1   20A 2.003822e-04 8.788461e-06 0.04385848 1.838212e-04 0.0002184353 304.0000
      2   35A 1.511085e-04 2.189446e-05 0.14489228 1.136239e-04 0.0002009593 133.0000
      3   35B 9.611589e-05 9.428838e-06 0.09809864 7.924424e-05 0.0001165796 193.0000
      4   53A 1.114966e-04 5.027526e-06 0.04509128 1.020057e-04 0.0001218706 170.0000
  • As an approximation you could fit a half normal key function to your data. It will not produce a detection probability of 1.00, as the uniform does, but the estimated detection probability perhaps reasonable P=0.968, with a fit that is plausible (CvM P-value =0.928).
    • The AIC score for the HN model (18142.89) is close to the AIC score for the problematic UNIF model (18142.16), so I would think inference from this model would be valid.
I suspect if you tidy up your units (I'm guessing what units were used in your study)
convert_units(distance_units="meter", effort_units="kilometer", area_units="square kilometer")

You should be good to go.


From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Molly McDevitt <mollymc...@gmail.com>
Sent: 11 May 2023 22:06
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] Trouble estimating abundance and reading 'size' column
 
--
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/0bb95d77-97da-4b4b-b9b8-50031e2fcc1cn%40googlegroups.com.

Eric Rexstad

unread,
May 12, 2023, 5:56:29 AM5/12/23
to Molly McDevitt, distance-sampling
Apologies Molly, I hit the 'send' button too soon, before addressing your final question.

Your survey was designed with strata, so (presumably) you want stratum-specific estimates along with an estimate for the total study area. This is a geographic form of stratification. Using the ds​ function will produce these estimates for you, without the need to explicitly call dht​ or dht2​. It is only if you have used non-geographic stratification that you need to bring dht2​ into play.

From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Molly McDevitt <mollymc...@gmail.com>
Sent: 11 May 2023 22:06
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] Trouble estimating abundance and reading 'size' column
 

Molly McDevitt

unread,
May 12, 2023, 6:56:02 PM5/12/23
to distance-sampling
Hi Eric!

Thank you very, very much for the help/insight, and as you noted, addressing the unif distribution problem solved my problem. I'm sure I'll be back with more questions, and for now, back to the data!

Best,
Molly

Reply all
Reply to author
Forward
0 new messages