Germán Rodríguez
Stata Markdown Princeton University

Estimates

The next example shows how to use Jann's esttab command in conjunction twith markdown to generate a nice table of estimates. The code below fits two models to the fuel efficiency data and then compares them side-by-side. We use the strict syntax and supress command echoing to produce a dynamic report. Here is the input:

estimates.stmd
A Table of Estimates
--------------------

The table below shows estimated differences in fuel efficiency between
foreign and domestic cars with and without adjustment for weight, using
gallons per 100 miles as the outcome.

```s/
    quietly sysuse auto
    quietly gen gphm = 100/mpg
    eststo clear
    quietly eststo: regress gphm foreign
    quietly eststo: regress gphm foreign weight
    esttab
```

We see that on average foreign cars are more economical, but
if we adjust for weight they are less fuel efficient, using
`s %3.1f _b[foreign]` gallons *more* instead of one gallon
*less* per 100 miles.

And this is how this is rendered by the command markdown using estimates, strict. Don't forget to specify the strict option.

estimates.html

A Table of Estimates

The table below shows estimated differences in fuel efficiency between foreign and domestic cars with and without adjustment for weight, using gallons per 100 miles as the outcome.

────────────────────────────────────────────
                      (1)             (2)   
                     gphm            gphm   
────────────────────────────────────────────
foreign            -1.005**         0.622** 
                  (-3.29)          (3.11)   

weight                            0.00163***
                                  (13.74)   

_cons               5.318***      -0.0735   
                  (31.92)         (-0.18)   
────────────────────────────────────────────
N                      74              74   
────────────────────────────────────────────
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

We see that on average foreign cars are more economical, but if we adjust for weight they are less fuel efficient, using 0.6 gallons more instead of one gallon less per 100 miles.