set more 1 /* File: cepr_basic_idvar.do Date: Nov 21, 2006 Feb 15, 2008 Feb 10, 2009 Jan 4, 2010 Desc: Creates consistent household and personal identifiers and weights 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 lab var year "Year" /* Month of interview */ gen byte month=. if `year'==1991 { replace month=hdmonth replace month=. if hdmonth<1 } if 1994<=`year' & `year'<=2009 { replace month=hrmonth replace month=. if hrmonth<1 } lab var month "Month" notes month: CPS: hrmonth /* Month in sample */ gen byte minsamp=. if `year'==1991 { replace minsamp=hdmis replace minsamp=. if hdmis<1 } if 1994<=`year' & `year'<=2009 { replace minsamp=hrmis replace minsamp=. if hrmis<1 } lab var minsamp "Month in sample" notes minsamp: CPS: hrmis /* Household identification number: hhid */ if `year'==1991 { rename hdid hhid /* use rename not replace because string size changes */ } if 1994<=`year' & `year'<=2009 { rename hrhhid hhid /* use rename not replace because string size changes */ } lab var hhid "Household ID" notes hhid: Unique to address, not household notes hhid: CPS: hrhhid /* hhnum */ gen hhnum=. if `year'==1991 { replace hhnum=hdhhnum replace hhnum=. if hdhhnum<0 } if 1994<=`year' & `year'<=2008 { replace hhnum=huhhnum replace hhnum=. if huhhnum<0 } if `year'==2009 { destring hrhhid2, generate(hrhhid2s) gen byte huhhnum = mod(hrhhid2s,10) replace hhnum=huhhnum replace hhnum=. if huhhnum<0 drop hrhhid2s } lab var hhnum "Household counter" notes hhnum: Increments by 1 for each new household at hhid address notes hhnum: CPS: huhhnum /* Household longitudinal link: hrlonglk */ if `year'<1994 { gen hrlonglk=. /* not available before 1994 */ } if 1994<=`year' & `year'<=2009 { * use hrlonglk variable from Basic CPS } lab var hrlonglk "Longitudinal link" lab def link 0 "New or Replacement" 2 "Continuing" 3 "MIS 5" lab val hrlonglk link notes hrlonglk: Longitudinal link is month-to-month, not year to year notes hrlonglk: CPS: hrlonglk /* Person number: lineno */ gen lineno=. if `year'==1991 { replace lineno=adlineno replace lineno=. if adlineno<0 } if 1994<=`year' & `year'<=2009 { replace lineno=pulineno replace lineno=. if pulineno<0 } lab var lineno "Person number" notes lineno: Person line number within household notes lineno: CPS: pulineno /* Weights */ /* Final weight */ gen fnlwgt=. if `year'==1991 { replace fnlwgt=adfnlwgt replace fnlwgt=. if adfnlwgt<=0 } if 1994<=`year' & `year'<=2009 { replace fnlwgt=pwsswgt replace fnlwgt=. if pwsswgt<=0 } lab var fnlwgt "Final weight" notes fnlwgt: For most tabulations notes fnlwgt: Controlled to independent estimates for (1) states; /* */ (2) origin, sex, and age; and (3) age, race, and sex notes fnlwgt: CPS: pwsswgt, adfnlwgt /* ORG weight */ gen orgwgt=. if `year'==1991 { replace orgwgt=adernlwt replace orgwgt=. if adernlwt<=0 } if 1994<=`year' & `year'<=2009 { replace orgwgt=pworwgt replace orgwgt=. if pworwgt<=0 } lab var orgwgt "Earnings weight" notes orgwgt: Only for information collected only in ORG notes orgwgt: Sum to civilian, non-institutional population in each month notes orgwgt: To obtain approximate US population with full year of data, /* */ divide orgwgt by 12 notes orgwgt: CPS: pworwgt, adernlwt /* Longitudinal weight */ gen lonwgt=. if 1994<=`year' & `year'<=2009 { replace lonwgt=pwlgwgt } lab var lonwgt "Longitudinal weight" notes lonwgt: Only for adult records matched across CPS from month to month notes lonwgt: Used for gross flow analysis notes lonwgt: CPS: pwlgwgt /* Family weight */ gen famwgt=. if `year'==1991 { replace famwgt=adfamwgt replace famwgt=. if adfamwgt<=0 } if 1994<=`year' & `year'<=2009 { replace famwgt=pwfmwgt replace famwgt=. if pwfmwgt<=0 } lab var famwgt "Family weight" notes famwgt: Only for tallying family characteristics notes famwgt: Sum to civilian, non-institutional population in each month notes famwgt: To obtain approximate US population with full year of data, /* */ divide orgwgt by 12 notes famwgt: CPS: pwfmwgt /* Copyright 2004 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. */