removing time effect for a subset of years

Hi RMark Users,
First, I'd like to mention that I've been working really hard to learn the basics of Mark/RMark, but I'm still very much a novice.
I'm conducting a joint live-dead recovery analysis on a 20-year goose banding dataset. One of the challenges of the dataset is that there is a 7 year period where there was no banding (so no releases or recaptures). During this time, there were still birds being shot, retrieved, and reported.
I would like to model a time effect for S, p, and r. But to deal with the gap in banding, I would like to 1) set p=0 for years in which there was no banding, and 2) set S and F constant (no time effect) during this period.
I have read "Mark: a gentle introduction" and figured out how to fix p to zero. I'm unsure of how to modify the design data to remove the time effect for non-banding years.
Thanks very much! My code is posted below.
First, I'd like to mention that I've been working really hard to learn the basics of Mark/RMark, but I'm still very much a novice.
I'm conducting a joint live-dead recovery analysis on a 20-year goose banding dataset. One of the challenges of the dataset is that there is a 7 year period where there was no banding (so no releases or recaptures). During this time, there were still birds being shot, retrieved, and reported.
I would like to model a time effect for S, p, and r. But to deal with the gap in banding, I would like to 1) set p=0 for years in which there was no banding, and 2) set S and F constant (no time effect) during this period.
I have read "Mark: a gentle introduction" and figured out how to fix p to zero. I'm unsure of how to modify the design data to remove the time effect for non-banding years.
Thanks very much! My code is posted below.
- Code: Select all
ld <- convert.inp("./data/SNGO_BLGO_livedead_1998-2018.inp", group.df = data.frame(age_sex=c("HY Male", "HY Female", "SY Male", "SY Female", "ASY Male", "ASY Female")) , use.comments = TRUE)
#split the age and sex information into two separate columns
ld <- tidyr::separate(ld, age_sex, c("age", "sex"), " ")
#coerce age and sex into factors
ld$age <- as.factor(ld$age)
ld$sex <- as.factor(ld$sex)
proc = process.data(data = ld,
model = "Burnham",
groups = c("age", "sex"),
age.var = 1,
initial.age = c(2, 0, 1))
# make the design data from the processed data above
design = make.design.data(proc)
design = add.design.data(data = proc,
ddl = design,
parameter="S",
type = "age",
bins = c(0, 0.5, 1.5, 20),
right = FALSE,
name = "age",
replace = TRUE)
levels(design$S$age) = c("HY", "SY", "ASY")
#repeat for p
design=add.design.data(data = proc,
ddl = design,
parameter="p",
type = "age",
bins = c(0, 0.5, 1.5, 20),
right = FALSE,
name = "age",
replace = TRUE)
levels(design$p$age) = c("HY", "SY", "ASY")
#repeat for F
design=add.design.data(data = proc,
ddl = design,
parameter="F",
type = "age",
bins = c(0, 0.5, 1.5, 20),
right = FALSE,
name = "age",
replace = TRUE)
levels(design$F$age) = c("HY", "SY", "ASY")
#repeat for r
design=add.design.data(data = proc,
ddl = design,
parameter="r",
type = "age",
bins = c(0, 0.5, 1.5, 20),
right = FALSE,
name = "age",
replace = TRUE)
levels(design$r$age) = c("HY", "SY", "ASY")
full.model = mark(data = proc,
ddl = design,
model.parameters = list(
S = list(formula = ~ -1 + time*age),
p = list(formula = ~ -1 + time*age,
fixed = list(time = c(11, 12, 13, 14, 15, 16, 17), value = 0)),
F = list(formula = ~ sex*age),
r = list(formula = ~ time*age)),
invisible = FALSE,
model = "Burnham")