unique time covariates in nest survival model

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

unique time covariates in nest survival model

Postby ajudel » Fri Oct 29, 2021 5:00 pm

Hi! I am modeling duckling survival using nest survival in RMark. I am struggling with how to add time varying covariates (daily rainfall and daily minimum temperature) to my model. These covariates differ for each individual because they were marked in different years. How can I add these time covariates and have them be unique for each individual? Doing so is straight forward using known fates but I haven't had any success finding a way to do this with nest survival. Any advice would be much appreciated!
ajudel
 
Posts: 1
Joined: Fri Oct 29, 2021 3:36 pm

Re: unique time covariates in nest survival model

Postby jlaake » Fri Oct 29, 2021 6:20 pm

Easiest thing to do is to use year as a group variable such that everything in the group will have the same rainfall and temperature variables across time. Then use merge_design.covariates to add the variables to the ddl$S. Here is an example using the mallard data set in RMark. My example with the precip variable isn't useful because it is the same value for each time but it was quick and dirty. You can read in a dataframe into R with all of the values rather than constructing like I did here.

Code: Select all
library(RMark)
data(mallard)
mallard$habitat <- as.factor(mallard$habitat)
mallard.pr <- process.data(mallard,
                          nocc=90,
                          model="Nest",
                          groups=("habitat"))
ddl=make.design.data(mallard.pr)
df=data.frame(precip=1,group="Native",time=1:89)
df=rbind(df,data.frame(precip=2,group="Wetland",time=1:89))
df=rbind(df,data.frame(precip=3,group="Planted",time=1:89))
df=rbind(df,data.frame(precip=3,group="Roadside",time=1:89))
merge_design.covariates(ddl$S,df,bygroup=TRUE,bytime=TRUE)
ddl$S=merge_design.covariates(ddl$S,df,bygroup=TRUE,bytime=TRUE)
mark(mallard.pr,ddl,model.parameters=list(S=list(formula=~precip)))

jlaake
 
Posts: 1413
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

cron