Extracting information from best model

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

Extracting information from best model

Postby pascalinelg » Mon Jul 08, 2013 8:12 am

Hi all,

Using R, we have simulated a series of 100 input files in multistrata format. We the used RMark to define a set of models in order to estimate demographic parameters. we would like to extract information (formula, parameter estimate and variance) from the best model for each simulated data without knowing the model number (unlike in the example "myresults[[3]]") .

we tried things like:
bestmodel=caphist.results[caphist.results$model.table$DeltaAICc==0]
bestmodel$model.name
bestmodel$results$real

but it doesn’t work

we ‘ve also tried to extract the formula of S, Psi and p from the first line of the model.table and construct a model with these parameters, but it doesn’t work

does anyone know how we can do it?

Thanks in advance.

Pascaline
pascalinelg
 
Posts: 2
Joined: Mon Jul 08, 2013 4:07 am

Re: Extracting information from best model

Postby jlaake » Mon Jul 08, 2013 9:18 am

The model numbers are the row numbers in the model.table assuming you used mark.wrapper to run the models. Try the following

Code: Select all
bestmodel=as.numeric(rownames(caphist.results$model.table)[1])
capthist.results[[bestmodel]]$results$real
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Extracting information from best model

Postby pascalinelg » Tue Jul 09, 2013 2:58 am

Hi,

thank you very much, it's work very well!

I use collect.models (because I test only a reduced number of models) and it works as well

to extract the formula I added the line:

caphist.results$model.table[1,4]

to extract the parameter estimates I use the code you posted
bestmodel=as.numeric(rownames(caphist.results$model.table)[1])
caphist.results[[bestmodel]]$results$real

thanks again for your quick answer!
Pascaline
pascalinelg
 
Posts: 2
Joined: Mon Jul 08, 2013 4:07 am


Return to RMark

Who is online

Users browsing this forum: No registered users and 2 guests

cron