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