Hi everyone,
I have a question about plotting the effects of individual covariates within different groups. I am looking at the effects of hunting on dispersal and survival, and also the the cost of dispersal on survival, of mountain hares. I have two areas, one hunted and one non-hunted, with radio collared individuals in each. I am using Known Fate models in RMark to assess survival and have estimated dispersal distances from the radio telemetry data. I have treatment (hunted, non hunted), sex, birth month and year as groups and dispersal distance (LDD) as individual covariates in the KF model.
I have plotted the effects of dispersal distance on survival probability using the code below:
cov.levm=function()
{
levm.proc=process.data(levm,model="Known",groups=c("BM","Treatment","Year","Sex"),initial.ages=1)
levm.proc=process.data(levm,model="Known",groups=c("BM","Treatment","Year","Sex"),initial.ages=1
,begin.time=1)
levm.ddl=make.design.data(levm.proc)
S.LevYear.Block.Time.DD=list(formula=~Year+Treatment+Time+LDD)
model.list=create.model.list("Known")
levm.results=mark.wrapper(model.list,data=levm.proc,ddl=levm.ddl)
# Return model table and list of models
return(levm.results)
}
covariate.results=cov.levm()
mindist=min(levm$LDD)
maxdist=max(levm$LDD)
dist.values=mindist+(0:1000)*(maxdist-mindist)/1000
Sdist=covariate.predictions(covariate.results,data=data.frame(LDD=dist.values),indices=c(1))
plot(Sdist$estimates$covdata,Sdist$estimates$estimate,xlab="Dispersal distance (m)",ylab="Survival")
lines(Sdist$estimates$covdata,Sdist$estimates$lcl,lty=2)
lines(Sdist$estimates$covdata,Sdist$estimates$ucl,lty=2)
However, I would like to asses whether the effects of dispersal on survival differ between groups. Eg. if there is a greater cost of dispersal in males over females, or hunted population over the non-hunted population.
Is it possible to plot different graphs for dispersal against survival within different groups?
Many thanks,
Annabel