Error when using dht2 - Distance package in R

45 views
Skip to first unread message

Paula GM

unread,
Aug 7, 2024, 5:15:34 AM8/7/24
to distance-sampling
Hello all,

I would like to use the dht2 function in the Distance R package to compute abundance estimates for each of my regions (years of sampling) and their variance. Although I have sucessfully obtained abundance estimates simply using the ds function, I would like to explore and compare the results obtained through the dht2 function, especially the variance.
When I try to use the function for any of my species, I get the following error: 
Error in dht2(ddf = list(list(call = ddf(dsmodel = ~mcds(key = "hr", formula = ~log_size),  :
  Some transects have Effort <=0 or NA

Our sampling design consists of line transects. I have checked that all segments have effort > 0, are not NA and also the class of the column (numeric), but the error still pops up.
Does anyone know what could be the cause of this error? What I could be missing?

Thank you very much in advance, this list has solved and clarified many doubts for me so far! Regards,
Paula.

Eric Rexstad

unread,
Aug 7, 2024, 7:13:40 AM8/7/24
to Paula GM, distance-sampling
Paula

There is misunderstanding about the use of the dht2 function that appears occasionally. The use of this function is restricted to situations where you have a stratified design and want an overall estimate across strata treated in a particular manner. In your situation, where you are considering strata to be the years of repeated surveys, I would be surprised if there was biological interest in the sum of estimates across years.

If my supposition is correct, then you need not use dht2 thereby circumventing whatever hassles you are having. If you are using Region.Label as year, then the output coming from the ds function will provide you with year-specific estimates, which I think is what you require.

If I have misunderstood your question, please provide additional details.

From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Paula GM <paulag...@gmail.com>
Sent: 07 August 2024 10:15
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] Error when using dht2 - Distance package in R
 
--
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/d3fbc578-a26d-48c1-95b7-80421a475c4an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages