Page 1 of 1

multistate recoveries in RMark

PostPosted: Mon Dec 06, 2010 12:16 pm
by OlivierD
Hi all,

I am trying to set up an analysis of recoveries in a multistate framework in RMark but I don't seem to get what I should...
I have sex, (initial) age, and a period set as the static structure of the model. I consider 2 states (A = alive, ie the initial capture, and D = dead, ie the recovery). I estimate mortality using transition parameters, hence I need to fix all my survival parameters to 1. I also need to fix transition D->A to 0, which I do by removing the corresponding design data (this works fine).
But to fix survival parameters to 1, I use:
S.1 <- list( formula = ~1, fixed = 1)
The problem is that survival parameters are actually fixed to 1 only for stratum = A but not for stratum = D.
I am a beginner with RMark and I am not so sure if I am doing things properly or if I missed something... In any case I find this confusing...
Has someone already done this type of analysis in RMark, who could help me figure things out?
Thanks in advance for your help
Olivier

Re: multistate recoveries in RMark

PostPosted: Mon Dec 06, 2010 12:53 pm
by egc
OlivierD wrote:Hi all,

I am trying to set up an analysis of recoveries in a multistate framework in RMark but I don't seem to get what I should...
I have sex, (initial) age, and a period set as the static structure of the model. I consider 2 states (A = alive, ie the initial capture, and D = dead, ie the recovery). I estimate mortality using transition parameters, hence I need to fix all my survival parameters to 1. I also need to fix transition D->A to 0, which I do by removing the corresponding design data (this works fine).
But to fix survival parameters to 1, I use:
S.1 <- list( formula = ~1, fixed = 1)
The problem is that survival parameters are actually fixed to 1 only for stratum = A but not for stratum = D.
I am a beginner with RMark and I am not so sure if I am doing things properly or if I missed something... In any case I find this confusing...
Has someone already done this type of analysis in RMark, who could help me figure things out?
Thanks in advance for your help
Olivier


This is an RMark question, and not particularly general, so I'm moving this over to the RMark subforum.

Re: multistate recoveries in RMark

PostPosted: Mon Dec 06, 2010 2:30 pm
by bacollier
OliverD,
I 'think' the code snip might look something like: S.1=list(formula=~1, fixed=list (), value =1) where fixed=list() is the values you want to fix (e.g., list(stratum="D")). But, I remember a section in the notes where this does not work due to parameter counts not matching up and you have to define the fixed values outside of above call. Did you read the section on fixing parameters in the RMark help file as I think what you are wanting is nested in there.

Jeff will probably jump in with a better solution later, but hope this puts you along the right path.

Bret

Re: multistate recoveries in RMark

PostPosted: Wed Dec 08, 2010 5:20 pm
by jlaake
Hmm. What you did should have worked. If you want to send me the example offlist, I can debug and see what went wrong. The default value for S is 1, so you could delete all the rows of the design data for S but I've never tried that and it could fail. Alternatively, you can use a form similar to what Bret suggested.

S=list(formula=~1,fixed=list(index=1:nrow(ddl$S), value=rep(1,nrow(ddl$S))))

where ddl is the design data list that you constructed. Let me know how you get along with this and if you send me the example I'll track down what is wrong.

--jeff