Open erex opened 1 year ago
Checking variance component table computation using Savannah Sparrow 1980 data.
Stratum 1 Component Percentages of Var(D) Detection probability : 15.9 Encounter rate : 81.0 Cluster size : 3.1
Stratum 2 Component Percentages of Var(D) Detection probability : 28.1 Encounter rate : 66.1 Cluster size : 5.8
Stratum 3 Component Percentages of Var(D) Detection probability : 30.4 Encounter rate : 61.8 Cluster size : 7.8
mrds * 2.2.8.9003 2023-02-01 [1] Github (DistanceDevelopment/mrds@906a1ff)
Variance contributions Region ER Detection 1 1980_1 80.74720 19.25280 2 1980_2 66.81556 33.18444 3 1980_3 66.02137 33.97863 4 Total 44.97079 55.02921
Variance component table produced by mrds
seems unaware of group size in this data set. The contribution attributable to encounter rate variability is roughly correct (except stratum 3) and both detection function uncertainty and group size variability is combined into component called "Detection".
Songbird csv file linked to previous comment, with this simplified analysis code
library(Distance)
birds <- read.csv("E:/Troubleshoot/Arapaho/songbirds.csv", header=TRUE)
birds80 <- birds[birds$Year==1980, ]
table(birds$species, birds$Region.Label)
regtab <- data.frame(Region.Label=unique(birds80$Region.Label),
Area=rep(1,3))
p1.stns <- c(seq(1:110), seq(112, 122, by=2), seq(150, 156, by=2))
p2.stns <- seq(1:125)
p3.stns <- c(seq(1:4), seq(6, 25, by=1), seq(27, 125, by=1))
samtab <- data.frame(Sample.Label= c(p1.stns, p2.stns, p3.stns),
Region.Label=c(rep("1980_1", length(p1.stns)),
rep("1980_2", length(p2.stns)),
rep("1980_3", length(p3.stns))) ,
Effort=1)
cu <- convert_units("meter", NULL, "hectare")
sasp <- birds80[birds80$species=='SASP', ]
hncos3 <- ds(sasp, key="hn", transect="point",
convert_units = cu,
region_table = regtab, sample_table = samtab)
print(hncos3$dht) # only with print statement is component table produced
Trying to assess variance components table added to
dht
in this branch.Savannah_sparrow_1980
as test case.region.table
,sample.table
,obs.table
because multispecies data frame was going to be subsetdht
components tableSavannah_sparrow
has multiple stratasample.table
minke
numbers transects across strata (does not begin numbering again at 1)amakihi
does number transects starting at 1 for each stratum (temporal replicate survey as stratum)Note the data issue has been resolved, see next comment
songbirds.csv