Hi,
I've just made the big switch to RMark for a Robust Design analysis of bat survival & breeding probabilities. So far, fairly good, but I have a few questions that I would greatly appreciate some help with. I've seen posts on similar issues as my question here and I've read the help files and the RMark appendix, but I'm still struggling to get the code just right - so any advice would be greatly appreciated.
My issue is:
I have bats marked as juveniles and marked as adults, and I am interested survival and temporary emigration (breeding prob) for two age stages (young, adults). I've followed the excellent instructions on how to create the binned age groups as such:
mylu.process<-process.data(mylu,begin.time=1993,model="Robust",time.intervals=ti,groups="age",initial.ages=c(1,0))
mylu.ddl<-make.design.data(mylu.process)
mylu.ddl<-add.design.data(mylu.process,mylu.ddl,parameter="S","age",bins=c(0,1,16),right=FALSE,name="ya")
mylu.ddl<-add.design.data(mylu.process,mylu.ddl,parameter="GammaDoublePrime","age",bins=c(0,1,16),right=FALSE,name="ya")
mylu.ddl<-add.design.data(mylu.process,mylu.ddl,parameter="GammaPrime","age",bins=c(0,1,16),right=FALSE,name="ya")
where mylu is my converted .inp file with my encounter histories with two groups 'marked as juveniles, marked as adults') and ti was vector for my capture occassions (16 years, 2 capture occ per year = 32 capture occ):
Now, I want to create models that have a formula=~ya structure for GammaDoublePrime (GDP) parameter, such that juveniles/young GDP is estimated but GDP parameter is fixed at 0 (the biological question being that prob of temp emigration for adults being 0, but juveniles have some prob of leaving the colony/not breeding in their first year). I am using a 'random' temp emigration model here by fixing GammaPrime to GammaDoublePrime using the share=T argument.
The problem I am having is that somehow the syntax for fixing the parameter based on the 'ya' binned variable doesn't work. My guess is that it is because of the binned structure in the ya variable in the ddl. It sounds like from the help files, this should still work, but alas, I'm apparently not that clever...
I tried:
GammaDoublePrime.ya.fixed.random=list(formula=~ya,fixed=list(ya="Adult",value=0),share=T) #but "Adult" isn't used in the ya column of the ddl
GammaDoublePrime.ya.fixed.random=list(formula=~ya,fixed=list(ya=c(1:16),value=0),share=T)
When I then try to run a model using GammaDoublePrime = GammaDoublePrime.ya.fixed.random
But I get an error message saying "unrecognized structure for fixed parameters = Error in cat (list(...), file, sep,fill, labels, append): argument 2 (type 'list') cannot be handled by 'cat'
I have also tried removing the share=T argument and just fixing GammaPrime to 0 separately. But there is still something amiss with the GDP formula statement.
Fixing for some other variable like time works, so my guess is that the problem is due to the binned nature of the ya variable. But I don't think using 'initial.age.class' will work, because I want the 'age' structure on the PIMS where a bat marked as a juvenile/young then moves into the adult stage at the next time step. Using the 'index' feature of the 'fixed' command seems to work, except I haven't quite figured out how to accurately determine my real parameter indices for each model run.
Eventually, I also want to run models that have a year-varying covariate (such as a fall/spring severity index) on both survival and GDP - but have models where the covariate influences either juveniles/young or adults, but not both, so figuring out how to apply a covariate to the ya variable is the next step after determining the fixing parameter problem - this seems like a related issue, in my head at least.
Finally, one last other question - I have fit some of my more simpler models in both RMark and Mark and for models that have the exact same structure (or so I think) there are ever so slightly different parameter values (in the 3rd/4th decimal places) - which I'm figuring is just due to rounding differences, etc. and shouldn't be interpreted as some problem with my model structure. Confirmation on that would be appreciated.
Thanks in advance for your help!