This post skews towards recommending the stata add-on "markstat". For most of my students this is still recommended. For those that have some python interest/skills and especially those that have already installed jupyter notebook or lab, I highly recommend
stata_kernel and jupyter notebook (or lab).
This post is a followup to two earlier blog posts on reproducible research found here and here. This post focuses on my usage of Stata for classroom assignments turned in by students. These assignments entail
- Model Description including mathematical equations (Latex)
- Data Summaries and Figures
- Stata Code
- Stata Results
- Quality publishing system to produce a problem set document containing all of the above elements
- Easy for students to use (given a willingness to learn the markdown syntax)
These are different from my own research requirements. For me, emacs org-mode is the best tool for the reasons I outline in the prior posts linked above. For my students, however, learning Emacs and org-mode is totally impractical. This post quickly surveys the three available options: Markdoc, Markstat, and Jupyter Notebook.
Markdoc and Markstat
Over the years I have tried two Stata-centric solutions:
Both of these take a similar approach to building the assignment document. For a project, the student creates a type of
do file that contains a mix of markdown and stata commands that can then create a pdf, word document, or html output file. For example, the stata markdown file here produces this pdf document using the installable
markstat command (what I am currently using for my teaching). Both of these installable 3rd party commands take creative approaches to sidestepping Stata's shortcomings when it comes to literate programming. They mostly work well (95% of the time) but there can be platform-specific problems that are difficult to support for an instructor who wants to focus on econometrics rather than technical glitches.
In my post about reproducible research from 2017, I was fairly dismissive about using the Jupyter Notebook with Stata using Ipystata on either a Mac or Linux computer. Recently, I revisited the use of Stata with Jupyter using the stata_kernel rather than Ipystata that I outline in this post on
stata_kernel. All of my prior complaints seem to be settled and I may try using this for my courses next year.
There are numerous Jupyter Notebook demos on YouTube available so I'm not going to include a sales pitch here about capabilities, but they are impressive. The Jupyter Notebook is arguably the most used scientific research platform and is used here on campus for teaching a number of the Computer Science courses so many students will already be aware of basic usage and setup.