Save summary/print for stanfit object

202 views
Skip to first unread message

Sierra

unread,
Jan 27, 2016, 4:02:55 PM1/27/16
to Stan users mailing list

Hello Dear Stan Users,

How can I save the helpful summary output of print.stanfit?

For example, cfa1 is a stanfit object with a large number of parameters. I need to save the summary obtained from 
print(cfa1, pars=c("nu", "lambda", "cov"))

But there doesn't seem to be a way to save this output, for example I want to do something like:
sum<-data.frame(print(cfa1, pars=c("nu", "lambda", "cov")))
...but this returns an empty data frame. 

I've tried to modify the print.stanfit function to allow the function to return a non-NULL result for me, but so far no luck. However, I imagine I'm not the first person who has wanted to save this information. Is it possible to allow the function to do this?

I need to save summary results for each of a large number of replications to summarize results for conditions of a simulation study. 

Best,
Sierra

Ben Goodrich

unread,
Jan 27, 2016, 4:47:26 PM1/27/16
to Stan users mailing list
On Wednesday, January 27, 2016 at 4:02:55 PM UTC-5, Sierra wrote:
How can I save the helpful summary output of print.stanfit?

You can do

s <- summary(cfa1)$summary

or there is now a stanfit method in the broom package.

Ben

Sierra Bainter

unread,
Jan 28, 2016, 10:07:26 AM1/28/16
to stan-...@googlegroups.com
fantastic, thank you!

--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/OwWsUZMI3Vg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages