set more 1 /* File: cepr_org_hours.do Date: Nov 14, 2005, CEPR ORG Version 1.0 Desc: Creates consistent hours variables for CEPR extract of CPS ORG Note: See copyright notice at end of program. */ /* Determine data year */ local year=year in 1 /* collect NBER hours variables */ /* actual hours last week */ if 1994<=`year' { gen byte hourslwa=. } lab var hourslwa "Hours last week, all jobs" notes hourslwa: Unedited notes hourslwa: Available 1979-93 only notes hourslwa: CPS: a-hrsl lab var hourslw "Hours last week, all jobs" notes hourslw: Edited notes hourslw: CPS: a-hrsl, pehractt if 1979<=`year' & `year'<=1993 { rename reasonlw reason79 lab var reason79 "Why <35 hours last week" #delimit ; lab def reason79 1 "Slack work" 2 "Material shortage" 3 "Plant or machine repair" 4 "New job started during week" 5 "Job terminated during week" 6 "Could only find part-time work" 7 "Holiday" 8 "Labor dispute" 9 "Bad weather" 10 "Own illness" 11 "On vacation" 12 "Too busy with school, house" 13 "Did not want full-time work" 14 "Full-time work week is <35 hours" 15 "Other" ; #delimit cr lab val reason79 reason79 notes reason79: Available 1979-93 only notes reason79: See also why3579 notes reason79: CPS: a-ftreas gen byte reason94=. lab var reason94 "Why <35 hours last week" notes reason94: Available 1994- only notes reason94: CPS: perhrrsn3 } if 1994<=`year' { gen byte reason79=. lab var reason79 "Why <35 hours last week" notes reason79: Available 1979-93 only notes reason79: See also why3579 notes reason79: CPS: a-ftreas lab var reason94 "Why <35 hours last week" #delimit ; lab def reason94 1 "Slack work" 2 "Seasonal work" 3 "Job started or ended during week" 4 "On vacation" 5 "Own illness" 6 "Holiday" 7 "Child-care problems" 8 "Other family/personal obligations" 9 "Labor dispute" 10 "Bad weather" 11 "School/training" 12 "Civic/military duty" 13 "Other" ; #delimit cr lab val reason94 reason94 notes reason94: Available 1994- only notes reason94: CPS: perhrrsn3 } if 1979<=`year' & `year'<=1993 { rename absentlw absent79 lab var absent79 "Why absent last week" #delimit ; lab def absent79 1 "Own illness" 2 "On vacation" 3 "Bad weather" 4 "Labor dispute" 5 "New job to begin w/in 30 days" 6 "Temporary layoff (<30 days)" 7 "Indefinite layoff (30+ days)" 8 "Other" ; #delimit cr lab val absent79 absent79 notes absent79: Available 1979-93 only notes absent79: CPS: a-whyabs gen byte absent94=. lab var absent94 "Why absent last week" notes absent94: Available 1994- only notes absent94: CPS: peabsrsn } if 1994<=`year' { gen absent79=. lab var absent79 "Why absent last week" notes absent79: Available 1979-93 only notes absent79: CPS: a-whyabs lab var absent94 "Why absent last week" #delimit ; lab def absent94 1 "Layoff" 2 "Slack work/business conditions" 3 "New job to begin w/in 30 days" 4 "On vacation" 5 "Own illness" 6 "Child-care problems" 7 "Other family/personal" 8 "Maternity/paternity" 9 "Labor dispute" 10 "Bad weather" 11 "School/training" 12 "Civic/military duty" 13 "Does not work" 14 "Other" ; #delimit cr lab val absent94 absent94 notes absent94: Available 1994- only notes absent94: CPS: peabsrsn } /* usual weekly hours */ if 1979<=`year' & `year'<=1993 { lab var uhours "Usual hours, main job" notes uhours: Unedited notes uhours: Available 1979-93 only notes uhours: CPS: a-uslhrs } if 1994<=`year' { gen byte uhours=. lab var uhours "Usual hours, main job" notes uhours: Unedited notes uhours: Available 1979-93 only notes uhours: CPS: a-uslhrs } /* where does uhourse come from in CPS ORG ie not CPS NBER */ lab var uhourse "Usual hours, main job" notes uhourse: Edited notes uhourse: CPS: a-uslhrs, peernhro if 1979<=`year' & `year'<=1993 { rename why35lw why3579 lab var why3579 "Why usually <35 hours" #delimit ; lab def why3579 1 "Slack work" 2 "Material shortage" 3 "Plant or machine repair" 4 "New job started during week" 5 "Job terminated during week" 6 "Could only find part-time work" 7 "Holiday" 8 "Labor dispute" 9 "Bad weather" 10 "Own illness" 11 "On vacation" 12 "Too busy with school, house" 13 "Did not want full-time work" 14 "Full-time work week is <35 hours" 15 "Other" ; #delimit cr lab val why3579 why3579 notes why3579: Available 1979-93 only notes why3579: See also reason79 notes why3579: CPS: a-ftreas gen byte why3594=. lab var why3594 "Why usually <35 hours" notes why3594: Available 1994- only notes why3594: FT, PT refer to usual work schedule notes why3594: CPS: prptreas } if 1994<=`year' { gen byte why3579=. lab var why3579 "Why usually <35 hours" notes why3579: Available 1979-93 only notes why3579: See also reason79 notes why3579: CPS: a-ftreas lab var why3594 "Why usually <35 hours" #delimit ; lab def why3594 1 "Slack work, FT" 2 "Seasonal, FT" 3 "Job started or end last week, FT" 4 "On vacation, FT" 5 "Own illness, FT" 6 "Holiday, FT" 7 "Child-care problems, FT" 8 "Other family obligations, FT" 9 "Labor dispute, FT" 10 "Bad weather, FT" 11 "School/training, FT" 12 "Civic/military, FT" 13 "Other, FT" 14 "Slack work, PT" 15 "Could only find PT work, PT" 16 "Seasonal, PT" 17 "Child-care problems, PT" 18 "Other family obligations, PT" 19 "Own illness, PT" 20 "School/training, PT" 21 "Soc. Sec. earnings limitation, PT" 22 "Workweek <35 hours, PT" 23 "Other, PT" ; #delimit cr lab val why3594 why3594 notes why3594: Available 1994- only notes why3594: FT, PT refer to usual work schedule notes why3594: CPS: prptreas } /* part-time for economic reasons */ if 1979<=`year' & `year'<=1988 { gen byte ptecon=0 if ftpt79==1 | ftpt79==2 | ftpt79==4 /* employed only */ replace ptecon=1 if ftpt79==2 /* in NBER, "ptstat" variable appears to be inconsistent with ftpt79 */ } if 1989<=`year' & `year'<=1993 { gen byte ptecon=0 if 2<=ftpt89 & ftpt89<=5 /* employed only */ replace ptecon=1 if ftpt89==3 | ftpt89==5 } if 1994<=`year' { gen byte ptecon=0 if 2<=ftpt94 & ftpt94<=10 /* employed only */ replace ptecon=1 if ftpt94==3 | ftpt94==6 } lab var ptecon "PT, economic reasons" notes ptecon: CPS: derived from a-wkstat, prwkstat /* unemployed part-timers */ if 1979<=`year' & `year'<=1988 { gen byte unempt=0 if ftpt79==3 | ftpt79==5 /* unemployed only */ replace unempt=1 if ftpt79==5 } if 1989<=`year' & `year'<=1993 { gen byte unempt=0 if ftpt89==6 | ftpt89==7 /* unemployed only */ replace unempt=1 if ftpt89==7 } if 1994<=`year' { gen byte unempt=0 if ftpt94==11 | ftpt94==12 /* unemployed only */ replace unempt=1 if ftpt94==12 } lab var unempt "Unemployed, PT" notes unempt: CPS: derived from a-wkstat, prwkstat /* merge hours variables for 1994- from the Basic CPS to recover "hours vary" */ if 1979<=`year' & `year'<=1993 { gen byte hrmgfail=. gen byte prhrusl=. gen byte pehrusl1=. gen byte hrsvary=. gen byte pehrusl2=. gen byte pehruslt=. gen byte peernhro=. } if 1994<=`year' { sort month state minsamp hhid hhnum lineno if $gnulin==1 { merge month state minsamp hhid hhnum lineno using "$lochv/hv`year'.dta" } if $gnulin==0 { merge month state minsamp hhid hhnum lineno using "$lochv\hv`year'.dta" } gen byte hrmgfail=0 replace hrmgfail=1 if _merge~=3 gen byte hrsvary=0 if pehrusl1~=-1 & pehrusl1~=0 replace hrsvary=1 if pehrusl1==-4 replace prhrusl=. if prhrusl==-1 drop _merge } lab var hrmgfail "Hours merge failed" notes hrmgfail: Available 1994- only lab var prhrusl "Usual hours, Basic CPS" #delimit ; lab def prhrusl 1 "0-20" 2 "21-34" 3 "35-39" 4 "40" 5 "41-49" 6 "50" 7 "Varies, FT" 8 "Varies, PT" ; #delimit cr lab val prhrusl prhrusl notes prhrusl: Available 1994- only notes prhrusl: CPS: prhrusl lab var pehrusl1 "Usual hours, main (BLS)" notes pehrusl1: Keeps "hours vary"=-4 notes pehrusl1: Extracted 1994- only; prior to 1994, see uhourse notes pehrusl1: Basic CPS: hours per week USUALLY work at main job? notes pehrusl1: CPS: pehrusl1 lab var hrsvary "Hours vary, main job" notes hrsvary: Available 1994- only notes hrsvary: CPS: pehrusl1==-4 lab var pehrusl2 "Usual hours, 2nd (BLS)" notes pehrusl2: Keeps "hours vary"=-4 notes pehrusl2: Extracted 1994- only; prior to 1994, see uhourse notes pehrusl2: Basic CPS: hours per week USUALLY work at other job(s)? notes pehrusl2: CPS: pehrusl2 lab var pehruslt "Usual hours, all (BLS)" notes pehruslt: Keeps "hours vary"=-4 lab var peernhro "Usual hours, ORG (BLS)" notes peernhro: ORG: hours usually work per week at this rate? notes peernhro: CPS: peernhro /* impute hours for "hours vary" respondents 1994- */ if 1979<=`year' & `year'<=1993 { gen byte imphrs=. /* to simplify calculations later, set hours imputed to zero (rather than missing) here */ gen byte hrsimptd=0 gen byte hrernhr=. /* to simplify calculations later, set uhoursi (usual weekly hours including imputation) equal to uhourse for years before the hours vary response was permitted */ gen byte uhoursi=uhourse } if 1994<=`year' { /* fit separate regressions: FT, PT; men and women */ tempvar agesq white black hisp lths hs col adv gen `agesq'=age*age gen byte `white'=wbho==1 gen byte `black'=wbho==2 gen byte `hisp'=wbho==3 gen byte `lths'=educ==1 gen byte `hs'=educ==2 gen byte `col'=educ==4 gen byte `adv'=educ==5 /* FT, women */ reg pehrusl1 age `agesq' `white' `black' `hisp' /* */ `lths' `hs' `col' `adv' married forborn citizen /* */ /* union pubsector manuf servs manager */ /* */ if empl==1 & selfemp==0 & hrsvary==0 & /* */ (3<=prhrusl & prhrusl<=6) & female==1 predict imphr1 if female==1 & prhrusl==7 /* varies, FT */ /* FT, men */ reg pehrusl1 age `agesq' `white' `black' `hisp' /* */ `lths' `hs' `col' `adv' married forborn citizen /* */ /* union pubsector manuf servs manager */ /* */ if empl==1 & selfemp==0 & hrsvary==0 & /* */ (3<=prhrusl & prhrusl<=6) & female==0 predict imphr2 if female==0 & prhrusl==7 /* varies, FT */ /* PT, women */ reg pehrusl1 age `agesq' `white' `black' `hisp' /* */ `lths' `hs' `col' `adv' married forborn citizen /* */ /* union pubsector manuf servs manager */ /* */ if empl==1 & selfemp==0 & hrsvary==0 & /* */ (1<=prhrusl & prhrusl<=2) & female==1 predict imphr3 if female==1 & prhrusl==8 /* varies, PT */ /* PT, men */ reg pehrusl1 age `agesq' `white' `black' `hisp' /* */ `lths' `hs' `col' `adv' married forborn citizen /* */ /* union pubsector manuf servs manager */ /* */ if empl==1 & selfemp==0 & hrsvary==0 & /* */ (1<=prhrusl & prhrusl<=2) & female==0 predict imphr4 if female==0 & prhrusl==8 /* varies, PT */ gen byte hrernhr=0 if hrsvary~=. replace hrernhr=1 if hrsvary==1 & (1<=peernhro & peernhro<=99) gen imphrs=imphr1 if female==1 & prhrusl==7 replace imphrs=imphr2 if female==0 & prhrusl==7 replace imphrs=imphr3 if female==1 & prhrusl==8 replace imphrs=imphr4 if female==0 & prhrusl==8 replace imphrs=. if imphrs<=0 gen hrsimptd=0 replace hrsimptd=1 if hrernhr==0 & imphrs~=. /* create usual hours variable including imputations for hours vary */ /* if hours don't vary, use usual hours at main job */ gen uhoursi=pehrusl1 if hrsvary==0 /* if hours vary, regression-estimated use imputed hours */ replace uhoursi=imphrs if hrsimptd==1 /* but if hours vary and respondent answers "usual hours worked at this rate" (peernhro in ORG) use this as estimate for usual hours instead of regression-based imputation */ replace uhoursi=peernhro if hrernhr==1 } lab var imphrs "Hours, main job (imputed)" notes imphrs: Assigned to respondents "hours vary" using regression notes imphrs: Regression excludes industry, occupation, union variables notes imphrs: Ind, occ, union vars significantly reduces imputation match rate lab var hrsimptd "Hours imputed" notes hrsimptd: See imphrs lab var hrernhr "Hours assigned, ernhro" notes hrernhr: Assigned peernhro if pehrusl1==-4 and 1<=peernhro & peernhro<=99 lab var uhoursi "Hours, w/ imputation" notes uhoursi: See imphrs notes uhoursi: CPS pehrusl1 variable, with imputed hours where pehrusl1==-4 /* BLS imputations for hours */ gen byte blsimpt=0 replace blsimpt=1 if 0