Using time-covariates on age models

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

Using time-covariates on age models

Postby scha » Thu Jul 05, 2012 12:42 pm

Hi all,

I am currently running models with Rmark to investigate senescence on birds and more particulary effet of climat on bird aging.
I have 6 age groups ([0,1) [1,2) [2,3) [3,4) [4,28) [28,37];I start at age 0). I wish to test the effect of time covariates (Tmax for example) only on the two last age classes. To separately use each age class, I have created 6 age variables like that
Code: Select all
vaut.ddl.age$S$a0=0
vaut.ddl.age$S$a0[vaut.ddl.age$S$Age==0]=1
vaut.ddl.age$S$a1=0
vaut.ddl.age$S$a1[vaut.ddl.age$S$Age==1]=1
vaut.ddl.age$S$a2=0
vaut.ddl.age$S$a2[vaut.ddl.age$S$Age==2]=1
vaut.ddl.age$S$a3=0
vaut.ddl.age$S$a3[vaut.ddl.age$S$Age==3]=1
vaut.ddl.age$S$a4_28=0
vaut.ddl.age$S$a4_28[vaut.ddl.age$S$age_covar=="[4,28)"]=1
vaut.ddl.age$S$a28_37=0
vaut.ddl.age$S$a28_37[vaut.ddl.age$S$age_covar=="[28,37]"]=1

So I am able to build age model with this kind of function
Code: Select all
S.age=list(formula=~-1+a0+a1+a2+a3+a4_28+a28_37)


1) I want to know if there is a linear trend between survival of the last age class and a time covariate (Tmax) so I have done
Code: Select all
S.age1=list(formula=~-1+a0+a1+a2+a3+a4_28+a28_37:Tmax)


2) Same thing thes two last age class
Code: Select all
S.age2=list(formula=~-1+a0+a1+a2+a3+a4_28:Tmax+a28_37:Tmax)


My questions :
- Is it the correct to model the effect of covariate on age classes in this way? I think there is an intercept problem!!
- Is the model 2 correspond to an interaction model between Tmax and the two last age classes? I think that I also have an intercept problem (because I should estimate two intercepts and two slopes and I do not have parameter fot the intercepts).
- How can I test an additive effect of Tmax on the two last age classes (different intercept but one slope)

thanks and sorry in advance for my unclear English and my poor knowlegde of covariates models

Stephane
scha
 
Posts: 26
Joined: Tue Oct 11, 2011 8:27 am
Location: MNHN : Muséum National d'Histoire Naturelle, Paris, France

Re: Using time-covariates on age models

Postby jlaake » Thu Jul 05, 2012 1:07 pm

My questions :
- Is it the correct to model the effect of covariate on age classes in this way? I think there is an intercept problem!!

The following model should be fine:

Code: Select all
S.age=list(formula=~-1+a0+a1+a2+a3+a4_28+a28_37)


but there is no reason for you to specify dummy values for age here and would be more concisely written as

Code: Select all
S.age=list(formula=~age_covar)


Note the subtle difference between the two models above. In the first, each age effect is independent of the other, whereas in the second, the first level (age 0) will be the intercept and the remaining betas are added to the intercept. You should get the same real parameters but the betas will differ.
- Is the model 2 correspond to an interaction model between Tmax and the two last age classes? I think that I also have an intercept problem (because I should estimate two intercepts and two slopes and I do not have parameter fot the intercepts).


Yes you do have an intercept problem here because you removed the overall intercept and then only specified a slope for Tmax for the last age class, so the last age class has no value at Tmax=0. The formula should be:

Code: Select all
S.age=list(formula=~age_covar+a28_37:Tmax)


and

Code: Select all
S.age=list(formula=~age_covar+a4_28:Tmax+a28_37:Tmax)


- How can I test an additive effect of Tmax on the two last age classes (different intercept but one slope)


It is easiest to do this by adding another level to the age variable which collapses the 2 age bins:

In your design data, add:
Code: Select all
vaut.ddl.age$S$a4_37=0
vaut.ddl.age$S$a4_37[vaut.ddl.age$S$age_covar=="[28,37]"|vaut.ddl.age$S$age_covar=="[4,28)"]=1


Then the following function will give you a single slope but different intercepts:
Code: Select all
S.age=list(formula=~age_covar+a4_37:Tmax)


Note that I have no easy way to test my code above so it could contain typos and I have used S.age throughout and you want to make those different. I highly recommend that you use model.matrix with the design data so you can see what DM the formula is creating and it will help you improve your knowledge in building these models.

Code: Select all
DM=model.matrix(~age_covar+a4_37:Tmax,vaut.ddl.age$S)


--jeff
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Using time-covariates on age models

Postby scha » Fri Jul 06, 2012 4:34 am

Hi Jeff

I am happy to know that I was wrong but that I was closed to the good formulation

Your reply are very clear and helpful, thank you so much

Stephane
scha
 
Posts: 26
Joined: Tue Oct 11, 2011 8:27 am
Location: MNHN : Muséum National d'Histoire Naturelle, Paris, France


Return to RMark

Who is online

Users browsing this forum: No registered users and 2 guests

cron