set more 1 /* File: 17th_pums_proc_1990.do Date: Feb 11, 2004 Desc: Prepares extract of 1990 Decennial Census PUMS 1% */ capture program drop rd1990 program define rd1990 version 7.0 * prepare basic state files from PUMSB1990 while "`1'"~="" { * * read household records * !cp "$d1990/PUMSBX`1'.TXT" "$d1990/PUMSBX.TXT" clear qui infile using "$do/17th_pums_h_1990.dct" if rectype=="H" do "$do/17th_pums_h_label_1990.do" drop rectype sort serialno save "$work/h_1990_temp_`1'", replace * * read individual records * clear qui infile using "$do/17th_pums_p_1990.dct" if rectype=="P" do "$do/17th_pums_p_label_1990.do" drop rectype sort serialno save "$work/p_1990_temp_`1'", replace * * attach household variables to individual records * merge serialno using "$work/h_1990_temp_`1'" assert _merge==2 | _merge==3 drop if persons==0 /* eliminates vacant houses */ assert _merge==3 /* which should leave only correct matches */ drop _merge sort serialno drop hfiller* pfiller* compress * * save transformed state files * save "$work/pums_1990_pre_`1'", replace * !rm "$d1990/PUMSBX.TXT" !rm "$work/p_1990_temp_`1'.dta" !rm "$work/h_1990_temp_`1'.dta" mac shift } end capture program drop all1990 program define all1990 version 7.0 * combine all variables in all state files from PUMSB1990 use "$work/pums_1990_pre_`1'", clear mac shift while "`1'"~="" { append using "$work/pums_1990_pre_`1'" mac shift } save "$work/pums_1990_pre_all", replace end capture program drop ap11990 program define ap11990 version 7.0 * combine selection of variables in all state files from PUMSB1990 use "$work/pums_1990_pre_`1'", clear mac shift while "`1'"~="" { append using "$work/pums_1990_pre_`1'" * drop allocation flags drop aaugment arelat1 asex arace aage amarital ahispan abirthpl acitizen /* */ aimmigr aschool ayearsch aancstr1 aancstr2 amoblty amigstat alang1 /* */ alang2 aenglish avets1 aservper ayrsserv adisabl1 adisabl2 amobllim /* */ apercare afertil alabor ahours apowst ameans ariders adepart atrantme /* */ alstwrk aindustr aoccup aclass awork89 awks89 ahour89 aincome1 aincome2 /* */ aincome3 aincome4 aincome5 aincome6 aincome7 aincome8 /* */ aunits1 arooms atenure aacres10 acommuse avalue arent1 ameals avacncy2 /* */ avacncy3 avacncy4 ayrmoved abedroom aplumbng akitchen aphone avehicle /* */ afuel awater asewer ayrbuilt acondo aoneacre aagsales aeleccst agascst /* */ awatrcst afuelcst ataxamt ainsamt amortg amortg3 ataxincl ainsincl /* */ amortg2 amrtamt2 acndofee amoblhme * drop other nonessential variables * psa: planning service area in elderly sample only * subsampl: used to create subsamples drop sample psa subsampl husflag pdsflag vacancy* mac shift } save "$work/pums_1990_pre_all", replace end capture program drop apa1990 program define apa1990 version 7.0 * combine selection of variables in all state files from PUMSB1990 use serialno division state puma msapmsa persons gqinst tenure value /* */ rnsmocpi mortgag3 rgrapi rent1 units1 autos rhhfamtp sex relat1 /* */ rlabor r18undr r65over rhhinc rfaminc houswgt age yearsch marital lang1 /* */ english pob immigr citizen class industry occup week89 hour89 /* */ income1 income2 income3 income4 income5 income6 income7 income8 /* */ rpincome poverty mobility pwgt1 /* */ using "$work/pums_1990_pre_`1'", clear mac shift while "`1'"~="" { append using "$work/pums_1990_pre_`1'", nolabel keep serialno division state puma msapmsa persons gqinst tenure value /* */ rnsmocpi mortgag3 rgrapi rent1 units1 autos rhhfamtp sex relat1 /* */ rlabor r18undr r65over rhhinc rfaminc houswgt age yearsch marital lang1 /* */ english pob immigr citizen class industry occup week89 hour89 /* */ income1 income2 income3 income4 income5 income6 income7 income8 /* */ rpincome poverty mobility pwgt1 mac shift } save "$work/pums_1990_pre_half_a", replace end capture program drop apb1990 program define apb1990 version 7.0 * combine selection of variables in all state files from PUMSB1990 use serialno division state puma msapmsa persons gqinst tenure value /* */ rnsmocpi mortgag3 rgrapi rent1 units1 autos rhhfamtp sex relat1 /* */ rlabor r18undr r65over rhhinc rfaminc houswgt age yearsch marital lang1 /* */ english pob immigr citizen class industry occup week89 hour89 /* */ income1 income2 income3 income4 income5 income6 income7 income8 /* */ rpincome poverty mobility pwgt1 /* */ using "$work/pums_1990_pre_`1'", clear mac shift while "`1'"~="" { append using "$work/pums_1990_pre_`1'", nolabel keep serialno division state puma msapmsa persons gqinst tenure value /* */ rnsmocpi mortgag3 rgrapi rent1 units1 autos rhhfamtp sex relat1 /* */ rlabor r18undr r65over rhhinc rfaminc houswgt age yearsch marital lang1 /* */ english pob immigr citizen class industry occup week89 hour89 /* */ income1 income2 income3 income4 income5 income6 income7 income8 /* */ rpincome poverty mobility pwgt1 mac shift } save "$work/pums_1990_pre_half_b", replace end capture program drop apc1990 program define apc1990 version 7.0 use "$work/pums_1990_pre_half_a", clear append using "$work/pums_1990_pre_half_b", nolabel save "$work/pums_1990_pre_all", replace end /* program switches */ /* read raw data */ rd1990 AK AL AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME /* */ MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA /* PR */ RI SC SD TN TX /* */ UT VA VT WA WI WV WY 99 /* combine all variables in all state files (if RAM is sufficiently large) */ all1990 AK AL AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME /* */ MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA /* PR */ RI SC SD TN /* */ TX UT VA VT WA WI WV WY 99 /* /* combine main variables in all state files */ apa1990 AK AL AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME /* */ MI MN MO MS MT apb1990 NC ND NE NH NJ NM NV NY OH OK OR PA /* PR */ RI SC SD TN TX UT VA /* */ VT WA WI WV WY 99 apc1990 */ /* Copyright 2004 Sarah Gammage and John Schmitt This program and all programs referenced in it are free software. You can redistribute the program or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */