Help with covariate.predictions

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

Help with covariate.predictions

Postby fcassidy » Fri Dec 04, 2015 5:13 pm

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!
fcassidy
 
Posts: 2
Joined: Thu Nov 19, 2015 6:40 pm

Re: Help with covariate.predictions

Postby jlaake » Thu Dec 10, 2015 12:24 pm

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?

Well stratum, tostratum and session aren't relevant because they aren't in your model for S. But time is and right now you are only computing it for a single time. See next question.

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?

The indices arguments specifies which of the real parameters is to be computed with those covariate values. These are the model.index values in the design data. See the following example with the dipper data.

Code: Select all
> data(dipper)
> dp=process.data(dipper)
> ddl=make.design.data(dp)
> head(ddl$Phi)
  par.index model.index group cohort age time occ.cohort Cohort Age Time
1         1           1     1      1   0    1          1      0   0    0
2         2           2     1      1   1    2          1      0   1    1
3         3           3     1      1   2    3          1      0   2    2
4         4           4     1      1   3    4          1      0   3    3
5         5           5     1      1   4    5          1      0   4    4
6         6           6     1      1   5    6          1      0   5    5
> head(ddl$p)
  par.index model.index group cohort age time occ.cohort Cohort Age Time
1         1          22     1      1   1    2          1      0   1    0
2         2          23     1      1   2    3          1      0   2    1
3         3          24     1      1   3    4          1      0   3    2
4         4          25     1      1   4    5          1      0   4    3
5         5          26     1      1   5    6          1      0   5    4
6         6          27     1      1   6    7          1      0   6    5
> ddl$p$model.index[ddl$p$cohort==1&ddl$p$time==7]
[1] 27
>



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?

You can get an average value by dropping ageclass and sex from the formula.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Help with covariate.predictions

Postby jlaake » Thu Dec 10, 2015 12:27 pm

PS Have you read Section 12 of the RMark Workshop notes that were updated 1 May. See http://www.phidot.org/software/mark/rmark/RMarkDocumentation.zip
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Help with covariate.predictions

Postby Bryan Hamilton » Thu Dec 10, 2015 5:55 pm

These workshop notes, as well as the Appendix C in the mark book have been extremely helpful. I've gone through them each twice and pick up new tips and tricks every time I go through the examples.
Bryan Hamilton
 
Posts: 111
Joined: Thu Jun 15, 2006 11:36 am
Location: Great Basin National Park

Re: Help with covariate.predictions

Postby jlaake » Thu Dec 10, 2015 6:29 pm

I'm glad you are finding them useful. That's why I wrote them. If you find conflicting information between them go with the workshop notes because RMark has evolved and I haven't gone back to Appendix C in quite awhile. Another document to read is the file NEWS that is installed in the RMark subdirectory of your R library. Mostly it contains changes, bug fixes etc but it also contains ideas with new features that were added and some of that may never have found its way into the documentation. Also, there is a 2009 version of the workshop notes so make sure you have the newest version dated 1 May 2015.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Help with covariate.predictions

Postby Bryan Hamilton » Thu Dec 10, 2015 8:22 pm

While I have you Jeff, can I derail the thread? I'm happy to open this as another thread.

I've been working on trap dependence for a few days. I think I have the time since marking (TSM) model figured out. Its just an age model (or an Age model), with the following PIMS. This allows p to vary as a function of time since capture. It could be trap dependence or trap avoidance. It took me some time to get here, so I just wanted to confirm that I'm interpreting TSM models correctly.

Code: Select all
p(~age)
     1981 1982 1983 1984 1985 1986
1980    2    3    4    5    6    7
1981         2    3    4    5    6
1982              2    3    4    5
1983                   2    3    4
1984                        2    3
1985                             2
Bryan Hamilton
 
Posts: 111
Joined: Thu Jun 15, 2006 11:36 am
Location: Great Basin National Park

Re: Help with covariate.predictions

Postby jlaake » Fri Dec 11, 2015 11:26 am

Yes an age model is a TSM model when all of the individuals start at the same age. Whether this handles trap dependence depends on what model you are fitting. Most of the closed and robust design models already allow for a different capture (p) and recapture (c) probabilities. If it is CJS or CJS-like the initial "capture" is not modelled so all recaptures are "affected". If you want to continue this you should post another thread and provide a much more detailed accounting of what you are trying to do.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest

cron