Page 1 of 1

Set last p = last c in closed capture model

PostPosted: Mon Apr 13, 2020 7:56 pm
by mconner
Greetings:

Maybe I'm having a myopic moment, but I cannot figure out how to set the last p = last c in a closed capture model. For example, if I have 4 occasions, I want p and c to be time varying, except p4=c4.

How do I specify that in a RMARK model?

Thanks for any advice. Mary

Re: Set last p = last c in closed capture model

PostPosted: Tue Apr 14, 2020 3:03 pm
by jlaake
Here is an example using the edwards.eberhardt data. Anytime you have a situation in which you want to limit an interaction, think of how you can use a variable that takes a 0/1 value. The values for Time between p and c are different because it always starts at 0 for Time and p starts at time=1 and c at time=2. Something to keep in mind if you ever fit a shared trend model. You need to redefine Time in that case.

Code: Select all
library(RMark)
data(edwards.eberhardt)
p=process.data(edwards.eberhardt,model="Closed")
ddl=make.design.data(dp)
ddl$p$beforelast=ifelse(ddl$p$Time<17,1,0)
ddl$c$beforelast=ifelse(ddl$c$Time<16,1,0)
mark(dp,ddl,model.parameters=list(p=list(formula=~beforelast:time+c:beforelast:time,share=TRUE)))

Re: Set last p = last c in closed capture model

PostPosted: Wed Apr 15, 2020 2:03 pm
by mconner
Thanks Jeff! I never would have gotten this one on my own.

Mary