set more off /* File: cepr_dws_master.do Date: Jan 10, 2004 Mar 27, 2007 Oct 12, 2007 Oct 1, 2010 Dec 6, 2010 Mar 30, 2011 Desc: Create consistent extract of Displaced Workers Survey for 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 (these surveys have 3-year recall period for job displacement; earlier DWSs use 5-year recall period) */ /* Acknowledgements The raw Current Population Survey and most of the accompanying documentation used to produce the CEPR DWS extract are freely available for downloading from the National Bureau of Economic Research (www.nber.org). The Stata (www.stata.com) retrieval programs used here to convert the raw CPS data into Stata format have been adapted from programs written by Jean Roth (jroth@nber.org). I thank Dean Baker and Heather Boushey for extensive comments, and Ryan Helwig of the Bureau of Labor Statistics for providing invaluable guidance with the DWS. */ /* Notice The underlying Current Population Survey data referenced here are all in the public domain. This program and most of the programs referenced in it are distributed under the GNU General Public License (GPL). See end of this file and http://www.gnu.org/licenses/ for details. */ /* set directories */ global gnulin = 1 /*Set gnulin=0 if you run Windows; 1 if GNU/Linux*/ if $gnulin==1 { /*do files and dictionaries*/ global dwsdo "/ceprdata/CPS_DisplacedWorker/Dofiles" /* DWS do files */ global basicdo "/ceprdata/CPS_Basic/CEPR/DoFiles" /* BasicCPS dofiles*/ /* data */ global dwsdata "/ceprdata/CPS_DisplacedWorker" /*raw DWS data*/ global working "/home/stata/working" global final "/ceprdata/CPS_DisplacedWorker" /* final DWS */ } if $gnulin==0 { /* do files and dictionaries */ global dwsdo "C:\DATA\CPS_DisplacedWorker\Dofiles" /* DWS do files */ global basicdo "C:\DATA\CPS_Basic\CEPR\DoFiles" /* BasicCPS dofiles */ /* data */ global dwsdata "C:\DATA\CPS_DisplacedWorker" /*raw DWS data*/ global working "C:\DATA\CPS_JobTenure\Workfiles" global final "C:\DATA\CPS_DisplacedWorker" /* final DWS */ } /* read and label raw CPS data */ /* 1994, Feb; 1996, Feb; 1998, Feb; 2000, Feb; 2002, Jan; 2004, Jan; 2006, Jan; 2008, Jan; 2010, Jan; */ capture program drop dwsread program define dwsread while "`1'"~="" { cd $dwsdo /* these do-files require CEPR's DWS raw data directory naming conventions; see individual do-files for examples */ do cepr_dws_read_`1'.do gen int year=`1' compress cd $working save cps_dws_raw_`1'.dta, replace mac shift } end capture program drop dwsall program define dwsall version 5.0 while "`1'"~="" { cd $working use cps_dws_raw_`1'.dta, clear cd $basicdo do cepr_basic_empstat.do * process DWS responses cd $dwsdo do cepr_dws_dws.do cd $dwsdo do cepr_dws_wagehour.do * process Basic CPS responses cd $basicdo do cepr_basic_idvar.do cd $basicdo do cepr_basic_demog.do cd $basicdo do cepr_basic_family.do cd $basicdo do cepr_basic_geog.do cd $basicdo do cepr_basic_educ.do cd $basicdo do cepr_basic_ind.do cd $basicdo do cepr_basic_occ.do cd $basicdo do cepr_basic_hours.do * tidy #delimit ; keep year indws dw_stat dwswgt dw dw_bls dw_why dw_when xrecall notice not_when ljten ljtenr uibens uiended moved movedec worked wkswo numjobs ljcowd ljcow ljindd94 ljindd04 ljind94 ljind04 ljagric ljmanu ljservs ljconstr ljrwtrade ljfire ljoccd94 ljoccd04 ljocc94 ljocc94 ljunion ljhealth hi_now ljft ljhv cjftcps cjhvcps ljpayper ljot ljwage ljwagetc ljhours ljwkot ljottc ljothrs ljwktc ljwkpay ljweeks ljwkpay ljpayr cjppdw cjpporg cjpayper cjhr_dws cjhr_org cjhrly cjot_dws cjot_org cjot cjw_dws cjw_org cjwage cjwdwstc cjworgtc cjw_tc cjh_dws cjh_org cjhours cjotadws cjotaorg cjotamt cjottcd cjottco cjottc cjothrd cjwtcdws cjwtcorg cjwtc cjwpdws cjwporg cjwkpay cjwk_dws cjwk_cps cjweeks cjpayorg cjpayr month minsamp hhid hhnum hrlonglk lineno fnlwgt orgwgt lonwgt famwgt age female wbho forborn citizen prcitshp penatvty pemntvty pefntvty prinusyr arrived vet married ownchild ch02 ch05 ch35 ch613 ch1417 famrel84 famrel94 faminc lfstat empl unem nilf selfemp selfinc pubsect pubfed pubst publoc unmem uncov union student studpt state metro centcity suburb rural educ ind_nber ind_2d ind70 ind80 ind03 agric manuf servs constr rwtrade fire docc70 docc80 docc03 occ70 occ80 occ03 manag83 manag03 hourslw reason94 absent94 uhourse ptecon unempt prhrusl pehrusl1 pehrusl2 pehruslt peernhro imphrs hrsimptd hrernhr uhoursi blsimpt; order year indws dw_stat dwswgt dw dw_bls dw_why dw_when xrecall notice not_when ljten ljtenr uibens uiended moved movedec worked wkswo numjobs ljcowd ljcow ljindd94 ljindd04 ljind94 ljind04 ljagric ljmanu ljservs ljconstr ljrwtrade ljfire ljoccd94 ljoccd04 ljocc94 ljocc94 ljunion ljhealth hi_now ljft ljhv cjftcps cjhvcps ljpayper ljot ljwage ljwagetc ljhours ljwkot ljottc ljothrs ljwktc ljwkpay ljweeks ljwkpay ljpayr cjppdw cjpporg cjpayper cjhr_dws cjhr_org cjhrly cjot_dws cjot_org cjot cjw_dws cjw_org cjwage cjwdwstc cjworgtc cjw_tc cjh_dws cjh_org cjhours cjotadws cjotaorg cjotamt cjottcd cjottco cjottc cjothrd cjwtcdws cjwtcorg cjwtc cjwpdws cjwporg cjwkpay cjwk_dws cjwk_cps cjweeks cjpayorg cjpayr month minsamp hhid hhnum hrlonglk lineno fnlwgt orgwgt lonwgt famwgt age female wbho forborn citizen prcitshp penatvty pemntvty pefntvty prinusyr arrived vet married ownchild ch02 ch05 ch35 ch613 ch1417 famrel84 famrel94 faminc lfstat empl unem nilf selfemp selfinc pubsect pubfed pubst publoc unmem uncov union student studpt state metro centcity suburb rural educ ind_nber ind_2d ind70 ind80 ind03 agric manuf servs constr rwtrade fire docc70 docc80 docc03 occ70 occ80 occ03 manag83 manag03 hourslw reason94 absent94 uhourse ptecon unempt prhrusl pehrusl1 pehrusl2 pehruslt peernhro imphrs hrsimptd hrernhr uhoursi blsimpt; #delimit cr compress sort month state minsamp hhid hhnum lineno lab data "CEPR DWS Extract, Version 1.02, `1'" cd $final save cepr_dws_`1'.dta, replace saveold cepr_dws_`1'_ver7.dta, replace mac shift } end /* program switches */ dwsread 1994 1996 1998 2000 2002 2004 2006 2008 2010 dwsall 1994 1996 1998 2000 2002 2004 2006 2008 2010 /* Release notes 1.02 Mar 15, 2011 Added displacement rates for workers in construction, wholesale and retail trade, and FIRE 1.01 Dec 6, 2010 Added January 2010 data 1.0 Oct 1, 2010 Added January 2008 data 0.96 Oct 12, 2007 Updated mean above topcode in cepr_dws_wagehour.do 0.92 Mar 29, 2007 Added January 2006 data 0.91 April 2006 *nixified and cleaned up programs 0.9 Month Day, 2004 Beta release */ /* Copyright 2004-2011 CEPR and John Schmitt Center for Economic and Policy Research 1611 Connecticut Avenue, NW Suite 400 Washington, DC 20009 Tel: (202) 293-5380 Fax: (202) 588-1356 http://www.cepr.net/ http://www.ceprdata.org/ 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. */