Page 1 of 1

building a time-varying model

PostPosted: Fri Feb 18, 2011 5:33 pm
by megpetrie
Hello,
I'm hoping to get some help with building a model in RMark that specifies different parameters for the first recapture occassions (t2) for different groups, then keeps t3, t4, and t5 the same for each group. In MARK the PIMS would look like this:

Group 1 (p)
5 6 7 8
6 7 8
7 8
8

Group 2 (p)
9 6 7 8
6 7 8
7 8
8

Group 3 (p)
10 6 7 8
6 7 8
7 8
8

Could someone steer me in the direction of some documentation on how to specify this situation in RMark?

Thanks,
Megan

Re: building a time-varying model

PostPosted: Fri Feb 18, 2011 6:59 pm
by aswea
Hi Megan,

You can alter the design data list to create a parameter that combines the time intervals plus a second parameter that specifies the intervals you don’t want combined.

Megan.ddl$Phi$Newpar=0
Megan.ddl$Phi$Newpar[Megan.ddl$Phi$time=="6"| Megan.ddl$Phi$time=="7"| Megan.ddl$Phi$time=="8"]=1
Megan.ddl$Other=0
Megan.ddl$Other[Megan.ddl$Phi$Newpar=="0"]=1

Then include these in your model
Phi.Megan=list(formula=~time:group:Other+time:Newpar)

I got this from the RMark appendix somewhere-- probably under More Complex Examples.

I hope this helps,

~Aswea

Re: building a time-varying model

PostPosted: Sun Feb 20, 2011 9:29 pm
by jlaake
Somethng like Aswea's solution would work except that it used Phi instead of p and mistakenly used pim numbers 6,7,8 for times 3,4,5. But a possibly simpler solution is to specify a variable in the design data for p that is 0 except for group 2 and time 2 where it is 1 and then do the same thing for group 3 and time 2. I'll call these g2 and g3. Then your formula would be

~time+g2+g3

g2 is the amount added to p for time 2 group 1 to get the value for group 2 and g3 is the same for group 3.

If this doesn't make sense let me know.

--jeff