Effects of individual covariates within different groups

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

Effects of individual covariates within different groups

Postby annieh » Tue Nov 02, 2010 9:20 am

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
annieh
 
Posts: 6
Joined: Sun Feb 07, 2010 10:31 am

Re: Effects of individual covariates within different groups

Postby jlaake » Tue Nov 02, 2010 12:20 pm

Your sentence "I want to assess" is not well-defined. If you only want to examine graphically the differences then use different indices that match the particular groups that you want to display. The indices argument defines which of the parameters you want to compute. Each group will have a different index and because you have Time in your model there will be a different index for each occasion. You can use the PIMS function to see the indices or you can use the function extract.indices to get the indices for particular occasions/groups. In the case of known fate models the row value will always be 1. Only with triangular PIMS will you have a row>1. Be careful about what you are plotting. Also, an "assessment" may mean that you want to select from a set of models some of which include the covariate dispersal and others that do not. Minor points: you have 2 calls to process.data and you don't need to assign initial.ages if you are not going to use it.

--jeff
jlaake
 
Posts: 1479
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