RMARK: Groups in Nest Survival

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

RMARK: Groups in Nest Survival

Postby bacollier » Fri Nov 07, 2008 3:38 pm

All,
Working with a simple nest survival model in RMark I am having some struggles (apparently) appropriately defining groups. I created a covariate (Group) in the data set, made it a factor on import

> str(vireo.data$Group)
Factor w/ 8 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 2 ...

and based on what I read in the RMark guide I put a groups= statement in my mark() call

dsr.g=mark(vireo.data, nocc=111, model="Nest", model.parameters=list(S=list(formula=~Group)), groups=c("1", "2", "3", "4", "5", "6", "7", "8"))

which then gives me the following error when I run my analysis.

> run.vireo=function()
+ {
+ dsr.g=mark(vireo.data, nocc=111, model="Nest", model.parameters=list(S=list(formula=~Group)), groups=c("1", "2", "3", "4" .... [TRUNCATED]

> vireo.results=run.vireo()
Error in `[.data.frame`(data, , groups[i]) : undefined columns selected

Since process.data does not exist for nest survival datatype (I think) I could not use the groups command there. Do I need to create an dummy variable for each factor level?

Any suggestions?

Bret

Mark 1 October build, using RMark v1.8.7 updated for 1 Oct Mark, R version 2.7.2.
bacollier
 
Posts: 230
Joined: Fri Nov 26, 2004 10:33 am
Location: Louisiana State University

Postby jlaake » Fri Nov 07, 2008 7:54 pm

Bret-

Proper syntax is

dsr.g=mark(vireo.data, nocc=111, model="Nest", model.parameters=list(S=list(formula=~Group)), groups="Group")


You use the name of the field(s) that define the groups. If you have 2 or more variables you would use groups=c("var1","var2"...) where var1 and var2 would be factor variables.

--jeff
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Postby bacollier » Mon Nov 10, 2008 10:01 am

Thanks Jeff, I was using the c() thinking it needed to be a vector.

So, everyone, a follow up now that I have that fixed: In this nest survival model I am using 100 individual covariates associated with each sampling occasion (day) in the dataset which are stages of the nesting season (1=egg stage, about 10 days, 2=nestling stage, about 15 days).

So, I can use a time-varying individual covariates (outlined in RMARK whats new V. 1.8.2 (26 June 2008)) to estimate DSR for each stage (coded 1 or 2 as above) using plogis.

stage<-1:2
> DSR_WEVI<-plogis((intercept + slope_wevi*stage), lower.tail=T)
> DSR_BCVI<-plogis((intercept + slope_bcvi*stage), lower.tail=T)
> DSR_WEVI
[1] 0.9493673 0.8947853
> DSR_BCVI
[1] 0.9460775 0.8816069


But, I am stuck on how to apply the delta method for individual covariate type models like these as I have only seen them for PIMS based models in MARK? Assuming I extract the vc matrix (below), the only comparisons I am interested in are the 2 stages, but I obviously have 3 (0=not active is included) periods, but, does the same vc matrix hold for both species? I would think not, but I cannot figure it out? I can work out the delta method code myself, but I could use some help on what vc matrix I need to be using.

This is the vc matrix for the best model.

> vireo.results[4]$dsr.Spec.t$results$beta.vcv
[,1] [,2] [,3]
[1,] 0.1868626 -0.11514218 -0.12784094
[2,] -0.1151422 0.08286332 0.07877386
[3,] -0.1278409 0.07877386 0.11384983

Thanks,
Bret
bacollier
 
Posts: 230
Joined: Fri Nov 26, 2004 10:33 am
Location: Louisiana State University


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest