bug with density function

29 views
Skip to first unread message

Jéssica Melo

unread,
Mar 29, 2023, 9:15:53 AM3/29/23
to distance-sampling
Hi,

I'm trying to get density values, but I think there's a bug with the summary() function and print(data, report="density"). The last one gives me the abundance not the density, and the summary gives me just 0 values, as follows:

Density:
          Label Estimate se cv lcl ucl df
1      Costeiro        0  0  0   0   0 12
2 Intermediario        0  0  0   0   0 26
3      Oceanico        0  0  0   0   0  2
4         Total        0  0  0   0   0  0

any help would be appreciated.

Best wishes,
Jessica
--


Eric Rexstad

unread,
Mar 29, 2023, 12:05:56 PM3/29/23
to Jéssica Melo, distance-sampling
Jessica

I think you are producing output from dht2​ is that correct? There may be rounding issues associated with the print​ functions for dht2​ objects.  I think you can examine the dht2​ object manually. You might see the "unrounded" values there. I suspect the densities are quite small and that is why they are rounded to zero when printed.

Can you follow up on any of these ideas so we can track them in more detail.

From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Jéssica Melo <jessic...@pctsb.org>
Sent: 29 March 2023 14:15
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] bug with density function
 
--
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/CAN4VzkGGc%3Dm_0qDrObwYnxBRBEtiAN_7unHPsEHsNDzMPr_iPQ%40mail.gmail.com.

Jéssica Melo

unread,
Mar 29, 2023, 2:03:51 PM3/29/23
to Eric Rexstad, distance-sampling
Hi Eric,

the output is from ds, but I did it with dht2 and it also gave me 0. When you say to do manually, is it dividing the abundance by the covered area?

Best wishes,
Jessica
--


Eric Rexstad

unread,
Mar 30, 2023, 3:14:49 AM3/30/23
to Jéssica Melo, distance-sampling
Jessica

OK, incorrect diagnosis on my part. Why don't you send me either the full output from your ds​ analysis, or the object created by your call to ds​ via

output <- ds(<stuff>)
save(output, file="jessica.RData")

send me the jessica.Rdata​ file as an attachment. I can diagnose more effectively that way.


Sent: 29 March 2023 19:03
To: Eric Rexstad <Eric.R...@st-andrews.ac.uk>
Cc: distance-sampling <distance...@googlegroups.com>
Subject: Re: [distance-sampling] bug with density function
 

Jéssica Melo

unread,
Mar 31, 2023, 8:06:20 AM3/31/23
to Eric Rexstad, distance-sampling
Hi,

the solution for this question was satisfied by Dr. Eric: the problem was with the object column that should be converted from character to number.

exemple:
data$object <- seq(1:length(data$Effort))

Thank you very much!
Jessica
--


Reply all
Reply to author
Forward
0 new messages