Open erex opened 5 months ago
I checked whether the lack of difference in ER variance estimates was caused by either a) miscommunication between ds
and dht
and b) lack of covariate in the Savannah sparrow detection function model.
I turned my attention to the amakihi data set to introduce a covariate in the detection function and I ran the analysis in ddf
rather than through ds
. Result below: my interpretation is that I still can't induce differences in ER variance estimation using varflag
:
data("amakihi") # multiple years as strata
bust <- unflatten(amakihi)
detsize <- ddf(dsmodel=~mcds(key="hn", formula=~MAS),
data=bust$data, method="ds", meta.data = list(point=TRUE, width=82.5))
summary(detsize)
meth1 <- dht(detsize, region.table = bust$region.table, sample.table = bust$sample.table,
obs.table = bust$obs.table, options = list(varflag=1))
meth1$individuals$summary
meth2 <- dht(detsize, region.table = bust$region.table, sample.table = bust$sample.table,
obs.table = bust$obs.table, options = list(varflag=2))
meth2$individuals$summary
> meth1 <- dht(detsize, region.table = bust$region.table, sample.table = bust$sample.table,
+ obs.table = bust$obs.table, options = list(varflag=1))
> meth1$individuals$summary
Region Area CoveredArea Effort n k ER se.ER cv.ER
1 1292 855298.6 855298.6 40 140 40 3.500000 0.3121472 0.08918492
2 194 876681.1 876681.1 41 172 41 4.195122 0.3088521 0.07362173
3 493 876681.1 876681.1 41 231 41 5.634146 0.3289972 0.05839344
4 494 513179.2 513179.2 24 141 24 5.875000 0.2712859 0.04617632
5 495 855298.6 855298.6 40 212 40 5.300000 0.4938078 0.09317129
6 792 876681.1 876681.1 41 146 41 3.560976 0.1945877 0.05464449
7 793 855298.6 855298.6 40 201 40 5.025000 0.2984737 0.05939775
8 Total 5709118.2 5709118.2 267 1243 267 4.655431 0.1262862 0.02712664
> meth2 <- dht(detsize, region.table = bust$region.table, sample.table = bust$sample.table,
+ obs.table = bust$obs.table, options = list(varflag=2))
> meth2$individuals$summary
Region Area CoveredArea Effort n k ER se.ER cv.ER
1 1292 855298.6 855298.6 40 140 40 3.500000 0.3121472 0.08918492
2 194 876681.1 876681.1 41 172 41 4.195122 0.3088521 0.07362173
3 493 876681.1 876681.1 41 231 41 5.634146 0.3289972 0.05839344
4 494 513179.2 513179.2 24 141 24 5.875000 0.2712859 0.04617632
5 495 855298.6 855298.6 40 212 40 5.300000 0.4938078 0.09317129
6 792 876681.1 876681.1 41 146 41 3.560976 0.1945877 0.05464449
7 793 855298.6 855298.6 40 201 40 5.025000 0.2984737 0.05939775
8 Total 5709118.2 5709118.2 267 1243 267 4.655431 0.1262862 0.02712664
er_method
argument inds
is ignored bydht
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 usinger_method=2
I believe the problem lies within
dht
, however, users callingds
from theDistance
package will not get the results they expect if they specifyer_method=1
MRE
se.ER and cv.ER are identical regardless of value of
er_method
.Debug trail
ds
dht_option
objectvarflag
is set to value of `er_optiondht
options$varflag
is given default value of 2dht.se
is called withoptions
as an argumentdht.se
options$varflag