error using dht2: >1 Area defined for a single stratum label, check data

9 views
Skip to first unread message

juan pablo Zurano

unread,
Jun 19, 2024, 11:04:31 AM (10 days ago) Jun 19
to distance-sampling

Hi folks,

I performed an analysis using the ds function with three covariates, as follows:

model <- ds(df_dist, key="hr", convert_units=conversion.factor, formula = ~ size + region.label + env)


The df_dist (flatfile) is a dataframe with information about the region of the transect (four classes), the area of each region (four different values), and the type of environment (three classes) of each transect. Additionally, those transects with records are classified into two classes (big or small).

The output of the analysis returns the abundance for each region, but we want to estimate the abundances of each size class in each region and environment type.

Can I use the dht2 function?

When using dht2 like this:

dht2(ddf=model, flatfile=df_dist, strat_formula=~size, convert_units=conversion.factor, stratification="object")


we get the following error:

Error in dht2(ddf = model, flatfile = df_dist, strat_formula = ~size,:

  >1 Area defined for a single stratum label, check data


I understand the problem, but is it possible to aggregate the areas within the same function to obtain the abundance by size, area and environment? Can anyone help me, please?

Thank you, Juan



Eric Rexstad

unread,
Jun 19, 2024, 1:30:21 PM (10 days ago) Jun 19
to juan pablo Zurano, distance-sampling
Juan

To be honest, I'm not sure it is possible to achieve what you request. You have one stratification attribute (Region.Label) that was part of the design, known prior to the survey. But the other two stratification attributes (size and env) that were not known prior to data collection. To convert density estimates into abundance estimates, size of areas need to be known (N=D x A). There can be no "area" associated with either size​ or env​. That gave rise to the error message you received.

I don't have an obvious solution to your question. In hindsight, had you known when you were designing your survey that you would want estimates at the level of env​, you would have designed your survey to place effort within the three env​ classes. They could have then formed a secondary component of your geographic stratification. You could have defined 12 different strata (all region x env​) combinations with an area for each of the 12. I don't see how to accomplish that post-hoc.


From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of juan pablo Zurano <zura...@gmail.com>
Sent: 19 June 2024 16:03
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] error using dht2: >1 Area defined for a single stratum label, check data
 
--
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/CANkkDSnLXAK%2BkaASNTif1zG2Cv8BUB4_EmN_rELEOtZaGnCTSQ%40mail.gmail.com.


From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of juan pablo Zurano <zura...@gmail.com>
Sent: 19 June 2024 16:03
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] error using dht2: >1 Area defined for a single stratum label, check data
 
--
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/CANkkDSnLXAK%2BkaASNTif1zG2Cv8BUB4_EmN_rELEOtZaGnCTSQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages