Set last p = last c in closed capture model

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

Set last p = last c in closed capture model

Postby mconner » Mon Apr 13, 2020 7:56 pm

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
mconner
 
Posts: 21
Joined: Wed Aug 24, 2005 7:29 pm
Location: Utah State University

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

Postby jlaake » Tue Apr 14, 2020 3:03 pm

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)))
jlaake
 
Posts: 1295
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

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

Postby mconner » Wed Apr 15, 2020 2:03 pm

Thanks Jeff! I never would have gotten this one on my own.

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 2 guests

cron