- Code: Select all
LD.proc = process.data(data = df,
model = "Burnham",
groups = c("age", "sex"),
age.var = 1,
initial.age = c(0, 1, 2))
#for age, HY = 0, SY = 1, ASY = 2
#for sex, male = 0, female = 1
LD.ddl=make.design.data(LD.proc)
LD.ddl=add.design.data(data = LD.proc,
ddl = LD.ddl,
parameter="S",
type = "age",
bins = c(0.5, 1.5, 2.5, 20),
right = FALSE,
name = "age",
replace = TRUE)
My data has two covariates: sex and age (young-of-the-year, 1 year olds, and +1 birds).
So far, I have run the following models (using sin link function) for S:
- Code: Select all
run.final = function()
{
r.dot = list(formula = ~ 1, link="sin")
p.dot = list(formula = ~ 1, link="sin")
F.dot = list(formula = ~ 1, link="sin")
S.a3xsxt = list(formula = ~ -1 + age:sex:time, link="sin")
S.a3xs = list(formula = ~ -1 + age:sex, link="sin")
S.a3xt = list(formula = ~ -1 + age:time, link="sin")
S.sxt = list(formula = ~ -1 + sex:time, link="sin")
S.a3 = list(formula = ~ -1 + age, link="sin")
S.s = list(formula = ~ -1 + sex, link="sin")
S.t = list(formula = ~ -1 + time, link="sin")
S.dot = list(formula = ~ 1, link="sin")
final.model.list = create.model.list("Burnham")
final.results = mark.wrapper(final.model.list,
data = LD.proc, ddl = LD.ddl)
#
# Return model table and list of models
#
return(final.results)
}
final.results=run.final()
However, I would like to add another model where survival is constant for young-of-the-year (HY) birds, but can but can vary over time for older age classes. In other words, if age == 0, the model for S is ~1, if age >0, the model is age:time:sex
Can anyone tell me how I would code this model?