Skip to content

Encounter rate variance of Buckland 2001 cannot be requested by ds #182

@erex

Description

@erex

er_method argument in ds is ignored by dht

Either observed counts (er_method=1) or expected counts (er_method=2) can be requested. Default is "2". When user request er_method=1 results are still using er_method=2

I believe the problem lies within dht, however, users calling ds from the Distance package will not get the results they expect if they specify er_method=1

MRE

library(Distance)
data(Savannah_sparrow_1981)
cu <- convert_units("meter", NULL, "hectare")
pooler1 <- ds(Savannah_sparrow_1981, transect="point", key="hn", adjustment = "cos",
           convert_units = cu, er_method = 1)  # encounter var uses observed counts
pooler1$dht$individuals$summary

pooler2 <- ds(Savannah_sparrow_1981, transect="point", key="hn", adjustment = "cos",
              convert_units = cu, er_method = 2)  # encounter var uses expected counts
pooler2$dht$individuals$summary

se.ER and cv.ER are identical regardless of value of er_method.

Debug trail

  • Inside ds
    • dht_option object varflag is set to value of `er_option
  • Inside dht
    • options$varflag is given default value of 2
    • dht.se is called with options as an argument
  • Inside dht.se
    • encounter rate variance computed depending upon value of options$varflag

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions