< a quantity that can be divided into another a whole number of time />

Weaving Stata

November 15, 2014

Here are some possibilities for weaving Stata commands without much effort. I used to use StatWeave, as described in this post. In essence, it is similar to Sweave and you write code chunks with options, etc. A concise description is provided in these slides (PDF). Although less sophisticated than Sweave or knitr, it provided enough features for me to write a full textbook for a course I teach at the university.

There is also dexy and its Stata filter, but I haven’t investigated this much. Are there any other direct options, à la knitr?

In this blog post, Stata Markdown, some options to deal with Stata log files using Markdown-based processor are discussed, although one of the conclusion was:

You can do “markdown” in Stata. (…) It’s complicated.

For direct HTML output where syntax highlighting is enabled, you can have a look at the recent Synlight Package. Weaving Stata Output and Annotations using the weave command provides another option. But, as can be seen, it shortly comes rather cumbersome as you have to embed HTML code chunks to display images that have to be saved as PNG files. Other alternatives, which work together, are:


See Also

» Structural equation modeling with Stata » Bar charts of counts in Stata » ODBC drivers on Mac OS X » Weaving Stata Documents » Weaving scientific documents