Method for getting model output into table?

565 views
Skip to first unread message

Jesse Saffman

unread,
Jul 3, 2017, 6:58:14 PM7/3/17
to R-inla discussion group
Hi,

I've been using INLA for some time now, and have been manually moving the output from R into tables as necessary, but I was wondering if anyone had an easier way of doing this.  I've tried using a few of the more common approaches to reading out regression, etc. outputs such as Stargazer and R2HTML but none of them seem to support INLA formatting. 

How does everyone else do this?  Do they just do this by hand every time?  It was fine, but tedious, the first few times, but as I keep refining and rerunning models, it's been taking a lot of time to do it manually.  Any ideas would be appreciated.

-Jesse

Jesse Saffman

unread,
Jul 3, 2017, 7:00:49 PM7/3/17
to R-inla discussion group
Edit: I normally use summary(model.name) to call the output, and then simply save the text to a word file before manipulating it.  The printout I get looks like this:

mean     sd 0.025quant 0.5quant 0.975quant     mode kld

Ideally I'd at least like a way to print the data without 0.5quant, mode and kld.

Elias T Krainski

unread,
Jul 3, 2017, 8:55:03 PM7/3/17
to r-inla-disc...@googlegroups.com
you can catch it directly with

model.name$summary.fixed

and select the desired columns, e.g.

model.name$summary.fixed[,c(1,2,3,5,6)]

Elias

Finn Lindgren

unread,
Jul 3, 2017, 11:17:01 PM7/3/17
to Jesse Saffman, R-inla discussion group
The stable package is quite nice for this.
It operates mainly on data.frame:s but also knows about e.g. almost and anova output; for inla, first extract the desired columns of output, or craft a custom data.frame of the output, and then call
xtable(mydata)
and then copy-paste into your latex file.

(This is particularly useful within knitr documents, since then all that's needed to get it into the latex properly is a results='asis' chunk option.)

Finn
--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages