Ecological factors affecting survival of different age group

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

Ecological factors affecting survival of different age group

Postby looking4lions » Wed Jul 29, 2015 9:01 am

I am trying to determine the effects of ecological factors on the survival of lions of different age groups. I have divided my data into 4 ages: cub1 (0-1 years), cub2 (1-2 years), sa (subadults 2-4 years) and adults (older than 4 years). I am looking at the effects of flooding, prey abundance and competition on survival of these age groups, and as such have constructed the following models in RMark:

#Cub1 and cub 2 age groups affected by competition, all affected by flood.
Phi.cub1xc.cub2xc.sa.dot.ad.dot.plus.flood=list(formula=~cub1:C+cub2:C+sa+ad+FL)

#Cub1 and cub2 age groups affected by competition, sa and adult age groups affected by prey. All affected by flood.
Phi.cub1xC.cub2xC.saxprey.adxprey.plus.flood=list(formula=~cub1:C+cub2:C+sa:PR+ad:PR+FL)

#Cub 1 and cub2 age groups affected by competition, sa and a affected by flood, prey affects all.
Phi.cub1xC.cub2xC.saxflood.adxflood.plus.prey=list(formula=~cub1:C+cub2:C+sa:FL+ad:FL+PR)

#Cub1 and cub2 affected by competition, adults affected by age and all affected by interaction between flooding and prey abundance.
Phi.cub1xC.cub2xC.sa.dot.adxage.plus.PRXFL=list(formula=~cub1:C+cub2:C+sa+ad:age+PR*FL)

I have the following questions regarding my assumptions in these models:
1. Do the models match their respective aims in the above descriptions?
2. Does the : operator restrict the specified predictor to the specified age group only?
3. Conversely, does adding FL or PR to models mean that these predictors are factored in for all age groups?

Thank you in advance!
looking4lions
 
Posts: 11
Joined: Thu Nov 27, 2014 7:30 am

Re: Ecological factors affecting survival of different age g

Postby jlaake » Wed Jul 29, 2015 12:11 pm

I can't answer your questions unless I know how C,FL, prey and cub1 etc are defined. Are they numeric or factor variables. I can guess but could be wrong.
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Ecological factors affecting survival of different age g

Postby looking4lions » Thu Jul 30, 2015 1:12 am

Flood, prey and competition are time-varying covariates - they differ each year for each pride. I defined the age groups as follows:

lions.ddl<-make.design.data(lions.processed)> lions.ddl<-add.design.data(lions.processed,lions.ddl,"Phi","age",bins=c(0,1,2,4,20),right=FALSE,name="age.grp")
lions.ddl$Phi$cub1=0
lions.ddl$Phi$cub1[lions.ddl$Phi$age.grp=="[0,1)"]=1
lions.ddl$Phi$cub2=0
lions.ddl$Phi$cub2[lions.ddl$Phi$age.grp=="[1,2)"]=1
lions.ddl$Phi$sa=0
lions.ddl$Phi$sa[lions.ddl$Phi$age.grp=="[2,4)"]=1
lions.ddl$Phi$ad=0
lions.ddl$Phi$ad[lions.ddl$Phi$age.grp=="[4,20]"]=1
looking4lions
 
Posts: 11
Joined: Thu Nov 27, 2014 7:30 am

Re: Ecological factors affecting survival of different age g

Postby looking4lions » Thu Jul 30, 2015 1:15 am

Flood prey and competition are numerical and age group is a factor.
looking4lions
 
Posts: 11
Joined: Thu Nov 27, 2014 7:30 am

Re: Ecological factors affecting survival of different age g

Postby jlaake » Thu Jul 30, 2015 10:59 am

#Cub1 and cub 2 age groups affected by competition, all affected by flood.
Phi.cub1xc.cub2xc.sa.dot.ad.dot.plus.flood=list(formula=~cub1:C+cub2:C+sa+ad+FL)


The intercept is for cub1 and cub2 (C=0, Flood=0)

cub1:C and cub2:C are slopes for the C covariate that are restricted to values where cub1=1 and cub2=1 respectively

sa is the amount that sa differ from cubs at C=0, Flood=0

ad is the amount that ad differ from cubs at C=0, Flood=0

Fl is a slope for Flood

#Cub1 and cub2 age groups affected by competition, sa and adult age groups affected by prey. All affected by flood.
Phi.cub1xC.cub2xC.saxprey.adxprey.plus.flood=list(formula=~cub1:C+cub2:C+sa:PR+ad:PR+FL)


This is not what you intended because sa:PR and ad:PR are slopes for prey for sa and ad respectively, so the value for sa and ad at PR=0 is absorbed into the intercept. Your formula should be

Phi.cub1xC.cub2xC.saxprey.adxprey.plus.flood=list(formula=~cub1:C+cub2:C+sa+sa:PR+ad+ad:PR+FL)



#Cub 1 and cub2 age groups affected by competition, sa and a affected by flood, prey affects all.
Phi.cub1xC.cub2xC.saxflood.adxflood.plus.prey=list(formula=~cub1:C+cub2:C+sa:FL+ad:FL+PR)


You should be getting it by now from the above, this formula should be:

#Cub 1 and cub2 age groups affected by competition, sa and a affected by flood, prey affects all.
Phi.cub1xC.cub2xC.saxflood.adxflood.plus.prey=list(formula=~cub1:C+cub2:C+sa+sa:FL+ad+ad:FL+PR)



#Cub1 and cub2 affected by competition, adults affected by age and all affected by interaction between flooding and prey abundance.
Phi.cub1xC.cub2xC.sa.dot.adxage.plus.PRXFL=list(formula=~cub1:C+cub2:C+sa+ad:age+PR*FL)


This one should be fine but I suggest trying:

model.matrix(~cub1+cub2+sa+ad:age,lions.ddl$Phi)


to check that it is working as you expect. That is going to be a lot of parameters for adults. Did you mean to do

model.matrix(~cub1+cub2+sa+ad+ad:Age,lions.ddl$Phi)


to have adult survival being a linear function of Age? If you add to your code library(splines) then you can also use

model.matrix(~cub1+cub2+sa+ad+ad:ns(Age),lions.ddl$Phi)


to get a cubic spline across age.
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Ecological factors affecting survival of different age g

Postby looking4lions » Mon Aug 03, 2015 5:26 am

Thank you for explaining the models to me. I have re-written some models, and done a model comparison to select for the best models. My models were centred around determining which of the environmental variables are important in affecting which age groups, and the model which performed best was as follows:

#Environmental variables affects all age groups

Name : Phi(~age.grp:FL + age.grp:C + age.grp:PR)p(~nocollar + FL)

Npar : 16
-2lnL: 452.9798
AICc : 486.8952

Beta
estimate se lcl ucl
Phi:(Intercept) -3.2246055000 1.9861898000 -7.1175375000 0.6683266000
Phi:age.grp[0,1):FL -0.0212138000 0.0084623000 -0.0378000000 -0.0046276000
Phi:age.grp[1,2):FL 0.0016040000 0.0151345000 -0.0280597000 0.0312677000
Phi:age.grp[2,4):FL 0.0473968000 0.0155457000 0.0169272000 0.0778665000
Phi:age.grp[4,20]:FL 0.0112902000 0.0081771000 -0.0047369000 0.0273174000
Phi:age.grp[0,1):C 0.1854869000 0.0714044000 0.0455344000 0.3254394000
Phi:age.grp[1,2):C 0.1753907000 0.0916457000 -0.0042348000 0.3550163000
Phi:age.grp[2,4):C 0.0948724000 0.0787138000 -0.0594067000 0.2491516000
Phi:age.grp[4,20]:C 0.1761398000 0.0636576000 0.0513710000 0.3009086000
Phi:age.grp[0,1):PR 0.0018391000 0.0005502104 0.0007607346 0.0029176000
Phi:age.grp[1,2):PR 0.0005242061 0.0012749000 -0.0019747000 0.0030231000
Phi:age.grp[2,4):PR -0.0052972000 0.0020907000 -0.0093950000 -0.0011995000
Phi:age.grp[4,20]:PR -0.0003355002 0.0004598648 -0.0012368000 0.0005658348
p:(Intercept) -0.9759860000 0.5877071000 -2.1278920000 0.1759200000
p:nocollar -1.0572524000 0.5486933000 -2.1326913000 0.0181865000
p:FL 0.0223596000 0.0057521000 0.0110854000 0.0336337000

As the beta estimates represent the slopes in the linear model, am I correct in saying that the negative betas indicate a negative relationship between for example, flooding and age group (0,1]? So as flooding increases survival of this age group decreases? Do very low beta estimates such as age.grp[0,1):PR show prey has a very small effect on survival of this age group?
looking4lions
 
Posts: 11
Joined: Thu Nov 27, 2014 7:30 am

Re: Ecological factors affecting survival of different age g

Postby jlaake » Mon Aug 03, 2015 1:26 pm

Negative estimate does imply a decrease. Just be careful when you interpret betas for other models based on factor variables because the value will be relative to an intercept.

With regard to magnitude of the coefficient, the size of the effect will depend on both beta and the magnitude of the covariate. If the covariate is measured in 1000s that would be quite different than if it was measured in 1s. Best thing to do is use covariate.predictions to look at the real values as a function of the covariate. Don't over-interpret. For some of the estimates the std error >> estimate which suggests you don't know much about the magnitude of the effect or that covariate doesn't affect the particular age group. Your sample size is likely varying by age group which will cause precision to vary.

--jeff
jlaake
 
Posts: 1480
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