estimates coming up as 0

31 views
Skip to first unread message

Sunny Murphy

unread,
Jun 25, 2025, 2:53:15 PMJun 25
to distance-sampling
Hi all, 

I'm trying to figure out why code I've used previously suddenly isn't working. All of a sudden when I specify the region, observation, and sample tables, my estimations are all 0. Then, even when I make a new species-specific dataframe and specify all those tables, it still doesn't want to work. This happens no matter the model type: hr/hn/unif. All formatting and units are correct. What is going on?

Note that I was able to get a proper estimate by using a species-specific dataframe and using the third block of code below, so the immediate problem is resolved. But I'm still curious as to what's going on with the first two blocks and why they're not working. 

pilotset.dht (856 observations of 8 variables): 

ds(data = pilotset.dht, transect = "point", key = "hr", + formula = ~(as.factor(Habitat)), region_table = rgntbl, + sample_table = coysmpls, obs_table = coyobstbl, + cutpoints = bin.cutpoints, convert_units = conversion.factor)

species-specific dataframe--coyobs.df (68 observations of 8 variables): 

ds(data = coyobs.df, transect = "point", key = "hr", + formula = ~(as.factor(Habitat)), region_table = rgntbl, + sample_table = coysmpls, obs_table = coyobstbl, + cutpoints = bin.cutpoints, convert_units = conversion.factor)

(Results attached for above code blocks) 

the one that worked (same dataframe as second block of code, just no specified observation/sample/region tables): 
ds(data = coyobs.df, transect = "point", key = "hr", + formula = ~(as.factor(Habitat)), cutpoints = bin.cutpoints, + convert_units = conversion.factor)

(Results not attached for the above block) 
Screenshot 2025-06-25 142400.png
Screenshot 2025-06-25 141940.png

Eric Rexstad

unread,
Jun 26, 2025, 4:36:08 AMJun 26
to Sunny Murphy, distance-sampling
Good morning Sunny

Based upon your description, my first suspect would be the region, sample and observation tables are mis-specified. Looking at the output, it seems you do not have a stratified design, so the region table and sample tables should be quite easy to construct. If you would like to send along all three tables off-list, I can have a look to see if I spot the problem.

From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Sunny Murphy <sunny....@gmail.com>
Sent: 25 June 2025 19:53
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] estimates coming up as 0
 
--
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 visit https://groups.google.com/d/msgid/distance-sampling/6e5b96c4-b193-415e-b202-d2080a21c450n%40googlegroups.com.

Sunny Murphy

unread,
Jul 8, 2025, 10:43:53 AMJul 8
to distance-sampling
Hi Eric, 

My mistake, I actually attached the wrong screenshots. I forgot that I had gone back and edited the code to remove the stratification before posting this. Since I've already resolved the issue, I'm just going to leave it be, otherwise I'd have to go back and redo the code. 

Thank you! 

Eric Rexstad

unread,
Jul 8, 2025, 11:17:20 AMJul 8
to Sunny Murphy, distance-sampling
Sunny

Happy for you to leave this alone, given you've resolved your issues.

Sent: 08 July 2025 15:43
To: distance-sampling <distance...@googlegroups.com>
Subject: Re: [distance-sampling] estimates coming up as 0
 
Reply all
Reply to author
Forward
0 new messages