Teaching with Stata

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

  1. Model Description including mathematical equations (Latex)
  2. Data Summaries and Figures
  3. Stata Code
  4. Stata Results
  5. Quality publishing system to produce a problem set document containing all of the above elements
  6. 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:

  1. Markdoc
  2. Markstat

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.

Jupyter Notebook

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. 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.