Hello,
We are having some trouble with using the covariate.predictions function to plot the effect of a time-varying individual covariate (edible vegetation) on survival.
We are running a multi-state mark recapture model and our variables are defined as follows:
Ageclass: 0 = juvenile, 1 = adult
Sex: 0 = female, 1 = male
Time: measured in months
t1, t2…. : capture occasions. t1 and t2 occur in spring and fall of 2008, and t3 and t4 occur in spring and fall of 2009
edible08: the amount of edible vegetation in 2008 (during t1 and t2)
edible09: the amount of edible vegetation in 2009 (during t3 and t4)
stratum: mass class(small, medium or large)
We have defined the top model as:
S.e= list(formula= ~agecl + sex + time + t1*edible8 + t2*edible8 + t3*edible9 + t4*edible9 - edible8 - edible9 - t1 - t2 - t3 - t4)
p.general=list(formula=~session,share=T)
Psi.general=list(formula=~-1+stratum:tostratum*time-time)
topmod = mark(pdoge.process, pdoge.ddl, model.parameters=list(S=S.e,p=p.general,Psi=Psi.general))
We have created the values of edible08 and edible09 that we wish to model survival over as below:
minedible8=min(pdoge$edible8)
maxedible8=max(pdoge$edible8)
minedible9=min(pdoge$edible9)
maxedible9=max(pdoge$edible9)
edible8.values=minedible8+(0:30)*(maxedible8-minedible8)/30
edible9.values=minedible9+(0:30)*(maxedible9-minedible9)/30
We then used the function covariate.predictions() to generate survival estimates across the range of edible values.
Phibyedible=covariate.predictions(model1,data=data.frame(edible8=edible8.values,edible9=edible9.values,agecl=1, sex=0,t1=1, t2=0, t3=0,t4=0),indices=c(1))
Since we want to do this for all 4 time periods, we plan to do this four times, next with t1 = 0, t2 = 1, t3 = 0, t4 = 0, etc.
We have produced estimates and plotted them, however, we don’t have a lot of confidence that it’s actually doing what we want it to do.
Our questions are:
1. Does my general approach make sense? We didn’t specify any values for stratum, tostratum, time or session. How do we know if these are being treated properly?
2. We are unsure what the indices argument does. What should we be looking for in the design matrix to decide what to specify here?
3. Do we need to pick values for age class and sex, or is there some way to “average” over the two levels of these variables?
Thanks so much for any help!