-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
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
dsdht_optionobjectvarflagis set to value of `er_option
- Inside
dhtoptions$varflagis given default value of 2dht.seis called withoptionsas an argument
- Inside
dht.se- encounter rate variance computed depending upon value of
options$varflag
- encounter rate variance computed depending upon value of