Age - design covariate or individual time varying covariate

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

Age - design covariate or individual time varying covariate

Postby jlaake » Tue Jun 09, 2015 7:56 pm

This posting is in reference to the post on MARK/Analysis Help with regard to age and time-varying covariates. As with environmental covariates, animal age can be either a design covariate or a time-varying individual covariate. But if you have a small group of ages at which the animals enter (first released) then it is easiest to use the capacities in RMark that handle age for you and you automatically get predictions for each age because it is in the design data. For example, let's assume you have animals that are initially marked as age 0,1,2 and you have annual time intervals. Define a group variable to separate the 3 age levels. Then in process.data use the argument age.var to identify which group variable is the age variable and use initial.age argument to give the initial ages for each group at the time they are initially released.

As an example, I'll artificially divide the dipper data into 3 groups: "Y","J","A"
Code: Select all
 data(dipper)
 # assign some artificial initial ages
 dipper$ageclass="Y"
 dipper$ageclass[100:150]="J"
 dipper$ageclass[151:250]="A"
 dipper$ageclass=factor(dipper$ageclass)
 #process data and assign initial ages;note that the ageclass factor is ordered
 #alphabetically so it is A,J,Y and the initial ages are then 2,1,0
 dp=process.data(dipper,groups=c("sex","ageclass"),age.var=2,initial.age=c(2,1,0))
 ddl=make.design.data(dp)
 # look at some of the design data and see that the ages at
 # each time are adjusted for each group according to their initial age and
 # the time intervals
 head(ddl$Phi[ddl$Phi$ageclass=="Y",])
 head(ddl$Phi[ddl$Phi$ageclass=="J",])
 head(ddl$Phi[ddl$Phi$ageclass=="A",])


Next we can fit a model and get predictions. Note this is nonsense data and I haven't made any attempt to do model selection or evaluate model fit. This is just an example. There are other examples like this in the documentation and workshop notes. Make sure you have the recent workshop notes as well.

Code: Select all
model=mark(dp,ddl,model.parameters=list(Phi=list(formula=~age)))
Phiestimates=summary(model,se=TRUE)$reals$Phi
unique.estimates=unique(subset(Phiestimates,select=c("Age","estimate","lcl","ucl")))
with(unique.estimates[order(unique.estimates$Age),],
{
plot(Age,estimate,ylab="Survival",type="b",ylim=c(0,1))
lines(Age,lcl,lty=2)
lines(Age,ucl,lty=2)
})
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Age - design covariate or individual time varying covari

Postby bootzies » Tue Jun 09, 2015 8:52 pm

Thanks for clarifying Jeff.

To follow up - I have many different ages of individuals at first mark (i.e. from hatchlings of less than 1 year old, to mature adults of over 40 years old, and everything in between). I have estimated age at capture for each individual using a validated age-growth curve for the species and it is a continuous (decimal) variable rather than a discreet age grouping.

Considering my data are a bit more detailed than the example you give, do you think that I would be better off using 'estimated age' as a time-varying individual covariate rather than design data? I only have 7 occassions in my data, so it is pretty straight forward to set up the raw data with age increasing with time after capture.

Thanks again,
Alice

p.s. In case anyone is interested in the previous thread that this one sprang from, it is here: viewtopic.php?f=1&t=3008&view=unread#unread
bootzies
 
Posts: 21
Joined: Wed Jan 29, 2014 2:31 am

Re: Age - design covariate or individual time varying covari

Postby jlaake » Tue Jun 09, 2015 9:34 pm

From your last post I assumed that you only had 3 initial ages. But yes with a lot of ages then you are better off treating it as a time-varying individual covariate. As I said in the previous post, for CJS models it doesn't matter what you use for the age variable for times prior to first release. I presume you are using this for survival and in that case you should name the variables so the suffix matches the times assigned to Phi (e.g. age1,age2,age3...) which is the beginning of each time interval. If you are also using them for p then you need to add an additional variable for the last occasion.
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to RMark

Who is online

Users browsing this forum: Google [Bot] and 3 guests