Page 1 of 1

exporting models using function export.MARK

PostPosted: Thu Mar 10, 2011 12:52 pm
by tommyg
Hi,

I have what should be a beginner's question, but haven't been able to find the correct solution. I've been using the export.MARK function in addition with the collect.models function to export my models to MARK (eventually I need to estimate the overdispersion parameter using the median c hat approach). In MARK, I then go to Files > RMark Import > .... When I do this, MARK always uses the unadjusted parameters to calculated AICs, but I would prefer it to use the actual number of parameters in the model and rather than adjust downward for identifiability, singularity etc.. This seems simple enough to do in some functions in RMark, but I haven't had success exporting models with the number of parameters that I would prefer to use when doing model comparison.

Thanks.

Tommy

Re: exporting models using function export.MARK

PostPosted: Thu Mar 10, 2011 1:23 pm
by jlaake
You'll need to use the Adustment menu item in the MARK interface to adjust the number of parameters for each model. The import facility doesn't have a capability to do this automatically. Presumably if you are doing this for median chat then you only need to adjust parameters for one model.

--jeff

Re: exporting models using function export.MARK

PostPosted: Wed Aug 01, 2012 1:41 pm
by timkdavies
Hi Jeff,

I am having problems converting my data in RMark to an .inp file I can use in MARK.

The code I have been using is below:

Code: Select all
Alldata.proc=process.data(Alldata,model="HugFullHet",
               mixtures=2, groups=c("species","sex","age","habitat","site")
               )

export.chdata(Alldata.proc,"Alldata",covariates="weight")

# Convert.inp and store in another object named Alldata2
Alldata2=convert.inp("Alldata",
   group.df=data.frame(species=c("AS","CG","MA"),sex=c("Female","Male"),age=c("A","JUV","SA"),
            covariates="weight",habitat=c("broad","clearfell","grassland","heather","larch","pine"),
            site=c("one","three","two"))
)


The error message is

Error in convert.inp("Alldata", group.df = data.frame(species = c("AS", :

Number of columns in data file does not match group/covariate specification
>
My data in the txt file and when loaded into RMark is in columns - ch, species, sex, age, weight, habitat, site. Have I specified the factors and covariates incorrectly?

Any help greatly appreciated!
Cheers

Re: exporting models using function export.MARK

PostPosted: Wed Aug 01, 2012 1:50 pm
by timkdavies
Sorry this is the code tweaked from looking at the workshop notes

Code: Select all
Alldata.proc=process.data(Alldata,model="HugFullHet",
               groups="species","sex","age","habitat","site")
               
export.chdata(Alldata.proc,"Alldata",covariates="weight")

# Convert.inp and store in another object named Alldata2
Alldata2=convert.inp("Alldata",
   group.df=data.frame(species=c("AS","CG","MA"),sex=c("Female","Male"),age=c("A","JUV","SA"),
            covariates="weight",habitat=c("broad","clearfell","grassland","heather","larch","pine"),
            site=c("one","three","two"))
)


I still get the same error however...