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
er_methodargument indsis ignored bydhtEither observed counts (er_method=1) or expected counts (er_method=2) can be requested. Default is "2". When user request
er_method=1results are still usinger_method=2I believe the problem lies within
dht, however, users callingdsfrom theDistancepackage will not get the results they expect if they specifyer_method=1MRE
se.ER and cv.ER are identical regardless of value of
er_method.Debug trail
dsdht_optionobjectvarflagis set to value of `er_optiondhtoptions$varflagis given default value of 2dht.seis called withoptionsas an argumentdht.seoptions$varflag