Time varying covariate in known fate model

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

Time varying covariate in known fate model

Postby mconner » Wed Apr 03, 2019 1:37 pm

I am trying to build a simple known fate model with season; there are 3 seasons a year and the input file has 14 seasons. All works fine until I specified the unequal time intervals, after which I get the message:

ESMD_S.ddl$S=merge_design.covariates(ESMD_S.ddl$S, dfseason1)
Error in merge_design.covariates(ESMD_S.ddl$S, dfseason1) :
dfseason1 does not contain a time value for each time in design data

There are 3 groups, the code I am using is below. I've tried some different begin.time=, but to no avail.

Thanks for your help. Mary
************************************************************************************************
ESMD_S.process=process.data(ESMD_S,groups="herd",model = "Known", time.intervals=c(0.975,1.238,0.959,0.959,1.066,0.615,1.246,1.328,0.525,1.156,1.213,0.713,1.041,1.451))
ESMD_S.ddl=make.design.data(ESMD_S.process)

dfseason1=data.frame(time=c(1:14),season1=c(1,0,0,1,0,0,1,0,0,1,0,0,1,0))
ESMD_S.ddl$S=merge_design.covariates(ESMD_S.ddl$S, dfseason1)
mconner
 
Posts: 21
Joined: Wed Aug 24, 2005 7:29 pm
Location: Utah State University

Re: Time varying covariate in known fate model

Postby jlaake » Wed Apr 03, 2019 5:36 pm

The time values in dfseason1 are 1 to 14 but with unequal intervals they aren't integer values. Look at the time values in the design data and use those in dfseason1$time. That function is using merge which is like a join and field values have to match.
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Time varying covariate in known fate model

Postby mconner » Thu Apr 04, 2019 1:47 pm

Thank you Jeff! Sometimes I just need a knock on the head. I had tried what you suggested already (incorrectly) and it didn't work. BUT, this morning, after re-reading your email I realized time is cumulative in the design data, so I had to ADD my unequal time intervals, and not just paste them is as they were.

Mucho gracias. Mary
mconner
 
Posts: 21
Joined: Wed Aug 24, 2005 7:29 pm
Location: Utah State University


Return to RMark

Who is online

Users browsing this forum: No registered users and 8 guests