Causal Design


Grad Fellow Notes: Loops in STATA

This week’s blog will feature a set of Stata tricks we used to addresses a particular issue that we encountered in our dataset.  Many of the variables were in string form and were not useable for Stata analysis.  Furthermore, the values of the variables were not in the correct order for our purposes.  A couple of commands came in handy here.  Loops are useful for many different repetitive commands.  They allowed us to quickly recode the values of a set of variables that have similar categorical values and also enabled us to destring sets of variables, setting them to numeric values.  These numeric values were in turn reordered to fit a desired pattern.  Finally, the labels for the numeric values were recoded to appear as the original text instead of just “1, 2, 3, etc”.

CategoriesBlog Post Graduate Fellow STATA

Grad Fellow Notes: STATA Command -inspect-

On a recent project, the client wanted an idea of the skew of each of a large number of variables. The data originated from a satisfaction survey (1=very dissatisfied; 5=very satisfied). On our Excel presentation sheet, we were to choose from the following options to describe the population’s view regarding each variable: right-skewed (generally very dissatisfied), left-skewed (generally very satisfied), U-shaped (most were either very dissatisfied or very satisfied, with few being neutral), or normal-shaped (most were neutral, with few being either very dissatisfied or very satisfied).

Grad Fellow Notes: STATA Tips

Managing multiple editors in STATA: For this week’s blog post, it seems useful to cover some code I’ve learned for Stata.  This first useful trick allows multiple users who are going to use the same dofile to run that file without having to first customize the filepath code.  By copying the individual usernames and filepaths […]