Stata code for dissertation