My goal is to estimate annual survival and abundance at each location and I am using Robust Design (RDHuggins) model. I have four primary occasions and three secondary occasions in each. Data collection in 2020 was complicated because of the pandemic. As a result, I was unable to sample one site in 2020. In addition, the remaining two sites were only sampled on the latter two secondary occasions. I want to fix the capture and recapture probability at zero for the site I didn't survey in 2020 and the first secondary occasion for all the sites in 2020.
- Code: Select all
rd.txt = import.chdata("File path",
header = FALSE,
field.names = c("ch", "freq", "location","sex"), field.types = c("n", "f","f"))
#Set time intervals between primary and secondary occasions
time.intervals = c(0,0,1,0,0,1,0,0,1,0,0)
#Create the processed dataframe and design data
rd = process.data(data = rd.txt,
model = "RDHuggins",
groups = c("location", "sex"),
time.intervals = time.intervals)
ddl = make.design.data(rd)
#Fix the capture and recapture probability of 2020 first secondary occasion to zero
ddl$p$fix=NA
ddl$p$fix[which(ddl$p$time==1 & ddl$p$session == 3)] = 0
ddl$c$fix=NA
I am not sure how to adjust the above code so that I can fix the p and c at 0 for just one location. I want to do this using the ddl, because all the models I run will be using this information. I read Appendix C14 where the example deals with multiple groups, but I haven't been able to figure it out.
I also did not coalesce location and sex together, because I want to be able to run all the submodels.