I am using the marked
package in R to model variability in inter-year survival for a population. I have obtained phi (the apparent survival parameter) and p (capture/detection probability) by testing several models (comparing AIC values).
This is what my data (class data.frame
) looks like:
ch Sex SVL WT1 WT2 WT3 WT4 WT5 WT6 WT7
1 0100000 M 57.10 -15 -16 -21 -26 -16 -14 -21
2 0100000 F 59.43 -15 -16 -21 -26 -16 -14 -21
3 0100000 F 67.57 -15 -16 -21 -26 -16 -14 -21
4 0100000 F 65.10 -15 -16 -21 -26 -16 -14 -21
Where WT1, WT2 etc. are the minimum winter temperatures each year, and the ch is the capture history over the years (0=absence, 1=presence).
The goal is to get the model Phi(WT)p(t). I proceed with this code:
data.proc <- process.data(data.full, model = 'cjs', begin.time = 1)
data.ddl <- make.design.data(data.proc)
# capture-recapture model fitting (crm):
mod.Phit.pt <- crm(data.proc, data.ddl,
model.parameters=list(Phi=list(formula=~time),
p=list(formula=~time)),method="Nelder-
Mead",hessian=T)
This works, rendering the model Phi(t)p(t)
mod.Phit.WT <- crm(data.proc, data.ddl,
model.parameters=list(Phi=list(formula=~WT)),
p=list(formula=~time))
This doesn't work, rendering the error:
Error in crm(data.proc, data.ddl, model.parameters = list(Phi = list(formula = ~WT)), : argument 4 matches multiple formal arguments
Am I supposed to have the time-varying covariate WT in another format?