flat predictions

33 views
Skip to first unread message

Anne

unread,
Aug 1, 2025, 11:46:24 AMAug 1
to distance-sampling
Hi there,

I have a set of data I am fitting to distance sampling models. I have 5 different regions within the study area, and within these, we've flown line transects of varying lengths for marine mammals. We have front and rear seat observers on the left and right sides of the plane. I would expect different densities and detection probabilities within these regions as a result of habitat quality, weather changes, etc. I am only using front seat observer data for now.

I have fit Distance::ds() models multiple ways (data pooled, data split by region). Ideally, I would keep all data together as sample sizes by region can get small (e.g., min 70 obs per region).

My issue is when data are pooled, I am only getting flat detection probabilities (i.e., no variation) across distances (range = 100 -1000 m) for each region. Only when I split data and model separately, I can see p varies by region (as I would expect).

Can anyone suggest edits to my model below to allow p to vary by region?  I've simplified covariates for the example here. 

My latest model structure for all data is:

f3 <- ds(data = front,
         key = 'hn',
         adjustment = "poly", #"cos", "herm", "poly"
         transect = "line",
         formula = ~ Region.Label 
         nadj = 2,
         convert_units= conversion.factor,
         truncation = list(left = 100, right = 1000),
         region_table = region_table,
         sample_table = sample_table,
         obs_table = obs_table)


Region.Label     Area
fbay 2651.494
dbay 3037.481
pasound 1482.629
minlet 3050.371
agulf 2451.787


head:
Sample.Label        Region.Label     Effort
36         fbay  49.642690
29         dbay  26.182124
7          pasound  30.646708
15         minlet  74.035738
26         minlet   9.340644

object        Region.Label Sample.Label
13        fbay           36
14        fbay           36
15        fbay           36
16        fbay           36

Eric Rexstad

unread,
Aug 1, 2025, 12:16:51 PMAug 1
to Anne, distance-sampling
Greetings Anne; welcome to the list.

You are making some sound decisions from what I can tell. You are dubious of detectability being perfect from your analysis of the pooled data, so you'd like stratum-specific detection functions because you are willing to believe detectability varies between strata.  All very sensible.

Your intention of making strata (Region.Label) a covariate in your detection function seems like the way forward. That produces stratum-specific detection probability while "borrowing strength" across your strata. 

In your call to ds, my suspicious eye falls upon the arguments "adjustment", "nadj" and "formula". If you want Region.Label as a covariate, then you should probably not be specifying a value for "adjustment" and certainly not for "nadj". Finally, the syntax for "formula" is to have a tilde (~) without a space before Region.Label.

Give those suggestions a whirl, and if things are still causing problems, get back to me off-list, we might need to dig into the data.


From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Anne <annie...@gmail.com>
Sent: 01 August 2025 16:27
To: distance-sampling <distance...@googlegroups.com>
Subject: {Suspected Spam} [distance-sampling] flat predictions
 
--
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/63775940-851a-482e-ba5c-da1779176278n%40googlegroups.com.

Anne

unread,
Aug 7, 2025, 2:52:02 PMAug 7
to distance-sampling
Thanks, Eric! Removing the 'nadj' term solved my problem. 
Reply all
Reply to author
Forward
0 new messages