set more 1 /* File: cepr_basic_geog.do Date: Nov 21, 2006 Desc: Creates consistent geographical variables for CEPR consistent extract of Basic CPS Note: See copyright notice at end of program. */ /* note: any pre-1994 data processing is not yet correct; use only to process data from 1994 forward */ /* Determine data year */ local year=year in 1 /* State */ gen int state=. if `year'==1991 { replace state=hgdst60 replace state=. if hgdst60<=0 } if 1994<=`year' & `year'<=2006 { replace state=gestcen replace state=. if gestcen<=0 } lab var state "State" #delimit ; lab def state 11 ME 12 NH 13 VT 14 MA 15 RI 16 CT 21 NY 22 NJ 23 PA 31 OH 32 IN 33 IL 34 MI 35 WI 41 MN 42 IA 43 MO 44 ND 45 SD 46 NE 47 KS 51 DE 52 MD 53 DC 54 VA 55 WV 56 NC 57 SC 58 GA 59 FL 61 KY 62 TN 63 AL 64 MS 71 AR 72 LA 73 OK 74 TX 81 MT 82 ID 83 WY 84 CO 85 NM 86 AZ 87 UT 88 NV 91 WA 92 OR 93 CA 94 AK 95 HI ; #delimit cr lab val state state notes state: hg-st60, gestcen /* Metropolitan area */ gen byte metro=. if `year'==1991 { replace metro=0 if hdmetsta==2 replace metro=1 if hdmetsta==1 } if 1994<=`year' & `year'<=2004 { replace metro=0 if gemetsta==2 replace metro=1 if gemetsta==1 } if 2005==`year' { replace metro=0 if gemetsta==2 & (1<=month & month<=7) replace metro=1 if gemetsta==1 & (1<=month & month<=7) replace metro=0 if gtmetsta==2 & (8<=month & month<=12) replace metro=1 if gtmetsta==1 & (8<=month & month<=12) } if 2006==`year' { replace metro=0 if gtmetsta==2 replace metro=1 if gtmetsta==1 } lab var metro "Metropolitan area" notes metro: CPS: h-metsta, gemetsta, gtmetsta /* Central city */ gen byte centcity=. if `year'==1991 { replace centcity=0 if 1<=hgdmsas & hgdmsas<=3 replace centcity=1 if hgdmsas==1 } if `year'==1994 { replace centcity=0 if gemsast~=. replace centcity=1 if gemsast==1 } if `year'==1995 { * not available } if 1996<=`year' & `year'<=2004 { capture rename gtmsast gemsast replace centcity=0 if gemsast~=. replace centcity=1 if gemsast==1 } if 2005 == `year' { capture rename gtmsast gemsast replace centcity=0 if gemsast~=. & (1<=month & month<=7) replace centcity=1 if gemsast==1 & (1<=month & month<=7) replace centcity=0 if gtcbsast~=. & (8<=month & month<=12) /* "principal city" */ replace centcity=1 if gtcbsast==1 & (8<=month & month<=12) } if 2006 == `year' { replace centcity=0 if gtcbsast~=. /* "principal city" */ replace centcity=1 if gtcbsast==1 } lab var centcity "Central city" notes centcity: BLS considers all 1995 data on SMSAs suspect notes centcity: CPS: derived from hg-msas, gemsast, gtmsast, gtcbsast /* Suburb */ gen byte suburb=. if `year'==1991 { replace suburb=0 if 1<=hgdmsas & hgdmsas<=3 replace suburb=1 if hgdmsas==2 } if `year'==1994 { replace suburb=0 if gemsast~=. replace suburb=1 if gemsast==2 } if `year'==1995 { * not available } if 1996<=`year' & `year'<=2004 { replace suburb=0 if gemsast~=. replace suburb=1 if gemsast==2 } if 2005==`year' { replace suburb=0 if gemsast~=. & (1<=month & month<=7) replace suburb=1 if gemsast==2 & (1<=month & month<=7) replace suburb=0 if gtcbsast~=. & (8<=month & month<=12) /* "balance" */ replace suburb=1 if gtcbsast==2 & (8<=month & month<=12) } if 2006==`year' { replace suburb=0 if gtcbsast~=. /* "balance" */ replace suburb=1 if gtcbsast==2 } lab var suburb "Suburbs" notes suburb: BLS considers all 1995 data on SMSAs suspect notes suburb: CPS: derived from hg-msas, gemsast, gtmsast, gtcbsast /* Rural */ gen byte rural=. if `year'==1991 { replace rural=0 if 1<=hgdmsas & hgdmsas<=3 replace rural=1 if hgdmsas==3 } if `year'==1994 { replace rural=0 if gemsast~=. replace rural=1 if gemsast==3 } if `year'==1995 { * not available } if 1996<=`year' & `year'<=2004 { replace rural=0 if gemsast~=. replace rural=1 if gemsast==3 } if 2005==`year' { replace rural=0 if gemsast~=. & (1<=month & month<=7) replace rural=1 if gemsast==3 & (1<=month & month<=7) replace rural=0 if gtcbsast~=. & (8<=month & month<=12) /* "nonmetropolitan" */ replace rural=1 if gtcbsast==3 & (8<=month & month<=12) } if 2006==`year' { replace rural=0 if gtcbsast~=. /* "nonmetropolitan" */ replace rural=1 if gtcbsast==3 } lab var rural "Rural" notes rural: BLS considers all 1995 data on SMSAs suspect notes rural: CPS: derived from hg-msas, gemsast, gtmsast /* City codes */ /* city-related variables are included, but not yet documented or supported; note that NBER reports that BLS warns that all SMSA coding for 1995 is suspect city-related codes included here in this format only to provide compatibility with CEPR ORG retrievals; code for variables before 2003 is not necessarily valid: check before using city codes were changed substantially in May 2004; coding below makes no attempt to correct for these coding changes */ gen smsastat=. gen smsa70=. gen smsa80=. gen smsa93=. gen smsarank=. gen cmsarank=. gen pmsarank=. gen icntcity=. gen msafips=. gen cmsacode=. /* smsastat */ if 1994<=`year' & `year'<=2004 { replace smsastat=gemetsta } if 2005==`year' { replace smsastat=gemetsta if 1<=month & month<=7 replace smsastat=gtcbsa if 8<=month & month<=12 } if 2006==`year' { replace smsastat=gtcbsa } notes smsastat: CPS: h-metsta gemetsta /* centcity */ notes centcity: Not available 1995:6-1995:8 notes centcity: CPS: hg-msas, gemsast, gtmsast /* smsa70 */ if 1986<=`year' & `year'<=2006 {/* smsa70 not available */} /* smsa80 */ if (1979<=`year' & `year'<=1984) | /* */ (1996<=`year' & `year'<=2006) {/* smsa80 not available */} /* smsa93 */ if (1994<=`year' & `year'<=2006) {/* smsa93 not available */} notes smsa93: Available 1995:9- /* smsarank */ if (1986<=`year' & `year'<=2006) {/* smsarank not available */} notes smsarank: Available 1979-1985:6 /* cmsarank */ if (1979<=`year' & `year'<=1985) | /* */ (1986<=`year' & `year'<=2006) {/* cmsarank not available */} notes cmsarank: Available 1986-1994:3 notes cmsarank: CPS: hg-msar, gemsark /* pmsarank */ if (1979<=`year' & `year'<=1985) | /* */ (1986<=`year' & `year'<=2006) {/* pmsarank not available */} notes pmsarank: Available 1986-1994:3 notes pmsarank: CPS: hg-pmsa, gepmsrk /* icntcity */ if 1979<=`year' & `year'<=1985 {/* icntcity not available */} if `year'==1991 {replace icntcity=hdindvcc} if 1994<=`year' & `year'<=2004 { replace icntcity=geindvcc if 1<=geindvcc & geindvcc<=4 } if 2005<=`year' & `year'<=2006 {/* status unknown */} notes icntcity: Available 1986- notes icntcity: CPS: h-inducc, h0indvcc geindvcc /* msafips */ if 1979<=`year' & `year'<=1988 {/* msafips not available */} if `year'==1991 {replace msafips=hgdmsac} if 1994<=`year' & `year'<=2004 { replace msafips=gemsa if 0