Germán Rodríguez
Stata Markdown Princeton University

A Simple Script

This is the input script:

simpleScript.stmd
Let us read the fuel efficiency data that is shipped with Stata

    sysuse auto, clear

To study how fuel efficiency depends on weight it is useful to
transform the dependent variable from "miles per gallon" to
"gallons per 100 miles"

    gen gphm = 100/mpg

We then obtain a more linear relationship

    twoway scatter gphm weight || lfit gphm weight ///
        , ytitle(Gallons per Mile) legend(off)
    graph export auto.png, width(500) replace

![Fuel Efficiency](auto.png)

That's all for now!

And this is how it is rendered by markdown using simpleScript

simpleScript.html

Let us read the fuel efficiency data that is shipped with Stata

. sysuse auto, clear
(1978 Automobile Data)

To study how fuel efficiency depends on weight it is useful to transform the dependent variable from "miles per gallon" to "gallons per 100 miles"

. gen gphm = 100/mpg

We then obtain a more linear relationship

. twoway scatter gphm weight || lfit gphm weight ///
>     , ytitle(Gallons per Mile) legend(off)

. graph export auto.png, width(500) replace
(file auto.png written in PNG format)
Fuel Efficiency

Fuel Efficiency

That's all for now!