clear set mem 2000m set matsize 800 set more off capture log close set logtype text set trace off #delimit; global path ~; log using $path/ui/logs/bn_master.log, replace; /*======================================= Program: bn_master.do Author: Avi Ebenstein Created: May 2005 Purpose: Create Stata files from data provided by Andy Spizak. ========================================*/ ********************; * Bring in BAM data ; ********************; insheet mstate mkw mcatyp mp4 mbatch mseq mlo minv b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 c1 c2 c3 c4 c5 c6 c7 c8 c9 d1 d2 d3 d4 d5 d6 d7 d8 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14 e15 e16 e17 e18 e19 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 g1 g2 g3 g4 g5 g6 g7 g8 g9 g10 g11 g12 g13 g14 g15 h1 h2 h3 h4 h5 h6 h7 h8 h9 h10 h11 mdp v98 using $path/ui/BN_DATA/rawfiles/bn_master_pool.tbl, delimiter("|"); compress; save $path/ui/BN_DATA/datafiles/bn_master.dta, replace; use $path/ui/BN_DATA/datafiles/bn_master.dta, replace; do $path/ui/BN_DATA/dofiles/bn_master_value_labels.do; do $path/ui/BN_DATA/dofiles/bn_master_labels.do; gen year=substr(mkw,7,4); destring year, replace; rename mstate state; rename mbatch batch; sort state batch; save $path/ui/BN_DATA/datafiles/bn_master_clean.dta, replace;