capture log close log using C:\JO\DATA\LFS\ccsr\teachingdata2002.log, replace * STATA Version 7 *=========================================================================== * Dr Joanne Lindley, 7th July 2003 * CCSR, University of Manchester * QLFS 2002 Teaching Data Set *=========================================================================== clear set more off set mem 256m #delimit ; use week add wavfnd hhld quota w1yr qrtr inecaca ten96 sex eth01 ethbl ethas ethmx age cry01 cryo nato nation uresmc hiqual marstt cameyr ftptw jobtyp conmpy grsswk hourpay sc2kmmj edage doby ftptwk ttushr limitk nsecm hiquald levqual ayfl19 public appren ten96 schm99 ages livtog manage secjob soc2km ilodefa teclec newdeal ytetmp ytetjb wrking jbaway ownbus relbus nstat look4 lkyt4 start wait likewk ystart nolook nowant sc2kmmj using "C:\JO\DATA\LFS\CCSR\qlfsmm02.dta", clear; * Generate remserno; gen long remserno=(week*10000000) + (w1yr*1000000) + (qrtr*100000) + (add*1000) + (wavfnd*100) + (hhld); gen socmajm=sc2kmmj; * Gen number of children in household; egen byte numchild0_4 = sum(age<5), by(remserno quota); egen byte numchild5 = sum(age>=5 & age<16), by(remserno quota); label variable numchild0_4 "Number of children aged 0-4"; label variable numchild5 "Number of children aged 5-16"; tab numchild0_4 ; tab numchild5 ; tab w1yr qrtr if grsswk~=.; keep if w1yr==1 & qrtr==1; gen year=2002; gen quart=1; keep if age>=16 & age<=65; count; save "C:\JO\DATA\LFS\ccsr\LFSq1.dta", replace; use week add wavfnd hhld quota w1yr qrtr inecaca ten96 sex eth01 ethbl ethas ethmx age cry01 cryo nato nation uresmc hiqual marstt cameyr ftptw jobtyp conmpy grsswk hourpay sc2kmmj edage doby ftptwk ttushr limitk nsecm hiquald levqual ayfl19 public appren ten96 schm99 ages livtog manage secjob soc2km ilodefa teclec newdeal ytetmp ytetjb wrking jbaway ownbus relbus nstat look4 lkyt4 start wait likewk ystart nolook nowant sc2kmmj using "C:\JO\DATA\LFS\CCSR\qlfsja02.dta", clear; * Generate remserno; gen long remserno=(week*10000000) + (w1yr*1000000) + (qrtr*100000) + (add*1000) + (wavfnd*100) + (hhld); gen socmajm=sc2kmmj; * Gen number of children in household; egen byte numchild0_4 = sum(age<5), by(remserno quota); egen byte numchild5 = sum(age>=5 & age<16), by(remserno quota); label variable numchild0_4 "Number of children aged 0-4"; label variable numchild5 "Number of children aged 5-16"; tab numchild0_4 ; tab numchild5 ; tab w1yr qrtr if grsswk~=.; keep if w1yr==1 & qrtr==2; gen year=2002; gen quart=2; keep if age>=16 & age<=65; count; save "C:\JO\DATA\LFS\ccsr\LFSq2.dta", replace; use week add wavfnd hhld quota w1yr qrtr inecaca ten96 sex eth01 ethbl ethas ethmx age cry01 cryo nato nation uresmc hiqual marstt cameyr ftptw jobtyp conmpy grsswk hourpay sc2kmmj edage doby ftptwk ttushr limitk nsecm hiquald levqual ayfl19 public appren ten96 schm99 ages livtog manage secjob soc2km ilodefa teclec newdeal ytetmp ytetjb wrking jbaway ownbus relbus nstat look4 lkyt4 start wait likewk ystart nolook nowant sc2kmmj using "C:\JO\DATA\LFS\CCSR\qlfssn02.dta", clear; * Generate remserno; gen long remserno=(week*10000000) + (w1yr*1000000) + (qrtr*100000) + (add*1000) + (wavfnd*100) + (hhld); gen socmajm=sc2kmmj; * Gen number of children in household; egen byte numchild0_4 = sum(age<5), by(remserno quota); egen byte numchild5 = sum(age>=5 & age<16), by(remserno quota); label variable numchild0_4 "Number of children aged 0-4"; label variable numchild5 "Number of children aged 5-16"; tab numchild0_4 ; tab numchild5 ; tab w1yr qrtr if grsswk~=.; keep if w1yr==1 & qrtr==3; gen year=2002; gen quart=3; keep if age>=16 & age<=65; count; save "C:\JO\DATA\LFS\ccsr\LFSq3.dta", replace; use week add wavfnd hhld quota w1yr qrtr inecaca ten96 sex eth01 ethbl ethas ethmx age cry01 cryo nato nation uresmc hiqual marstt cameyr ftptw jobtyp conmpy grsswk hourpay sc2kmmj edage doby ftptwk ttushr limitk nsecm hiquald levqual ayfl19 public appren ten96 schm99 ages livtog manage secjob soc2km ilodefa teclec newdeal ytetmp ytetjb wrking jbaway ownbus relbus nstat look4 lkyt4 start wait likewk ystart nolook nowant sc2kmmj using "C:\JO\DATA\LFS\CCSR\qlfsd02f.dta", clear; * Generate remserno; gen long remserno=(week*10000000) + (w1yr*1000000) + (qrtr*100000) + (add*1000) + (wavfnd*100) + (hhld); gen socmajm=sc2kmmj; * Gen number of children in household; egen byte numchild0_4 = sum(age<5), by(remserno quota); egen byte numchild5 = sum(age>=5 & age<16), by(remserno quota); label variable numchild0_4 "Number of children aged 0-4"; label variable numchild5 "Number of children aged 5-16"; tab numchild0_4 ; tab numchild5 ; tab w1yr qrtr if grsswk~=.; keep if w1yr==1 & qrtr==4; gen year=2002; gen quart=4; keep if age>=16 & age<=65; count; save "C:\JO\DATA\LFS\ccsr\LFSq4.dta", replace; use "C:\JO\DATA\LFS\ccsr\LFSq1.dta", clear; tab w1yr qrtr; append using "C:\JO\DATA\LFS\ccsr\LFSq2.dta"; tab w1yr qrtr; append using "C:\JO\DATA\LFS\ccsr\LFSq3.dta"; tab w1yr qrtr; append using "C:\JO\DATA\LFS\ccsr\LFSq4.dta"; tab w1yr qrtr; #delimit cr; *=========================================================================== * Rename, recode and label LFS variables *=========================================================================== rename uresmc region * Recode the eth01 to ethnic gen ethnic=. recode ethnic .=1 if eth01==1 recode ethnic .=2 if eth01==4 & ethbl==1 recode ethnic .=3 if eth01==4 & ethbl==2 recode ethnic .=4 if eth01==4 & ethbl==3 recode ethnic .=5 if eth01==3 & ethas==1 recode ethnic .=6 if eth01==3 & ethas==2 recode ethnic .=7 if eth01==3 & ethas==3 recode ethnic .=8 if eth01==5 recode ethnic .=9 if eth01==6 | (eth01==3 & ethas==4) | (eth01==2 & ethmx>=3) * Categorise those of black `mixed' as black `other' recode ethnic .=4 if eth01==2 & (ethmx==1 | ethmx==2) * Ethnic==other includes `other Asians', and those of mixed race `white & Asian', as well as `other' label variable ethnic "ethnicity" label define ethnic 1 "white" 2 "Caribbean" 3 "African" 4 "black oth" 5 "Indian" 6 "Pstani" 7 "Bdeshi" 8 "Chinese" 9 "other" label values ethnic ethnic sort year by year: tab ethnic gen fb=0 replace fb=1 if cry01>=6 label variable fb "whether born outside the UK" label define fb 0 "no" 1 "yes" label values fb fb tab fb gen arrival=. replace arrival=1 if cameyr<=1959 replace arrival=2 if cameyr>=1960 & cameyr<=1969 replace arrival=3 if cameyr>=1970 & cameyr<=1979 replace arrival=4 if cameyr>=1980 & cameyr<=1989 replace arrival=5 if cameyr>=1990 & cameyr<=1999 replace arrival=6 if cameyr>=2000 & cameyr<=2003 replace arrival=0 if fb==0 label variable arrival "Year of arrival in UK" label define arrival 1 "pre 1959" 2 "1960-1959" 3 "1970-1979" 4 "1980-1989" 5 "1990-2000" 6 "2000-2003" label values arrival arrival tab arrival gen house=. replace house=1 if ten96>=1 & ten96<=3 replace house=2 if ten96>=4 & ten96<=5 label variable house "housing tenure" label define house 1 "owner/occupier" 2 "rented" label values house house tab house gen bhealth=0 replace bhealth=1 if limitk==1 label variable bhealth "Bad Health that limits paid work" label define bhealth 0 "no" 1 "yes" label values bhealth bhealth tab bhealth recode region 1 2 = 1 3/5=2 14/16=3 6=4 12 13=5 7=6 8/10=7 11=8 17=9 18 19=10 20=11 tab region label variable region label define region 1 "North" 2 "Yorkshire" 3 "North West" 4 "East Midlands" 5 "West Midlands" 6 "East Anglia" 7 "South East" 8 "South West" 9 "Wales" 10 "Scotland" 11 " NI" label values region region replace sex=sex-1 notes sex: 0 male, 1 female label drop sex label define sex 0 "male" 1 "female" label values sex sex tab sex * married gen byte married = (marstt==2 | marstt==3) recode married .=0 tab married gen status=inecaca recode status 1 3=1 2 4=2 5=3 *=4 label define status 1 "Employed/Scheme" 2 "Self-employed/unpaid fam" 3 "ILO Unemployed" 4 "Not in Labour Force" label values status status tab status * Percentage of part time * Self reported gen ptime=. replace ptime=0 if status==1 | status==2 replace ptime=1 if (status==1 | status==2) & ftptwk==2 tab ethnic ptime, row * Note includes the self employed * Usual hours definition, part-time is less than 31 hours per week gen ptimehrs=0 replace ptimehrs=1 if ttushr<31 & (status==1 | status==2) tab ethnic ptimehrs, row replace ethnic=. if ethnic<=-8 keep if age>=16 & age<=65 keep age edage bhealth ethnic hiqual fb arrival sex region house numchild0_4 numchild5 married grsswk hourpay socmajm jobtyp conmpy quart cry01 cryo nato nation inecaca status ptime ptimehrs nsecm ttushr hiquald levqual marstt ayfl19 public appren ten96 schm99 ages livtog manage secjob soc2km ilodefa teclec newdeal ytetmp ytetjb wrking jbaway ownbus relbus nstat look4 lkyt4 start wait likewk ystart nolook nowant sc2kmmj compress save "C:\JO\DATA\LFS\ccsr\tdata2002v7.dta", replace log close exit