Automating Boring Yet Significant Stuff in Stata (ABYSS)

This presentation introduces Stata users to some basic programming tools that can speed up data cleaning and analysis, a lot of which consists of repetitive commands with only slight variations. This document will introduce the following tools:

  • Macros
  • foreach and forvalues loops
  • retrieving Stata results from a variety of analyses to place them in one table
  • an example of making a program

The upside to using these tools is that as you grow more comfortable with them, you will save yourself considerable time. Being able to do data management and analyses quickly is highly valued by research organizations. The downside of these techniques is that human error can be more difficult to detect and the consequences of it can be magnified. Thus, when using these tools you need to be extra careful and review your work to make sure it is correct. Less seriously, another downside is that debugging syntax is a bit trickier.

To get the most out of this presentation, students should:

  • be comfortable and familiar with Stata syntax
  • have an understanding of logistic regression

This presentation is laid out in a Word document.  I have also made a parallel do file (data) so participants can replicate the procedures.

20181006 update: Word document and do file updated to correct some errors.