set more 1 /* File: cepr_org_prep_hv.do Date: Feb 21, 2006 Feb 22, 2011 , CEPR ORG Version 1.6 Jan 6, 2012, CEPR ORG Version 1.7 Desc: Prepares data on hours-vary from Basic CPS 1994-2002 for later merging with NBER data Note: See copyright notice at end of program. */ capture program drop hv program define hv version 6.0 while "`1'"~="" { if $gnulin==1 { use "$locbas/`1'/cpsb`1'x.dta", clear } if $gnulin==0 { use "$locbas\`1'\cpsb`1'x.dta", clear } keep hhid hhnum lineno hrlonglk hrmonth hrmis peage pesex /* */ prmarsta perace prorigin peeduca /* */ prhrusl pehrusl1 pehrusl2 pehruslt peernhro gestcen /* */ hurespli proldrrp puslfprx rename hrmonth month rename hrmis minsamp rename gestcen state * carry age, sex, marital status, race, education variables as a check rename peage age replace age=90 if 90<=age & age~=. * gen byte female=1 if pesex==2 replace female=0 if pesex==1 lab var female "Female" * gen byte married=. replace married=0 if prmarsta~=. replace married=1 if 1<=prmarsta & prmarsta<=3 lab var married "Married" * gen byte wbhao=. replace wbhao=1 if perace==1 /* white */ replace wbhao=2 if perace==2 /* black */ replace wbhao=4 if perace==4 /* asian */ replace wbhao=5 if perace==3 | perace==5 /* american indian, aleut eskimo; asian or pacific island; other */ replace wbhao=3 if (1<=prorigin & prorigin<=7) /* hispanic */ lab var wbhao "Race/ethnicity, inc. Asian" * gen byte educ=1 if 31<=peeduca & peeduca<=37 replace educ=2 if 38<=peeduca & peeduca<=39 /* includes "no diploma" */ replace educ=3 if 40<=peeduca & peeduca<=42 replace educ=4 if peeduca==43 replace educ=5 if 44<=peeduca & peeduca<=46 lab var educ "Education level" * order hhid hhnum lineno hrlonglk month minsamp state age female married wbhao educ /* */ prhrusl pehrusl1 pehrusl2 pehruslt peernhro /* */ hurespli proldrrp puslfprx sort month state minsamp hhid hhnum lineno hrlonglk age female married wbhao educ * unique identifiers NBER: * 1979-93: hhid, hhnum, lineno, minsamp, month * 1994- : hhid, hhnum, lineno, minsamp, month, state compress if $gnulin==1 { save "$lochv/hv`1'.dta", replace *save "$loctmp/hv`1'.dta", replace } if $gnulin==0 { save "$lochv\hv`1'.dta", replace } mac shift } end /* Copyright 20011 CEPR and John Schmitt This file is part of the cepr_org_master.do program. This file 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. */