Accounting for covariates: time-varying capture effort

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

Accounting for covariates: time-varying capture effort

Postby mldavis13 » Wed May 25, 2011 7:41 am

Hi,

I have just starting using RMark this past week. I've been having a lot of success fitting models with various age.bins, time.bins, and continous time relationships but cannot figure out how to include a continuous covariate (with one value per capture occasion) in models.

I have a 'capture effort' measure which is in fact the number of trap days in a year. Right now this is a separate data frame called 'effort' which has two columns 'Year' and 'No.CapDays'. It has 22 rows as there are 22 years worth of data - i.e. one record per year.

So far, my code looks as follows:

caphist.pr <- process.data(data=caphist,begin.time=1988,groups=c('Sex','age'),age.var=2,initial.ages=c(0,1,2,3,4,5,6,7,8))
dd1 <- make.design.data(caphist.pr,parameters=list(Phi=list(age.bins=c(0,0.5,1,7,30)),p=list(type='constant')))
mod1 <- mark(data=caphist.pr,dd1,model.parameters=list(Phi=list(formula=~age+Sex),p=list(formula=~1)),realvcv=TRUE,adjust=TRUE)

I want to have a formula where p is a function of 'No.CapDays', but I cannot figure out where to involve my covariate dataframe in this modelling process.

I realize this may be a simple question and have tried reading for help on it. . . but have gotten confused in all the text about components and individual covariates. . . I don't think I want that I just have a variable (No.CapDays) that changes each year (note: it does NOT steadily increase or decrease).

I would really appreciate a tip or two on this!

Many thanks,

Miranda
mldavis13
 
Posts: 15
Joined: Mon May 23, 2011 12:41 pm

Re: Accounting for covariates: time-varying capture effort

Postby jlaake » Wed Jun 01, 2011 3:59 pm

Miranda-

Sorry for my late reply. I just returned from the field and still catching up. Look at merge_design.covariates (in v 2.0.3 and higher and merge.design.covariates in older versions). There is some old material in the help files on "components and individual covariates" for mark and make.mark.model that may have confused you. It needs to be removed. The best place to look is Appendix C and the Workshop notes which are in the documentation archive on RMark page for phidot.

With RMark/MARK you need to distinguish between "design covariates" and "individual covariates". A design covariate is one that is the same for all animals and can be attached to the design data. An example is your No.CapDays. An individual covariate is one that can differ across animals. Within individual covariates there are static variables (the same value for the animal across time) and less commonly time-varying variables (can differ across time for the same animal). Age is an example of a time-varying covariate but it is such a common one that it was incorporated into the design data.

The function merge_design.covariates was designed exactly for what you want to do. However, the variable in the dataframe needs to be called time (not year) to match the value in design data (unless you renamed time to year in the design data) and the values of time in your dataframe have to match the values of time in the design data. Hopefully, this is will help.

--jeff
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 0 guests

cron