fit object to Latex table

407 views
Skip to first unread message

Shira Mitchell

unread,
Sep 20, 2014, 12:05:44 PM9/20/14
to stan-...@googlegroups.com
Hello Stan gurus,

I've used the R package xtable in the past in order to get Latex tables from R output.  Is there any way to do with this a Stan fit object? xtable takes any of these objects:

> methods(xtable)
 [1] xtable.anova*           xtable.aov*             xtable.aovlist*         xtable.coxph*          
 [5] xtable.data.frame*      xtable.glm*             xtable.lm*              xtable.matrix*         
 [9] xtable.prcomp*          xtable.summary.aov*     xtable.summary.aovlist* xtable.summary.glm*    
[13] xtable.summary.lm*      xtable.summary.prcomp*  xtable.table*           xtable.ts*             
[17] xtable.zoo* 

Any suggestions are welcome.

Thanks so much,
Shira

Richard McElreath

unread,
Sep 20, 2014, 12:17:13 PM9/20/14
to stan-...@googlegroups.com
Rstan's summary method returns an invisible list of matrix tables. So you just extract those and pass them to xtable. e.g.:

s <- summary(fit)
xtable(s$summary)

That should work just fine, as xtable will recognize that s$summary is a matrix.

Cody Ross

unread,
Sep 22, 2014, 7:30:49 PM9/22/14
to stan-...@googlegroups.com

Thanks for that reply Richard,

I've been trying to figure out how to get the Stanfit results into a readable form.
Reply all
Reply to author
Forward
0 new messages