************************************************ *SYNTAX TO CREATE World 5.5 FILES (6 July 2004)* ************************************************. Get file='R:\Soci 1205\Data Archives\Time Use Archives\Time Use Data Surveys\Canada\1992\Original\CAN1992orig.sav'. ************************************** *COMPUTATION OF DEMOGRAPHIC VARIABLES* **************************************. compute country = 1. compute period = 5. compute survey = 1992. compute swave = 0. compute msamp = 0. compute id = seqnum. compute persid = seqnum. compute hldid = 0. compute day = dday. compute month = surmnth. compute year = 1992. compute diary = 1. compute sex = dvsex. compute age2 = dvagegr. recode age2 (1=16) (2=19) (3=22) (4=27) (5=32) (6=37) (7=42) (8=47) (9=52) (10=57) (11=62) (12=67) (13=72) (14=77) (15=82). compute agegr5y = -8. if (age2 ge 0) and (age2 lt 5) agegr5y = 1. if (age2 ge 5) and (age2 lt 10) agegr5y = 2. if (age2 ge 10) and (age2 lt 15) agegr5y = 3. if (age2 ge 15) and (age2 lt 20) agegr5y = 4. if (age2 ge 20) and (age2 lt 25) agegr5y = 5. if (age2 ge 25) and (age2 lt 30) agegr5y = 6. if (age2 ge 30) and (age2 lt 35) agegr5y = 7. if (age2 ge 35) and (age2 lt 40) agegr5y = 8. if (age2 ge 40) and (age2 lt 45) agegr5y = 9. if (age2 ge 45) and (age2 lt 50) agegr5y = 10. if (age2 ge 50) and (age2 lt 55) agegr5y = 11. if (age2 ge 55) and (age2 lt 60) agegr5y = 12. if (age2 ge 60) and (age2 lt 65) agegr5y = 13. if (age2 ge 65) and (age2 lt 70) agegr5y = 14. if (age2 ge 70) and (age2 lt 75) agegr5y = 15. if (age2 ge 75) and (age2 lt 80) agegr5y = 16. if (age2 ge 80) agegr5y = 17. compute famstat = -8. if (dvagryc ge 18) and ((age2 ge 18) and (age2 le 39)) famstat = 0. if any (dvagryc,0,1,2,3,4) and (age2 ge 18) famstat = 1. if any (dvagryc,5,6,7,8,9,10,11,12,13,14,15,16,17) and (age2 ge 18) famstat = 2. if (dvagryc ge 18) and (age2 ge 40) famstat = 3. if (age2 lt 18) famstat = 5. if (age2 lt 18) and any(dvlvgrgr,10,11) famstat = 4. compute cphome = -8. if any(dvlvgrgr,1,2,3,4,5,6,7,8,9,10,11,12) cphome = 0. if any(dvlvgrgr,10,11) and any(dvms,2,3,4) cphome = 1. compute hhtype = -8. if (dvhhscap eq 1) and (dvlvgrgr eq 1) hhtype = 1. if (dvlvgrgr eq 2) hhtype = 2. if any (dvlvgrgr,3,4,5,6,10) hhtype = 3. if any (dvlvgrgr,7,8,9,11,12) hhtype = 4. recode dvlvgrgr (7,8,9 eq 1) (1,2,3,4,5,6,10,11,12 eq 0) (else=-8) into singpar. compute hhldsize = dvhhscap. if (dvagryc ge 18) resc1318 eq 0. compute nchild = sum(resc0004,resc0512,resc1318). if (dvagegr eq 1) and any (dvlvgrgr,10,11) nchild = 1. recode dvagryc (0,1,2,3,4 = 1) (5,6,7,8,9,10,11,12 = 2) (13,14,15,16,17 = 3) (18 thru 98 = -7) (else=-8) into agekid. if (dvagegr eq 1) and any (dvlvgrgr,10,11) and (agekid eq -7) agekid = 3. compute relrefp = -9. recode dvms (1 = 1) (2,3,4 = 2) (else = -8) into civstat. compute cohab = -9. compute empstat3 = -8. if any (dvspern,1,2,3,10) empstat3 = 1. if any (dvspern,4,5,6,11) empstat3 = 2. if any (dvspern,7,8,9,12) empstat3 = 4. recode empstat3 (1,2,3 =1) (4=0) (-8=-8) into emp. compute unemp = -8. if (act7days eq 2) unemp = 1. if any(act7days,1,3,4,5,6) unemp = 0. compute student = -8. if (act7days eq 3) student = 1. if any(act7days,1,2,4,5,6) student = 0. compute retired = -8. if (act7days eq 5) retired = 1. if any(act7days,1,2,3,4,6) retired = 0. compute empsp = -8. if any (dvms,2,3,4) or any (dvspern,10,11,12) empsp = -7. if any (dvspern,1,4,7) empsp = 1. if any (dvspern,2,5,8) empsp = 2. if any (dvspern,3,6,9) empsp = 4. recode dvhrwk (lo thru 120 = copy) (999.7 = -7) (else = -8) into workhrs. compute incorig=dvhhinc. compute income = -8. if (dvhhinc lt 6) income = 1. if (dvhhinc ge 6) and (dvhhinc lt 10) income = 2. if (dvhhinc ge 10) and (dvhhinc le 11) income = 3. if (incorig eq -8) income = -8. compute empinclm = -9. compute educa=dveduc. recode educa (sysmis=99). compute edtry = -8. if (dveduc ge 1) and (dveduc le 7) edtry = 3. if (dveduc ge 8) and (dveduc le 10) edtry = 2. if (dveduc ge 11) and (dveduc le 13) edtry = 1. if (dveduc eq 99) edtry=-8. compute disab = -9. compute urban = -9. *********************************** *computation of time use variables* ***********************************. *the default value for all time use variables is 0 minutes - whether the study *coded the activity or not. note that if a variable cannot be created *it should be set to '0' and not to -9 at this stage. this is essential to select *'good diaries'. av variables that could not be created will then be recoded to *-9 later in the syntax. the code 'xx' should be replaced below by the *relevant time in minutes, or remain at 0 for diarists who did not record any of *the activity in their diary. compute av1 = sum(dur011,dur021,dur040,dur050,dur060,dur070,dur080). compute av2 = (dur022). compute av3 = sum(dur012,dur023,dur832,dur842). compute av4 = sum(dur500,dur511,dur512,dur520,dur540,dur550,dur560). compute av5 = sum(dur030,dur090,dur590). compute av6 = sum(dur101,dur102,dur110). compute av7 = sum(dur120,dur130,dur140,dur183). compute av8 = sum(dur151,dur152,dur161,dur162,dur163,dur164,dur172,dur173,dur181,dur182,dur271,dur272,dur282,dur671,dur672,dur674,dur675,dur676,dur677,dur678). compute av9 = (dur171). compute av10 = sum(dur301,dur302,dur310,dur331,dur332,dur350,dur361,dur362,dur370,dur380). compute av11 = sum(dur200,dur210,dur220,dur230,dur240,dur250,dur260,dur281,dur673). compute av12 = sum(dur190,dur291,dur292,dur390,dur492). compute av13 = sum(dur400,dur480). compute av14 = sum(dur320,dur340,dur410). compute av15 = sum(dur430,dur431). compute av16 = sum(dur450,dur460). compute av17 = sum(dur491,dur691,dur692,dur791,dur792,dur793,dur871,dur872,dur891,dur892,dur893,dur894,dur990). compute av18 = sum(dur712,dur713,dur741,dur742,dur743,dur814,dur873). compute av19 = sum(dur801 to dur813,dur815,dur822,dur880). compute av20 = sum(dur701,dur702). compute av21 = sum(dur816,dur821). compute av22 = (dur640). compute av23 = sum(dur600,dur610,dur620,dur630,dur651,dur652,dur660,dur680,dur800). compute av24 = sum(dur711,dur720,dur730). compute av25 = sum(dur751,dur753,dur780). compute av26 = (dur760). compute av27 = 0. compute av28 = sum(dur303,dur440). compute av29 = (dur752). compute av30 = (dur900). compute av31 = sum(dur911 to dur914). compute av32 = (dur920). compute av33 = sum(dur530,dur580,dur863). compute av34 = (dur931). compute av35 = sum(dur932,dur940,dur961). compute av36 = (dur470). compute av37 = (dur950). compute av38 = 0. compute av39 = 0. compute av40 = sum(dur831,dur841,dur850,dur861,dur862,dur962,dur980). compute resid=sum(dur001,dur002). compute mistime = 1440 - (sum(av1 to av40) + resid). compute av41 = resid + mistime. compute avtot = sum (av1 to av40) + av41. execute. compute paidetc=sum(av1,av2,av3,av5). compute hwork=av7. compute cooking=av6. compute eating=av15. compute kidcare=av11. compute shopping=av10. compute dtravel=av12. compute otravel=sum(av17,av18). compute perscare=sum(av13,av16). compute eatout=av28. compute pubclubs=sum(av26 to av27). compute spectat=sum(av20,av22 to av25). compute asports=av19. compute walking=av21. compute visits=sum(av29,av38). compute tvrad=sum(av30 to av32). compute reading=sum(av33 to av35). compute chatsetc=sum(av36 to av37). compute oddjobs=sum(av8 to av9). compute hobbies=sum(av39 to av40). compute medical=av14. compute educ=av4. execute. ****************************************************************** *selection of good diaries and recoding of selected av variables * ******************************************************************. compute tottime=rnd(sum(av1 to av40) + av41). execute. *note that the '-15' below is a selection criteria to identify diaries that do not add up to our target number of minutes. select if (av41 ge -15 and av41 lt 61). execute. *recoding of selected time use variables to -9 (only for variables that could not be computed for this survey). recode av27 av38 av39 (0=-9). execute. save outfile='r:\soci 1205\data archives\time use archives\time use data surveys\canada\1992\world 5.5\can1992w552.sav' /keep=country period survey swave msamp id hldid persid day month year diary sex age2 agegr5y famstat cphome hhtype singpar hhldsize nchild agekid relrefp civstat cohab empstat3 emp unemp student retired empsp workhrs incorig income empinclm educa edtry disab urban paidetc hwork cooking eating kidcare shopping dtravel otravel perscare eatout pubclubs spectat asports walking visits tvrad reading chatsetc oddjobs hobbies medical educ tottime av1 to av40 av41. ************************ *computation of weights* ************************. *original survey weights. compute opopwt = 0. compute odaywt = 0. compute ocombwt = timewgt. *post-hoc population and day weights (to be computed only when original weights *are not available). compute popwt2 = 0. compute daywt2 = 0. *computation of the proposed weight. compute propwt = ocombwt/2369.5090. recode propwt (sysmis = 0). recode popwt2 (sysmis = 0). recode daywt2 (sysmis = 0). recode opopwt (sysmis = 0). recode odaywt (sysmis = 0). recode ocombwt (sysmis = 0). ************************************************ *formatting of variables and saving of outfile * ************************************************. apply dictionary from 'y:\all\mtus\mtusw552schema.sav'. value labels incorig 1 'no income' 2 'less than $5,000' 3 '$5,000 to $9,999' 4 '$10,000 to $14,999' 5 '$15,000 to $19,999' 6 '$20,000 to $29,999' 7 '$30,000 to $39,999' 8 '$40,000 to $49,999' 9 '$50,000 to $59,999' 10 '$60,000 to $79,999' 11 '$80,000 or more' 98 'do not know' 99 'not stated'. value labels educa 1 'doctorate, masters' 2 'degree in medicine' 3 'bachelor degree' 4 'community college' 5 'trade & technical degree' 6 'some university' 7 'some community college' 8 'some trade & technical' 9 'other education' 10 'secondary school educat' 11 'some secondary school' 12 'elementary school' 13 'no schooling' 99 'not stated'. save outfile='r:\soci 1205\data archives\time use archives\time use data surveys\canada\1992\world 5.5\can1992w552.sav' /keep=country period survey swave msamp hldid persid id day month year diary sex age2 agegr5y famstat cphome hhtype singpar hhldsize nchild agekid relrefp civstat cohab empstat3 emp unemp student retired empsp workhrs incorig income empinclm educa edtry disab urban paidetc hwork cooking eating kidcare shopping dtravel otravel perscare eatout pubclubs spectat asports walking visits tvrad reading chatsetc oddjobs hobbies medical educ tottime av1 av2 av3 av4 av5 av6 av7 av8 av9 av10 av11 av12 av13 av14 av15 av16 av17 av18 av19 av20 av21 av22 av23 av24 av25 av26 av27 av28 av29 av30 av31 av32 av33 av34 av35 av36 av37 av38 av39 av40 av41 opopwt odaywt ocombwt popwt2 daywt2 propwt.