I am modeling survival using Known Fate models in RMark and I need to model average my results. I have 4 factor variables and 5 covariates. My factors are site, habitat type, year, and population level. (I did not include site and habitat in the same model.)
I have 11 sites, 2 years, and 4 population levels. Some of my sites were only active in 1 of the 2 years. My covariates are nest height, water depth, nest density, day of season, and season-squared.
I have two questions:
1) What command do I use (and what would the code look like) to model average with more than one grouping variable? I know I can use covariate.predictions to model average with multiple covariates, but can I use this same command to model average with multiple factors? When I tried to use it I did not get the results I expected.
2) Is it possible to obtain one survival estimate for each site in each year rather than getting an estimate for each site at each population level in each year?
Here is an example of some of my code:
- Code: Select all
trbl=read.table("TRBL.txt",header=T,colClasses=c("character","factor","factor","numeric","numeric","numeric","numeric","numeric","factor","factor"))
#Create process data
trbl.proc=process.data(trbl,model="Known",groups=c("site","habitat","population","year"))
#Create design data
trbl.ddl=make.design.data(trbl.proc)
do.analysis=function()
{
S.site.season.season2.height.water.nests.pop.year=list(formula=~site+season+season2+height+water+population+nests+year)
S.site.season.season2.height.nests.water.year=list(formula=~site+season+season2+height+nests+water+year)
S.site.season.season2.height.nests.pop.year=list(formula=~site+season+season2+height+nests+population+year)
S.habitat.season.season2.height.nests.water.year=list(formula=~habitat+season+season2+height+nests+water+year)
S.habitat.season.season2.height.nests.pop.year=list(formula=~habitat+season+season2+height+nests+population+year)
cml=create.model.list("Known")
model.list=mark.wrapper(cml,data=trbl.proc,ddl=trbl.ddl)
return(model.list)
}
myresults=do.analysis()
myresults
I ran more models than this, but this should give you an idea of what the analysis looked like.
Thank you very much!