RMark, nest survival model, age and stage effect

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

RMark, nest survival model, age and stage effect

Postby lihuanwxr » Mon Dec 04, 2017 9:50 am

Hi, all. I am using RMark to model the effect of nest age, nest stage (i.e., incubation vs nestling stages), breeding season (Time), and year on the DSRs.
Here I came across two issues and I am not sure how to address them. .
1.The first one is about the age of the nests. When I use nest age to calculate the DSRs the resulting numbers are very low, especially towards the end of the breeding season (e.g., only 0.0107187 at a169 t170). Unless I am mistaken, I believe these values are unrealistically small and I am therefore concerned that there is something wrong with the way I model nest age. I attach my code and a subset of the data here (please see Model 2). I should mention here that I calculate the age of the nests in the following way: for the nests that belong to the incubation stage, Age 1 is the day the first egg was layed. The AgeFound for this group range from 1 to 11. For the nests that belong to the nestling stage, Age 1 is the day the first nestling hatched. The AgeFound here range from 1 to 10.

2.The second issue is about the time trend. For the purposes of my project I am interested in evaluating the effect of time across stages but also within stages. I am assuming that the way the latter is done is by modeling the interaction between the time and stage. In the attached code I have a model (No 4) with time only -- in order to measure the across stages effect -- and another model (No 5) with only the interaction in order to measure the within stages effect. I am wondering whether this is a valid approach or whether another approach is more appropriate

Thanks and looking forward to response.
Huan.


Code: Select all
library(RMark)
exampledata$Stage=as.factor(exampledata$Stage)nocc=max(exampledata$LastChecked)
nocc
run.example = function()
{
#Model 1. Constant-rate model Constant=mark(exampledata,nocc=171,model="Nest",model.parameters=list(S=list(formula=~1)))
#Model 2. Test the effect of nest age
Age=mark(exampledata,nocc=171,model="Nest",model.parameters=list(S=list(formula=~NestAge)))
#Model 3. Test the effect of stage
Stage=mark(exampledata,nocc=171,model="Nest",model.parameters=list(S=list(formula=~Stage)),groups=c("Stage"))
#Model 4. Test the effect of time across stages
Time=mark(exampledata,nocc=171,model="Nest",model.parameters=list(S=list(formula=~Time)))
#Model 5. Test the effect of time within stages
TimeStage=mark(exampledata,nocc=171,model="Nest",model.parameters=list(S=list(formula=~Time:Stage)),groups=c("Stage"))
 return(collect.models() )
}
exampleresults=run.example()
exampleresults
           model npar     AICc DeltaAICc     weight Deviance
1    S(~NestAge)    2 560.5535  0.000000 0.57662057 556.5457
2          S(~1)    1 563.3316  2.778057 0.14376154 561.3290
4       S(~Time)    2 563.5766  3.023130 0.12718204 559.5689
5 S(~Time:Stage)    3 564.2841  3.730572 0.08929080 558.2685
3      S(~Stage)    2 564.9770  4.423500 0.06314505 560.9692

exampleresults$Age$results$real
P               estimate           se          lcl       ucl fixed    note
S g1 a0 t1     0.9999481 0.0001662114 9.731741e-01 0.9999999             
S g1 a1 t2     0.9999435 0.0001787721 9.729513e-01 0.9999999             
S g1 a2 t3     0.9999384 0.0001922525 9.727266e-01 0.9999999 
......
S g1 a164 t165        0.0163148       0.0516864       0.3007950E-004  0.9014259                           
S g1 a165 t166        0.0150030       0.0481720       0.2558598E-004  0.9006681                           
S g1 a166 t167        0.0137953       0.0448805       0.2176370E-004  0.8999051                           
S g1 a167 t168        0.0126835       0.0417998       0.1851240E-004  0.8991370                           
S g1 a168 t169        0.0116602       0.0389181       0.1574678E-004  0.8983638                           
S g1 a169 t170        0.0107187       0.0362241       0.1339432E-004  0.8975855 
lihuanwxr
 
Posts: 3
Joined: Tue May 02, 2017 7:18 am

Re: RMark, nest survival model, age and stage effect

Postby Rotella » Mon Dec 04, 2017 3:33 pm

Huan,
I recommend using the estimated beta's and appropriate link function from your model with nest age and applying those to the actual nest ages that you observed for nests. The observed ages are likely in some restricted range such as ages 0 days old to perhaps as high as 45 days old. If you use the actual age values, you can obtain estimates of daily survival rate associated with those ages. RMark is providing estimates for nest ages starting with age 0 on the first day of the study season and ending with age 169 on the last day of the season. Typically, one doesn't have any nests that have ages that range so widely as that. Thus, the reported estimates of the real parameters are not of interest. Instead one wants to use the model's estimated beta's , associated variance-covariances, and covariate values of interest to generate estimates of daily survival for appropriate covariate values.
Jay
Rotella
 
Posts: 43
Joined: Mon Jun 09, 2003 11:32 am

Re: RMark, nest survival model, age and stage effect

Postby lihuanwxr » Thu Dec 07, 2017 11:39 am

Rotella wrote:Huan,
I recommend using the estimated beta's and appropriate link function from your model with nest age and applying those to the actual nest ages that you observed for nests. The observed ages are likely in some restricted range such as ages 0 days old to perhaps as high as 45 days old. If you use the actual age values, you can obtain estimates of daily survival rate associated with those ages. RMark is providing estimates for nest ages starting with age 0 on the first day of the study season and ending with age 169 on the last day of the season. Typically, one doesn't have any nests that have ages that range so widely as that. Thus, the reported estimates of the real parameters are not of interest. Instead one wants to use the model's estimated beta's , associated variance-covariances, and covariate values of interest to generate estimates of daily survival for appropriate covariate values.
Jay


Thanks, Jay. There are two methods that I used to estimate DSR.
Code: Select all
#ggplot() is used to plot time model
Time<-exampleresults[[as.numeric(rownames(exampleresults$model.table))[3]]]
Time
Time.estimates<-summary(Time,se=TRUE)$reals$S
Time.estimates
TimeDSR<-ggplot(Time.estimates, aes(x=Time, y=estimate))+geom_line(color='blue', size=1)+ geom_ribbon(colour=NA,alpha=0.2,aes(ymin= lcl,ymax=ucl))+ theme_gray()+ylab("DSR")+xlab("") + ylim(0.91,0.98)
TimeDSR
#inv.logit() is used to plot Time model
exampleresults$Time$results$beta
curve(inv.logit(3.302 - 0.004*x ),1,171,col = 6,ylim = c(0.91,0.98))


But I don't understand what's the meaning of
Code: Select all
exampleresults$Age$results$real
lihuanwxr
 
Posts: 3
Joined: Tue May 02, 2017 7:18 am

Re: RMark, nest survival model, age and stage effect

Postby Rotella » Thu Dec 07, 2017 11:56 am

That code will provide you estimates of the real parameters. However, you need to be sure that those estimates are based on covariate values of interest. Using various RMark functions for obtaining predicted values for covariate values of interest along with associated measures of uncertainty might be useful.
Rotella
 
Posts: 43
Joined: Mon Jun 09, 2003 11:32 am

Re: RMark, nest survival model, age and stage effect

Postby lihuanwxr » Tue Dec 12, 2017 12:16 am

Rotella wrote:That code will provide you estimates of the real parameters. However, you need to be sure that those estimates are based on covariate values of interest. Using various RMark functions for obtaining predicted values for covariate values of interest along with associated measures of uncertainty might be useful.

Hi, Jay. Thank you for your help. It would be great to hear your opinion on the other two issues I mentioned above, which are still tormenting me.

1. The first issue is about the method I used to calculate the nest age for the two stages (i.e., egg and nestling stages). Currently, I calculate the nest age for the egg stage by considering day 1 as the first day the egg was layed (age ranges from 1-11 for this example). For the nestling stage, I consider day 1 as the day the nestling hatched (age ranges from 1-11). An alternative approach would be to keep day 1 the same for both stages, which in that case the nest age for the egg stage would range from 1 to 11 and for the nestling stage from 12 to 22. It’s unclear to me which method is the correct one.

The reason I choose the first is because the incubation period varies a bit, therefore when a nest was found at the nesting stage it is not clear how many days should be added for the duration of the preceding egg-stage for that particular nest.

2. The second issue is about how to model the time trend. I would like to test the effect of time across the two stages but also within the stages. I am wondering whether the right way to test the “within the stages” effect is by modeling the interaction between time and stage. For example in the code below, I have a model (No 4) with time only (to measure the across the stages effect), and another model (No 5) with the interaction only to measure the within stages effect. Is this the right way?

Huan.

Code: Select all
#Model 4. Test the effect of time across stages
Time=mark(exampledata,nocc=171,model="Nest",model.parameters=list(S=list(formula=~Time)))
#Model 5. Test the effect of time within stages
TimeStage=mark(exampledata,nocc=171,model="Nest",model.parameters=list(S=list(formula=~Time:Stage)),groups=c("Stage"))
lihuanwxr
 
Posts: 3
Joined: Tue May 02, 2017 7:18 am

Re: RMark, nest survival model, age and stage effect

Postby Rotella » Tue Dec 12, 2017 12:17 pm

The answers really depend on what questions you want to ask. One way to handle your uncertainty about how to model the data (or which model to use) is to model it various ways that you think are reasonable and evaluate the support from the data for different models using a method like AICc scores. Also, if you have uncertainty in when stage transitions occur, you might consider using a multi-state approach as described in Devineau et al. (2014) http://onlinelibrary.wiley.com/doi/10.1002/jwmg.660/abstract, which accommodates such uncertainty and works for nest-survival data.
Rotella
 
Posts: 43
Joined: Mon Jun 09, 2003 11:32 am


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest