This is a simple review of the scripting language Stata created for a class that I TAed. It also doubles as an example of how to:
- Use Stata with Knitr. (Yes, that's right, we're calling Stata from R. Why not just teach students R, you ask? As I said, I was the TA.)
- Make output toggle-able (Lines 1-23).
- Add custom code highlighting (Line 25).
The file main.html
shows the results. You can also view the results at RPubs.
The R-markdown file main.rmd
ought to be compileable with RStudio once one changes:
- (Line 55)
statapath
is the path to your Stata executable. Note that this will only work if you already have Stata installed! - (Line 56)
rootpath
is the directory that contains themain.rmd
file.