Page 1 of 1

missing models when imported into MARK

PostPosted: Tue Oct 11, 2011 9:43 am
by amandarg
Hi, I am using RMark for running closed capture models with full heterogeneity. They run fine but when I try to import them into MARK, my model for p(mixture+group+c) is missing. I have run this model as a stand alone and it is fine. Any ideas of what is going on?

Code: Select all
#RMark analysis
#Load RMark package
library(RMark);
rm(list=ls())
cleanup(ask=FALSE)

#inport .inp
bentsp11=convert.inp("C:/r_closed/inp/bents_spring2011.inp",
group.df=data.frame(sex=c("Male", "Female")))

bentsp11.proc = process.data(bentsp11, model = "FullHet", groups = "sex")

bentsp11.ddl = make.design.data(bentsp11.proc)

bentsp11.analysis=function()
{

#Create parameter specifications for formulas

#+c, share=true means that the recapture (c) will look like p but not be the exact same (will be equivalent of an m(b)).
#m(b)
p.dot=list(formula=~1+c,share=TRUE)
#m(b*g)
p.group=list(formula=~group+c,share=TRUE)

#mixture+c means that there are 2 mixtures (pi will be one half and 1-pi equals other half) and m(b) between p and c, so p does not equal c).
#m(bh)
p.mixture=list(formula=~mixture+c,share=TRUE)
#m(bh+g)
p.mixture.group.c=list(formula=~group+mixture+c,share=TRUE)
#m(t)
p.time=list(formula=~time,share=TRUE)
#m(t*g)
p.time.group=list(formula=~time*group,share=TRUE)
#m(t+g)
p.timeplusgroup=list(formula=~time+group,share=TRUE)

#m(.)
p.dot.c=list(formula=~1,share=TRUE)
#m(g)
p.group.c=list(formula=~group,share=TRUE)
#m(h)
p.mixture.c=list(formula=~mixture,share=TRUE)
#m(g+h)
p.mixture.group.c=list(formula=~group+mixture,share=TRUE)
#m(th)
p.timemixture.c=list(formula=~time+mixture,share=TRUE)
#m(th+g)
p.timemixturegroup.c=list(formula=~group+time+mixture,share=TRUE)
#m(bth)
p.mixture.time.behavior=list(formula=~time+mixture+c,share=TRUE)

pi.dot=list(formula=~1)
pi.group=list(formula=~group)
#no heterogeneity
pi.none=list(formula=~1, fixed=1)


N.dot=list(formula=~1)
N.group=list(formula=~group)

cml=create.model.list("FullHet")

results = mark.wrapper(cml, data=bentsp11.proc,ddl=bentsp11.ddl, output=FALSE)
return(results)
}

dummy=capture.output(bentsp11.results<-bentsp11.analysis())

summary(bentsp11.results)

bentsp11.results.table=bentsp11.results$model.table

export.MARK(bentsp11.proc, project.name="Bentsp11", bentsp11.results,
replace=TRUE)




Thanks,
Amanda

Re: missing models when imported into MARK

PostPosted: Tue Oct 11, 2011 3:02 pm
by jlaake
It looks to me that you used the same formula name for 2 different formulas.

p.mixture.group.c=list(formula=~group+mixture+c,share=TRUE)
p.mixture.group.c=list(formula=~group+mixture,share=TRUE)

The second one would have over-written the first. Change the names so they are unique and it should work just fine.

--jeff

Re: missing models when imported into MARK

PostPosted: Wed Oct 12, 2011 9:12 am
by amandarg
Thanks so much. I should have caught that.

Amanda