I wrote a short talk demonstrating the use the R package {estout} for tonight’s New England R Users Group meeting. NB this is not a discussion of the econometric model, but rather a demonstration of how to get publication-quality results out of R efficiently.

The basic functions of {estout} are modeled on the Stata package estout. Once the R user has a dataset and a regression format in memory, {estout} will

- Print tables of summary statistics in CSV or LaTeX format.
- Print regression results in CSV or LaTeX format.

All the normal bells and whistles for econometrics are in there: reporting both coefficient estimates and their standard errors, asterisks for alpha=0.10, 0.05, and 0.01 significance levels, R-squared and number of observations. Options to customize are clearly marked in the documentation.

### Like this:

Like Loading...

*Related*

## About Ben Mazzotta

Ben Mazzotta is a postdoc at the Center for Emerging Market Enterprises (CEME). His study of the Cost of Cash is part of CEME's research into inclusive growth.

Hi Ben,

I just discovered this package today and it’s fantastic!

One question: when I loop over models, I store them as elements in a list (called “res”).

My guess is that I can do lapply(res, eststo), right? Also, does estout work fine with glm?

I asked this because the table doesn’t come out exactly right (R^2 missing).

I haven’t tried using the lapply method. One possible pitfall is that you would need to watch the behavior of the stored models. If you wanted individual tables printed, rather than several columns in a table, you might need to store the model, print it, and clear it in several steps.

Two developments you should try for yourself. First is the stargazer package that will summarize data frames and models elegantly for LaTeX. Second is the knitr package that produces either LaTeX or HTML output. Recommend you work with sweave files or r markdown files in RStudio, that facilitates drafting and compiling them.

Thank you for reading. Let me know how your apply code works with estout.