Issue on Regions areas

65 views
Skip to first unread message

Jelisa Oliveras

unread,
Nov 10, 2021, 4:41:56 PM11/10/21
to distance-sampling
Hello, 

I was recently introduced to the distance package. I am working with avian and line transect data from 2012-2021. I keep getting this error message: "Error in check data(data, region.table, sample.table, obs.table, formula) : Region areas are not consistent.".  I changed all of my column names and doubled check if there were any discrepancies within my data.

I went even further and separated my data by year, and it worked perfectly. However, the dataset as a whole, I keep getting the error.  I can't figure out why I keep getting this message. 

I appreciate any help you can provide on this matter.

Thank you for your help in advance, 
Jelisa 

Eric Rexstad

unread,
Nov 11, 2021, 4:27:34 AM11/11/21
to Jelisa Oliveras, distance-sampling
Jelisa

My diagnosis is speculative.  Here's my suspicion.  When you have multiple years within the same data frame, you are treating years as strata.  In the Area field, the areas are not equal across years; hence the literal interpretation of the message you are getting.

The message disappears when you analyse years individually because there is no inconsistency in year-specific areas.

If my diagnosis is incorrect, we will need to investigate the matter more deeply, possibly by having a look at the data off-list.


From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Jelisa Oliveras <jelisa....@gmail.com>
Sent: 10 November 2021 21:41
To: distance-sampling <distance...@googlegroups.com>
Subject: {Suspected Spam} [distance-sampling] Issue on Regions areas
 
--
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/cd965733-7d8b-47ea-b90d-786bbec51968n%40googlegroups.com.

Flocrn

unread,
Nov 23, 2021, 5:55:17 AM11/23/21
to distance-sampling
Dear Jelisa and Eric,

I'm also working on detection function with multiple year. I'm trying to do a single detection function with all my data across the years.
I tried to fix the problem of unconsistency by setting 1 value of area per year. I don't have the error message anymore.
But, when I compute the ds function, I have 0 for all my density and abundance estimators and I can't find why.
I tried to calculate them with dht function, and I discovered this error :
"Must specify obs.table because Sample.Label and/or Region.Label fields not contained in data"
This is very strange, since they are in my data, and are found when I take the years individually.

Thank you by advance for your response,

Best regards,

Floriane Cornué

Jelisa Oliveras

unread,
Dec 7, 2021, 12:00:57 PM12/7/21
to distance-sampling
Hi Floriane,

To the best of my knowledge, it sounds like a labeling issue. I hope this helps.

Best, 
Jelisa

Jelisa Oliveras

unread,
Dec 7, 2021, 12:01:30 PM12/7/21
to distance-sampling
Hi All, 

Below is the suggestion/ conversation Eric and I had about my years being treated as strata. Thank you again, Eric!!! 

Best, 
Jelisa

From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Jelisa Oliveras <jelisa....@gmail.com>
Sent: 10 November 2021 21:41
To: distance-sampling <distance...@googlegroups.com>
Subject: {Suspected Spam} [distance-sampling] Issue on Regions areas
 Hi
Hello, 

I was recently introduced to the distance package. I am working with avian and line transect data from 2012-2021. I keep getting this error message: "Error in check data(data, region.table, sample.table, obs.table, formula) : Region areas are not consistent.".  I changed all of my column names and doubled check if there were any discrepancies within my data.

I went even further and separated my data by year, and it worked perfectly. However, the dataset as a whole, I keep getting the error.  I can't figure out why I keep getting this message. 

I appreciate any help you can provide on this matter.

Thank you for your help in advance, 
Jelisa 

--

Eric Rexstad
Sat, Nov 13, 3:28 AM

Jelisa

It probably doesn't make much biological sense to analyze all four years together; the density estimates won't mean much.  Nevertheless, running everything in one swoop will smoke out some problems. 

Your problem can be spotted with this line of code:
table(Grasslands$Region.Label, Grasslands$Area)

For two of your strata (Flying W L and Flying W North) they have two different areas recorded.  Digging a bit deeper

flyingwl <- subset(Grasslands, Region.Label=="Flying W L")
table(flyingwl$Area, flyingwl$Year)
    
          2012  2013  2019    2021
  793  100     79        0         328
  829    0         0       164          0

Sure enough, the acreage of this stratum was recorded as a different size in 2019.  Hence the complaint from the software about inconsistent region areas.  And the inconsistency disappears if you analyse the data year by year. I suspect you'll find a similar inconsistency for the Flying W North.

With a data set of this size, probably worthwhile to spend time doing simple sense-checks of the data such as these tables before trying to fit any detection functions.

Flocrn

unread,
Dec 8, 2021, 4:58:01 AM12/8/21
to distance-sampling
Hi, yes thank you !
Reply all
Reply to author
Forward
0 new messages