RMark Nest Survival - factor covariate "not found"

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

RMark Nest Survival - factor covariate "not found"

Postby meagan » Mon Mar 13, 2017 2:16 am

Hello,

I've been trying to run a Nest Survival analysis and everything works except that any models containing my one factor variable are skipped over, and I get the following error:

Code: Select all
Error in run.vtnests() : object 'PpnConserved8' not found


I have successfully run similar analyses with different data, and with these data in the past, so I don't think the issue is outdated software (I'm on RMark 2.2.0). Here is my code:

Code: Select all
vtnests.processed <- process.data(vtnests,model="Nest",nocc=77, groups=c("PpnConserved8"))
vtnests.ddl <- make.design.data(vtnests.processed)

run.vtnests=function()                                               
{
  S.Dot=list(formula=~1)
  S.model1=list(formula=~AgeFound, totalnests, PpnConserved8)
  S.model2=list(formula=~AgeFound, PpnConserved8)
  S.model3=list(formula=~AgeFound, totalnests)
  S.Robel=list(formula=~Robel)
  S.Totalponds=list(formula=~Totalponds)
  S.NestDensity=list(formula=~totalnests)
  S.PpnConserved8=list(formula=~PpnConserved8)
  S.Time=list(formula=~Time)
  S.NestAge=list(formula=~NestAge)
 
  cml=create.model.list("Nest")
  return(mark.wrapper(cml,data=vtnests.processed,ddl=vtnests.ddl))
}

vtnests.results<-run.vtnests()
vtnests.results


Like I said, it runs fine but the 3 models containing PpnConserved8 are not included in the model-selection table, but they are listed as "glabel's" in the MARK output.

I also get this error when trying to run a model containing PpnConserved8:
Code: Select all
Invalid model specification for parameter S.
Unrecognized element
Error in make.mark.model(data.proc, title = title, parameters = model.parameters,  :
 
Error in mark(model.parameters = model.parameters, initial = initial,  :
  Misspecification of model or internal error in code


I've searched the manual and forum, scrutinized my data files and tried different combinations of everything I can think of to fix it. Would really appreciate any other ideas!
meagan
 
Posts: 2
Joined: Sun Mar 12, 2017 6:42 pm

Re: RMark Nest Survival - factor covariate "not found"

Postby jlaake » Tue Mar 14, 2017 10:36 am

I responded offlist via email with plans to look at this now. I see now that my hasty response via email was not correct. Initially I thought this was because PpnConserved8 was more than 10 characters. However that is only a restriction when the variable is an individual numeric covariate in which the name of the variable is used in the design matrix because MARK has this restriction. Instead PpnConserved8 is a factor variable used in the groups argument which creates separate PIMS for each group. It is hard to see what models didn't work here but clearly the following formula are not correct.

S.model1=list(formula=~AgeFound, totalnests, PpnConserved8)
S.model2=list(formula=~AgeFound, PpnConserved8)
S.model3=list(formula=~AgeFound, totalnests)

The comma should be a + or some other operator like *. Unless this was a typo you need to spend more time reading about R formulas.

Whenever a model doesn't show up you should run that model alone so you can see error messages. Also, if you include run=FALSE in mark.wrapper you can test whether the formula are correct and any errors are identified.

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