0

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?

Cettt
  • 11,460
  • 7
  • 35
  • 58
N. J.
  • 105
  • 6
  • 1
    What package is `crm` from? In any case, it seems your problem is that your fourth argument, `p=list(formula=~time)` is vague. I'd guess the `crm` function has multiple parameters whose names start with `p`. Use full parameter names to avoid partial matching. – Nathan Werth May 14 '19 at 17:06
  • Need a dataset adequate to support coding demonstrations as well as library calls for whatever package might be under consideration for the problem. – IRTFM May 30 '19 at 00:01

0 Answers0