hybrid_analysis: Example Double Observer Hybrid Data Analysis

Description Format Details Examples

Description

An example of double observer data with 25 marked (radio) groups and 150 other groups (no radio) in the population. Data were generated with the following code using simhet function.

Format

A data frame with 129 observations of 7 variables:

ch

a character vector containing the three character encounter history; first occasion indicates whether the group was marked or not

count

number of animals in the group

het

variable used to model heterogeneity (re-capture probability.

lngs

natural log of count

veg

random vegetation variable

type

"unmarked" or "marked"

Details

simres=simhet(1,150,25,beta=c(-.5,-.5,-1,2,.5),data=data.frame(veg=runif(175)), gen_formula="~-1+loc+veg+cov+lngs",use_gs=TRUE,gs_param=c(1,10),seed=9234397) example_data=simres[[1]][[1]]$results[[1]]$data$data

The groups sizes were randomly generated from a gamma distribution with scale=10 and shape=1 (gs_param). The true simulated population size is 175 groups and 1732 animals. A uniform random veg variable, and unmodelled heterogeneity variable cov (uniform -1,1) and natural log of group size are used to generate p for each location(loc).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
data(example_data)
# example using fit_models
fit_models(data=example_data,formula=c("veg+lngs","lngs","veg",""))
#example using RMark directly but uses prep_data and prep_ddl
# prep_data makes sure some aspects are properly setup in data like a 3 character ch field,
# field called type with values marked and unmarked is a factor variable, and it creates a
# field called het which is 1 if character position 2 in ch is 1 (ie front observer saw it),
# and 0 otherwise
dp=prep_data(example_data,model="Huggins")
# prep_ddl calls make.design.data from RMark and then creates the factor variable with 3 values
# "Radio","Front" and "Rear" corresponding to occasions 1 to 3. It also creates a numeric variable
# rear which is 1 for occasion 3 and 0 otherwise. In addition, for occasion 1, p is fixed to 1 for
# occasion 1 for marked(radio) groups because they are known and the first character is always
# 1 for them and fixed to p=0 for unmarked groups because the first character is always 0.
ddl=prep_ddl(dp)
# create a function to fit a set of models
fit_do=function()
{
   # tag loss approach
   # It is not a staightforward Huggins in which c is different than p. For 3 occasions there
   # is a p1,p2,p3, and c2 and c3. p1is fixed to 1 or 0 as described above. p2 and p3 are
   # estimated for the front and rear observers, c2=p2 because occasion 1 isn't really a
   # capture occasion. So the only recapture occasion is for the rear observer and c differs
   # with the term c:het:rear which restricts it to be for occasion 3 (rear) and for a
   # recapture (het=1 means observer 1 saw it) and only for c (c=1).
   # veg is a fictional vegetation field, lngs is natural log of group size, loc is location and
   # allows p2 (front) and p3 (rear) initial capture probabilities to differ. The recapture
   # probability (c) for rear observer would include beta for p3 and the beta for c:het:rear.
   p.1=list(formula=~veg+lngs+loc+c:het:rear,share=TRUE)
   p.2=list(formula=~lngs+loc+c:het:rear,share=TRUE)
   p.3=list(formula=~veg+loc+c:het:rear,share=TRUE)
   p.4=list(formula=~loc+c:het:rear,share=TRUE)
   # hybrid approach - the hybrid approach simply assumes an additive difference between
   # marked and unmarked groups which is the type variable. In predicting abundance of
   # unmarked groups,the beta for marked is used. For each type of model, the abundance of
   # marked groups is always the number in the data because p=1 for the first occasion.
   p.5=list(formula=~veg+lngs+loc+type,share=TRUE)
   p.6=list(formula=~lngs+loc+type,share=TRUE)
   p.7=list(formula=~veg+loc+type,share=TRUE)
   p.8=list(formula=~loc+type,share=TRUE)
   cml=RMark::create.model.list("Huggins")
   results=RMark::mark.wrapper(cml,data=dp,ddl=ddl)
   return(results)
}
results=fit_do()
results
# Group abundance
Nhat_group_marklist(results,example_data)
# Group abundance estimate from MARK for best model
colSums(results[[1]]$results$derived[[1]])
# Notice that the abundance results from MARK do not match what Nhat_group_marklist
# produces for model 5 - 158.7365 because the original Griffin et al
# hybrid model (those with type in formula) uses the parameters for the marked group to
# predict p for the unmarked group whereas MARK doesn't
colSums(results[[5]]$results$derived[[1]])
# Group abundance not using 100 set (marked groups missed)
# This can be useful if not all marked missed groups can be found after survey so the
# group size would be unknown
Nhat_group_marklist(results,example_data,marked_known=FALSE)
# MARK doesn't consider group size so their is no equivalent for total abundance from MARK
Nhat_marklist(results,example_data)
# Animal abundance not using 100 set (marked groups missed)
# This can be useful if not all marked missed groups can be found after survey
Nhat_marklist(results,example_data,marked_known=FALSE)

jlaake/DoubleObs documentation built on Dec. 21, 2021, 12:12 a.m.