**************************************************** **Syntax producing the USA heritage time use files** **1992-1994 - adult diaries ** **updated by Dr. Kimberly Fisher, CTUR, University** **of Oxford, UK, 5 December 2009 ** **written by Dr. Kimberly Fisher ** **Institute for Social and Economic Research ** **University of Essex, Wivenhoe Park Colchester ** **United Kingdom 18 April 2006 ** ****************************************************. GET FILE='C:\Documents and Settings\All Users\Documents\time-use-library\USA\1992-1994\usa92-94quest.sav' /keep respid type sex yob unemp year quarter hhwtq area hhwkwtq adwtq adwkwtq weight. sort cases by respid. select if type=1. fre yob. missing values all (). cro year by quarter. recode year (1995=1994). temp. select if yob=99. freq unemp. Do if yob>0 and yob<99. compute age=year-(1900+yob). Else if yob=0. compute age=year-1900. Else if yob=99. compute age=-8. End if. freq age. recode area (41=40)(42=41)(43=42)(44=43)(45=44) (46=45)(47=46)(49=47)(50=48)(51=49)(52=50) (53=51) (else=copy) into state. val lab state -9 data not available 1 ALABAMA 2 ALASKA 3 ARIZONA 4 ARKANSAS 5 CALIFORNIA 6 COLORADO 7 CONNECTICUT 8 DELAWARE 9 DISTRICT OF COLUMBIA 10 FLORIDA 11 GEORGIA 12 HAWAII 13 IDAHO 14 ILLINOIS 15 INDIANA 16 IOWA 17 KANSAS 18 KENTUCKY 19 LOUISIANA 20 MAINE 21 MARYLAND 22 MASSACHUSETTS 23 MICHIGAN 24 MINNESOTA 25 MISSISSIPPI 26 MISSOURI 27 MONTANA 28 NEBRASKA 29 NEVADA 30 NEW HAMPSHIRE 31 NEW JERSEY 32 NEW MEXICO 33 NEW YORK 34 NORTH CAROLINA 35 NORTH DAKOTA 36 OHIO 37 OKLAHOMA 38 OREGON 39 PENNSYLVANIA 40 RHODE ISLAND 41 SOUTH CAROLINA 42 SOUTH DAKOTA 43 TENNESSEE 44 TEXAS 45 UTAH 46 VERMONT 47 VIRGINIA 48 WASHINGTON 49 WEST VIRGINIA 50 WISCONSIN 51 WYOMING. cro area by state. compute exclude=0. if any (state,2,8,12,13,17,27,29,30,32,35,40,46,51) exclude=1. var lab exclude states to exclude in xtimewt. val lab exclude 0 states in all samples 1 states only in most recent samples. cro exclude by state. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\addsexage.sav' /drop type yob unemp year quarter. GET FILE='C:\Documents and Settings\All Users\Documents\time-use-library\USA\1992-1994\usa92-94ep.sav' /keep respid quarter date dmo strt end ract whr smk etoa day. match files files=* /in=addiary table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\addsexage.sav' /in=kiddiary by respid. var lab kiddiary marker of child diaries. val lab kiddiary 0 child completed adult diary 1 adult diary. cro addiary by kiddiary. *there are four child diaries in the adult diary set *these are marked for adding to the child diary set later. Save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\usa92-94ep.sav'. ******************* *begin conversions* *******************. missing values all (). *this dataset does not contain a code for eating at work, only *for eating. I tried the following steps to create a variable *for whether the respondent was at work on the diary day, but *eating at work appears subsumed under paid work. Also, I attempted *to use this procedure to identify other time at the workplace, *but again this attempt yielded no codes. Thus this step not used *in the end. * *compute atwrkdd=0. *var lab atwrkdd at work on diary day. *If ract=1 or ract=3 or ract=5 or ract=8 or ract=9 atwrkdd=1. *freq atwrkdd. *sort cases by respid. *AGGREGATE * /OUTFILE='c:\kimberly\time\ATUS\1992-1994\aggr.sav' * /BREAK=respid * /atwrkdd = MAX(atwrkdd). *start time range 0:00 to 23:59; end range 0:01 to 24:00. *create start and end minute variables in minute order of the day. sort cases by respid strt. Compute start=trunc(strt/100)*60+(strt-(trunc(strt/100))*100). Compute end2=trunc(end/100)*60+(end-(trunc(end/100))*100). Execute. temp. select if strt>60 and strt<180. cro strt by start. temp. select if end>60 and end<180. cro end by end2. compute clockst=strt. desc end2 start clockst. *create an activity number as not present. compute epnum=1. Do If $casenum>1 and respid=lag(respid). compute epnum=lag(epnum)+1. end if. freq epnum. *create duration variable. compute time=end2-start. desc time etoa. CORRELATIONS /VARIABLES=etoa time. compute hhid=respid. rename variables (respid dmo=pid month). compute cday=trunc(date/100) - trunc(date/10000)*100. recode day (1=2) (2=3) (3=4) (4=5) (5=6) (6=7) (7=1) INTO diaryday. compute wave=1. compute survey=4. Do if quarter=1. compute year=1992. Else if quarter>1 and quarter<6. compute year=1993. Else if quarter>5. compute year=1994. End if. compute main=-5. compute sec=-9. compute inout=-5. compute eloc=-5. compute mtrav=-7. compute alone=-9. compute infant=0. compute child=0. compute sppart=-9. compute clsfam=-9. compute hhadult=-9. compute animal=0. compute shoprof=0. compute cowork=-9. compute wellknw=0. compute otherp=0. compute unknwp=-9. apply dictionary from 'C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\History of harmonisation - Diary\schema\schema1.sav'. freq main sec inout eloc mtrav wave survey month cday year. cro day by diaryday. cro quarter by year. If ract=20 infant=1. If (ract>19 and ract<28) or ract=29 child=1. If ract=18 animal=1. If ((ract=31 or ract=32 or ract=38) and whr>199) shoprof=1. If ract=28 or (ract>32 and ract<38) or (ract>69 and ract<75) or ract=77 shoprof=1. If ract=42 or ract=63 or ract=75 or ract=76 or ract=78 wellknw=1. If ract=50 or ract=51 or ract=60 or ract=61 or ract=64 or ract=66 or ract=67 otherp=1. freq infant child animal shoprof wellknw otherp. *this coding syntax has a hierarchy - coded as outside if *possible first, and if not possible to code as outside, *then if possible to code as in transit, and if not possible, *then to code as inside, and residual set to -8. Do if whr=111 or whr=112 or whr=114 or whr=211 or whr=212 or whr=214 or whr=307 or whr=313 or whr>499 or ract=13 or ract=25 or ract=81 or ((ract=3 or ract=9 or ract=29 or ract=39 or ract=49 or ract=59 or ract=69 or ract=79 or ract=89 or ract=99) and (whr>305 and whr<309) ). compute inout=1. Else if (whr>300 and whr<306) or (whr>309 and whr<313) or ((ract=3 or ract=9 or ract=29 or ract=39 or ract=49 or ract=59 or ract=69 or ract=79 or ract=89 or ract=99) and whr~=313 and whr~=314). compute inout=3. Else if (whr>100 and whr<109) or whr=110 or whr=113 or (whr>200 and whr<209) or whr=210 or whr=213 or whr=314 or (whr>399 and whr<412) or (whr>412 and whr<421) or whr=499 or ract=12 or ract=24. compute inout=2. Else. compute inout=-8. End if. freq inout. temp. select if inout=1. freq ract whr. *some apparent location and activity conflicts, but these left without adjustment. temp. select if inout=2. freq ract whr. temp. select if inout=3. freq ract whr. *note three odd cases where activity recorded as travel and change of location *recorded, but location during travel listed as 102-home, living room; 415-church, *420-other verified indoors - these conflicting cases left as inside vehicle. *note also a number of cases where location is listed as in a vehicle and the *activity is something that one would not typically perform inside a vehicle, but *these conflicts also left unchanged. temp. select if inout=-8. freq ract whr. Do If whr>99 and whr<200. compute eloc=1. Else If whr>199 and whr<300. compute eloc=2. Else If whr=413. compute eloc=4. Else If whr=412. compute eloc=3. Else If whr>299 and whr<400. compute eloc=8. Else If whr=415. compute eloc=7. Else If whr=405 or whr=414 or whr=510. compute eloc=6. Else If ract=1 or (ract>2 and ract<9). compute eloc=3. Else. compute eloc=9. End if. cro whr by eloc. Do if ract=48. Compute main=1. Else if ract=45. Compute main=3. Else if ract=40 or ract=44 or ract=47. Compute main=6. Else if ract=41. Compute main=7. Else if ract=43. Compute main=9. Else if ract=1 and whr>199. Compute main=10. Else if ract=1 and whr<200. Compute main=11. Else if ract=5. Compute main=12. Else if ract=8. Compute main=13. Else if ract=2. Compute main=15. Else if ract=50. Compute main=16. Else if ract=54. Compute main=17. Else if ract=51. Compute main=18. Else if ract=55 or ract=56. Compute main=19. Else if ract=10. Compute main=20. Else if ract=11. Compute main=21. Else if ract=12 or ract=13. Compute main=22. Else if ract=14. Compute main=23. Else if ract=15 or ract=16. Compute main=24. Else if ract=19 or ract=38. Compute main=25. Else if ract=30. Compute main=26. Else if ract=31. Compute main=27. Else if ract=32. Compute main=28. Else if ract=33. Compute main=29. Else if ract=28 or ract=35 or ract=36. Compute main=30. Else if ract=34. Compute main=31. Else if ract=37. Compute main=32. Else if ract=20. Compute main=33. Else if ract=21. Compute main=34. Else if ract=26. Compute main=35. Else if ract=24. Compute main=36. Else if ract=22. Compute main=37. Else if ract=23. Compute main=38. Else if ract=27. Compute main=39. Else if ract=42. Compute main=40. Else if ract=63. Compute main=41. Else if ract=62. Compute main=42. Else if ract=60. Compute main=43. Else if ract=67. Compute main=44. Else if ract=66. Compute main=45. Else if ract=61 or ract=68. Compute main=46. Else if ract=64. Compute main=48. Else if ract=65. Compute main=49. Else if ract=70. Compute main=51. Else if ract=72. Compute main=52. Else if ract=73. Compute main=53. Else if ract=74. Compute main=54. Else if ract=71. Compute main=55. Else if ract=77. Compute main=56. Else if ract=76 or ract=78. Compute main=57. Else if ract=80 or ract=82. Compute main=60. Else if ract=81. Compute main=64. Else if ract=25. Compute main=65. Else if ract=17. Compute main=67. Else if ract=18. Compute main=68. Else if ract=75. Compute main=72. Else if ract=87. Compute main=73. Else if ract=86. Compute main=74. Else if ract=85. Compute main=75. Else if ract=84. Compute main=76. Else if ract=83. Compute main=77. Else if ract=98. Compute main=78. Else if ract=93. Compute main=81. Else if ract=94. Compute main=82. Else if ract=95. Compute main=83. Else if ract=92. Compute main=84. Else if ract=90. Compute main=85. Else if ract=91. Compute main=86. Else if ract=97. Compute main=87. Else if ract=96. Compute main=88. Else if ract=88. Compute main=89. Else if ract=49. Compute main=91. Else if ract=3. Compute main=92. Else if ract=9. Compute main=93. Else if ract=59. Compute main=94. Else if ract=39. Compute main=95. Else if ract=29. Compute main=96. Else if ract=69. Compute main=97. Else if ract=79 or ract=89 or ract=99. Compute main=98. End if. freq main. temp. select if main<15. cro ract by main. temp. select if main>14 and main<28. cro ract by main. temp. select if main>27 and main<42. cro ract by main. temp. select if main>41 and main<56. cro ract by main. temp. select if main>55 and main<70. cro ract by main. temp. select if main>69 and main<84. cro ract by main. temp. select if main>83. cro ract by main. *not possible in activity code frame to indentify walking *or cycling. Check if there are any instances of these *transport codes where the activity is not listed as travel. temp. select if whr=306 or whr=307. freq ract main. *in all cases, another activity is coded, so walking *and cycling coded as secondary activities if the mode *of transport is coded as walking or cycling. *as there are no missing cases in the main activity, it *is only possible to impute for secondary missing travel *as well as adding secondary cycling and walking. Do If whr=306. compute sec=62. Else If whr=307. compute sec=63. Else If main<90 and eloc=8. compute sec=90. Else if hhid=lag(hhid) and (eloc<8 and eloc~=6 and lag(eloc)<8 and lag(eloc)~=6 and eloc~=lag(eloc)). compute sec=90. End if. freq sec. cro sec by eloc. Do If whr>300 and whr<305. compute mtrav=1. Else If whr=305 or (whr>309 and whr<313). compute mtrav=2. Else If whr=306 or whr=308. compute mtrav=3. Else If whr=307. compute mtrav=4. Else If whr=300 or whr=320 or whr=399. compute mtrav=5. Else if ((main>89 and main<99) or sec=90) and mtrav=-7. compute mtrav=-8. end if. freq mtrav. cro whr by mtrav. sort cases by survey wave hhid pid. *note - no missing main activity time in this file. *we have chosen to impute codes to fill missing gaps *but not to impute codes to replace ativities recorded *in the diaries. For this file, the only potential *imputation relates to seconday imputed travel (code 90) *and imputed eating where no main activity eating but *main activity food preparation or setting table reported. *first test for the need for such imputation - that is *cases or main activity not travel but location is *travelling. compute test=0. If main<90 and sec=-9 and eloc=8 test=1. freq test. *in contrast with 1965-66, there are no such episodes which were not already addressed. compute eatdr=0. If main=8 or main=9 or main=56 or sec=8 or sec=9 or sec=56 eatdr=time. *check for missing eating time but recorded set table or food prep. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK= hhid pid /anyeat = SUM(eatdr) /maxep = MAX(epnum). desc anyeat. temp. select if anyeat=0. freq maxep main. *a number of really low episode diaries with missing eating, *but many more with a reasonable number of episodes. Do if anyeat=0 and (main=20 or main=21) and sec=-9 and maxep>9. compute sec=2. End if. freq sec. temp. select if mtrav=-7. freq main sec. Do if mtrav=-7 and (main>89 or sec>89). compute mtrav=5. End if. freq mtrav. desc weight. freq age sex. recode age sex (sysmis=-8). *age and sex are retained here for some checking and also *as some children completed the adult diaries, and also as *some adults completed child diaries (though these cases will *be addressed from the child diary file later). save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\USA1993hfep.SAV' /KEEP survey wave hhid pid diaryday cday month year time clockst start end2 epnum main sec inout eloc mtrav alone infant child sppart clsfam hhadult animal shoprof cowork wellknw otherp unknwp age sex weight kiddiary exclude. Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\USA1993hfep.SAV'. select if kiddiary=0. execute. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\addkiddiarieshfep.sav'. Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\USA1993hfep.SAV'. select if kiddiary=1. execute. *note that as no missing time left in the 1992-94 data file, the *missing time variables are include simply to hold the place *of this variable for comparison with later files. Compute t0pcare=0. Compute t1paidw=0. Compute t2ed=0. compute t3unpaid=0. compute t4acvol=0. compute t5outhm=0. compute t6exerc=0. compute t7inhm=0. compute t8media=0. compute t9trav=0. compute tmiss=0. vector tmain(98) tsc(98). compute outside=0. compute inveh=0. compute inside=0. compute locunk=0. compute athome=0. compute atwrksc=0. compute elsewhr=0. compute lunk=0. compute walone=-9. compute wchild=0. compute wsppart=-9. compute wclsfam=-9. compute wother=0. compute withunk=-9. compute eatdr=0. compute sleep=0. compute perscare=0. compute mstrav=0. compute anycare=0. If main>-1 and main<10 t0pcare =time. If main>9 and main<16 t1paidw =time. If main>15 and main<20 t2ed =time. If main>19 and main<40 t3unpaid =time. If main>39 and main<50 t4acvol =time. If main>49 and main<60 t5outhm =time. If main>59 and main<70 t6exerc =time. If main>69 and main<80 t7inhm =time. If main>79 and main<90 t8media =time. If main>89 and main<100 t9trav =time. If main=8 or main=9 or main=56 or sec=2 or sec=8 or sec=9 eatdr=time. If main=3 or main=4 or main=5 or main=78 or sec=3 or sec=5 or sec=78 sleep=time. If main=1 or main=2 or main=6 or main=7 or sec=1 or sec=6 or sec=7 perscare =time. If main=62 or main=63 or (main>89 and main<99) or sec=62 or sec=63 or (sec>89 and sec<99) mstrav=time. If (main>32 and main<41) or (sec>32 and sec<41) anycare=1. If inout=1 outside =time. if inout=2 inside =time. if inout=3 inveh =time. if inout=-8 locunk =time. if eloc=1 athome =time. if eloc=3 or eloc=4 atwrksc =time. if eloc=2 or eloc>4 elsewhr =time. If eloc=-8 lunk =time. If child=1 wchild =time. If shoprof=1 or otherp=1 or (wellknw=1 and clsfam=0) wother =time. Do repeat a=tmain1 to tmain98 /b=tsc1 to tsc98 /i=1 to 98. compute a=0. compute b=-9. If main=i a=time. End repeat. execute. apply dictionary from 'C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\History of harmonisation - Diary\schema\schema2.sav'. desc t0pcare t1paidw t2ed t3unpaid t4acvol t5outhm t6exerc t7inhm t8media t9trav tmiss eatdr sleep perscare mstrav outside inside inveh locunk athome atwrksc elsewhr lunk walone wchild wsppart wclsfam wother withunk. compute t1dig = SUM(t0pcare to tmiss). compute t2dig = SUM (tmain1 to tmain98). compute t2dig = t2dig + tmiss. execute. *set all variable codes which could not be *constructed to -9 for missing. recode tmain2 tmain4 tmain5 tmain8 tmain14 tmain50 tmain58 tmain66 tmain70 tmain71 tmain90 (0=-9). var lab anycare marker of diarist who performed care. val lab anycare 0 no care recorded 1 child or adult care recorded. freq anycare. temp. select if anycare=1. cro main by sec. compute mistrav=0. compute mispcare=0. var lab mistrav marker for missing travel. var lab mispcare marker for missing personal care. if ((lag(main)=3 or lag(main)=4 or lag(main)=5) and (lag(eloc)=1 or lag(eloc)=2)) and eloc>2 mispcare=1. freq mispcare. AGGREGATE /OUTFILE='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\USA1993hfsum.sav' /BREAK=survey wave hhid pid /diaryday = MAX(diaryday) /cday = MAX(cday) /month = MAX(month) /year = MAX(year) /tottime "total minutes recorded in diary" = SUM(time) /numep 'total original episodes recorded' = MAX(epnum) /t0pcare = SUM(t0pcare) /t1paid = SUM(t1paidw) /t2ed = SUM(t2ed) /t3unpaid = SUM(t3unpaid) /t4acvol = SUM(t4acvol) /t5outhm = SUM(t5outhm) /t6exerc = SUM(t6exerc) /t7inhm = SUM(t7inhm) /t8media = SUM(t8media) /t9trav = SUM(t9trav) /tmiss = SUM(tmiss) /tmain1 = SUM(tmain1) /tmain2 = MAX(tmain2) /tmain3 = SUM(tmain3) /tmain4 = MAX(tmain4) /tmain5 = MAX(tmain5) /tmain6 = SUM(tmain6) /tmain7 = SUM(tmain7) /tmain8 = MAX(tmain8) /tmain9 = SUM(tmain9) /tmain10 = SUM(tmain10) /tmain11 = SUM(tmain11) /tmain12 = SUM(tmain12) /tmain13 = SUM(tmain13) /tmain14 = MAX(tmain14) /tmain15 = SUM(tmain15) /tmain16 = SUM(tmain16) /tmain17 = SUM(tmain17) /tmain18 = SUM(tmain18) /tmain19 = SUM(tmain19) /tmain20 = SUM(tmain20) /tmain21 = SUM(tmain21) /tmain22 = SUM(tmain22) /tmain23 = SUM(tmain23) /tmain24 = SUM(tmain24) /tmain25 = SUM(tmain25) /tmain26 = SUM(tmain26) /tmain27 = SUM(tmain27) /tmain28 = SUM(tmain28) /tmain29 = SUM(tmain29) /tmain30 = SUM(tmain30) /tmain31 = SUM(tmain31) /tmain32 = SUM(tmain32) /tmain33 = SUM(tmain33) /tmain34 = SUM(tmain34) /tmain35 = SUM(tmain35) /tmain36 = SUM(tmain36) /tmain37 = SUM(tmain37) /tmain38 = SUM(tmain38) /tmain39 = SUM(tmain39) /tmain40 = SUM(tmain40) /tmain41 = SUM(tmain41) /tmain42 = SUM(tmain42) /tmain43 = SUM(tmain43) /tmain44 = SUM(tmain44) /tmain45 = SUM(tmain45) /tmain46 = SUM(tmain46) /tmain48 = SUM(tmain48) /tmain49 = SUM(tmain49) /tmain50 = MAX(tmain50) /tmain51 = SUM(tmain51) /tmain52 = SUM(tmain52) /tmain53 = SUM(tmain53) /tmain54 = SUM(tmain54) /tmain55 = SUM(tmain55) /tmain56 = SUM(tmain56) /tmain57 = SUM(tmain57) /tmain58 = MAX(tmain58) /tmain60 = SUM(tmain60) /tmain62 = SUM(tmain62) /tmain63 = SUM(tmain63) /tmain64 = SUM(tmain64) /tmain65 = SUM(tmain65) /tmain66 = MAX(tmain66) /tmain67 = SUM(tmain67) /tmain68 = SUM(tmain68) /tmain70 = MAX(tmain70) /tmain71 = MAX(tmain71) /tmain72 = SUM(tmain72) /tmain73 = SUM(tmain73) /tmain74 = SUM(tmain74) /tmain75 = SUM(tmain75) /tmain76 = SUM(tmain76) /tmain77 = SUM(tmain77) /tmain78 = SUM(tmain78) /tmain81 = SUM(tmain81) /tmain82 = SUM(tmain82) /tmain83 = SUM(tmain83) /tmain84 = SUM(tmain84) /tmain85 = SUM(tmain85) /tmain86 = SUM(tmain86) /tmain87 = SUM(tmain87) /tmain88 = SUM(tmain88) /tmain89 = SUM(tmain89) /tmain90 = MAX(tmain90) /tmain91 = SUM(tmain91) /tmain92 = SUM(tmain92) /tmain93 = SUM(tmain93) /tmain94 = SUM(tmain94) /tmain95 = SUM(tmain95) /tmain96 = SUM(tmain96) /tmain97 = SUM(tmain97) /tmain98 = SUM(tmain98) /tsc1 = MAX(tsc1) /tsc2 = MAX(tsc2) /tsc3 = MAX(tsc3) /tsc4 = MAX(tsc4) /tsc5 = MAX(tsc5) /tsc6 = MAX(tsc6) /tsc7 = MAX(tsc7) /tsc8 = MAX(tsc8) /tsc9 = MAX(tsc9) /tsc10 = MAX(tsc10) /tsc11 = MAX(tsc11) /tsc12 = MAX(tsc12) /tsc13 = MAX(tsc13) /tsc14 = MAX(tsc14) /tsc15 = MAX(tsc15) /tsc16 = MAX(tsc16) /tsc17 = MAX(tsc17) /tsc18 = MAX(tsc18) /tsc19 = MAX(tsc19) /tsc20 = MAX(tsc20) /tsc21 = MAX(tsc21) /tsc22 = MAX(tsc22) /tsc23 = MAX(tsc23) /tsc24 = MAX(tsc24) /tsc25 = MAX(tsc25) /tsc26 = MAX(tsc26) /tsc27 = MAX(tsc27) /tsc28 = MAX(tsc28) /tsc29 = MAX(tsc29) /tsc30 = MAX(tsc30) /tsc31 = MAX(tsc31) /tsc32 = MAX(tsc32) /tsc33 = MAX(tsc33) /tsc34 = MAX(tsc34) /tsc35 = MAX(tsc35) /tsc36 = MAX(tsc36) /tsc37 = MAX(tsc37) /tsc38 = MAX(tsc38) /tsc39 = MAX(tsc39) /tsc40 = MAX(tsc40) /tsc41 = MAX(tsc41) /tsc42 = MAX(tsc42) /tsc43 = MAX(tsc43) /tsc44 = MAX(tsc44) /tsc45 = MAX(tsc45) /tsc46 = MAX(tsc46) /tsc48 = MAX(tsc48) /tsc49 = MAX(tsc49) /tsc50 = MAX(tsc50) /tsc51 = MAX(tsc51) /tsc52 = MAX(tsc52) /tsc53 = MAX(tsc53) /tsc54 = MAX(tsc54) /tsc55 = MAX(tsc55) /tsc56 = MAX(tsc56) /tsc57 = MAX(tsc57) /tsc58 = MAX(tsc58) /tsc60 = MAX(tsc60) /tsc62 = MAX(tsc62) /tsc63 = MAX(tsc63) /tsc64 = MAX(tsc64) /tsc65 = MAX(tsc65) /tsc66 = MAX(tsc66) /tsc67 = MAX(tsc67) /tsc68 = MAX(tsc68) /tsc70 = MAX(tsc70) /tsc71 = MAX(tsc71) /tsc72 = MAX(tsc72) /tsc73 = MAX(tsc73) /tsc74 = MAX(tsc74) /tsc75 = MAX(tsc75) /tsc76 = MAX(tsc76) /tsc77 = MAX(tsc77) /tsc78 = MAX(tsc78) /tsc81 = MAX(tsc81) /tsc82 = MAX(tsc82) /tsc83 = MAX(tsc83) /tsc84 = MAX(tsc84) /tsc85 = MAX(tsc85) /tsc86 = MAX(tsc86) /tsc87 = MAX(tsc87) /tsc88 = MAX(tsc88) /tsc89 = MAX(tsc89) /tsc90 = MAX(tsc90) /tsc91 = MAX(tsc91) /tsc92 = MAX(tsc92) /tsc93 = MAX(tsc93) /tsc94 = MAX(tsc94) /tsc95 = MAX(tsc95) /tsc96 = MAX(tsc96) /tsc97 = MAX(tsc97) /tsc98 = MAX(tsc98) /outside= SUM(outside) /inside=SUM(inside) /inveh= SUM(inveh) /locunk = SUM(locunk) /athome=SUM(athome) /atwrksc=SUM(atwrksc) /elsewhr= SUM(elsewhr) /lunk = SUM(lunk) /walone = MAX(walone) /wchild = SUM(wchild) /wsppart=MAX(wsppart) /wclsfam= MAX(wclsfam) /wother = SUM(wother) /withunk=MAX(withunk) /eatdr = SUM(eatdr) /sleep = SUM(sleep) /perscare=SUM(perscare) /mstrav= SUM(mstrav) /t1dig = SUM(t1dig) /t2dig = SUM(t2dig) /sex = MAX(sex) /age = MAX(age) /weight = MAX(weight) /exclude = MAX(exclude) /anycare = MAX(anycare) /mistrav=MAX(mistrav) /mispcare=MAX(mispcare). Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\USA1993hfsum.sav'. *check that variables sum to 1440 in aggregated file. formats tottime t0pcare to t2dig (f8.0). execute. freq t1dig t2dig tottime. compute muchmiss=0. If tmiss>90 muchmiss=1. var lab muchmiss missing more than 90 minutes. val lab muchmiss 0 no more than 90 minutes missing 1 more than 90 minutes missing. freq muchmiss. *no diaries missing time. compute lowep=0. If numep<7 lowep=1. var lab lowep "<7 episodes". cro lowep by numep. freq lowep. *153 low episode diaries. compute misbasic=0. If mstrav=0 misbasic=misbasic+1. If eatdr=0 misbasic=misbasic+1. If sleep=0 misbasic=misbasic+1. If perscare=0 misbasic=misbasic+1. var lab misbasic number basic activites not recorded. freq misbasic /format = dvalue. if perscare=0 and mispcare=1 misbasic=misbasic-1. freq misbasic /format = dvalue. temp. select if misbasic=2. freq numep. if misbasic=2 and numep>14 misbasic=1. if athome>1199 and misbasic=2 and numep>11 misbasic=1. freq misbasic /format = dvalue. temp. select if anycare=1 and misbasic>1. freq numep. *some people missing 2+ basic activities but *performed care, though some diaries low episode. compute caremflg=0. if anycare=1 and misbasic>1 and numep>6 caremflg=1. cro caremflg by anycare by misbasic. compute lowqual=0. If muchmiss=1 or lowep=1 or (misbasic>1 and caremflg=0) lowqual=1. freq sex age diaryday lowqual. cro lowqual by misbasic. compute baddem=0. If age<0 or sex<0 or diaryday=-8 baddem=1. freq baddem. cro baddem by age sex diaryday lowqual. compute origwght=weight. compute owghtflg=3. compute xtimewt=0. compute infltwt=0. compute recwght=0. apply dictionary from 'C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\History of harmonisation - Diary\schema\schema2.sav'. cro lowqual by muchmiss lowep misbasic. freq lowqual baddem. cro lowqual by baddem. freq diaryday. weight by weight. freq diaryday. weight off. *the existing weight is a day and population weight. *reset the weight to remove the bad diaries and bad *demographic cases. Nonetheless, there are too few older *people in the weighted sample - this is now adjusted with *the ad hoc weighting. recode age (18 thru 24=1)(25 thru 34=2)(35 thru 44=3) (45 thru 54=4)(55 thru 64=5)(65 thru high=6) (else=8) into agegp. If lowqual=1 or baddem=1 or diaryday=-8 agegp=8. freq agegp. compute agesexgp=agegp+ 10*(sex-1). val lab agesexgp 1 "men 18 thru 24" 2 "men 25 thru 34" 3 "men 35 thru 44" 4 "men 45 thru 54" 5 "men 55 thru 64" 6 "men 65+" 8 "men age missing or bad diary" 11 "women 18 thru 24" 12 "women 25 thru 34" 13 "women 35 thru 44" 14 "women 45 thru 54" 15 "women 55 thru 64" 16 "women 65+" 18 "women age missing or bad diary". fre agesexgp. compute agesexg2=agesexgp. if exclude=1 and sex=1 agesexg2=8. if exclude=1 and sex=2 agesexg2=18. freq agesexgp agesexg2. temp. select if agesexgp<9. freq agesexgp. temp. select if agesexgp>8. freq agesexgp. temp. select if agesexg2<9. freq agesexg2. temp. select if agesexg2>8. freq agesexg2. ******************************************************** * NOTE: Exclude * * Main file state * * Value Label Frequency % | CPS * * men 18 thru 24 370 11.1 |10.8 12.7 * * men 25 thru 34 754 22.6 |21.9 21.7 * * men 35 thru 44 650 19.5 |18.4 22.6 * * men 45 thru 54 501 15.0 |14.3 17.0 * * men 55 thru 64 416 12.5 |11.8 11.2 * * men 65+ 435 13.1 |12.4 14.8 * * men miss age/bad diary 203 6.1 |10.4 100.0 * * * * women 18 thru 24 353 8.4 | 8.2 12.1 * * women 25 thru 34 823 19.7 |18.9 21.0 * * women 35 thru 44 791 18.9 |17.9 21.3 * * women 45 thru 54 642 15.3 |14.4 16.0 * * women 55 thru 64 510 12.2 |11.4 11.0 * * women 65+ 804 19.2 |18.4 18.6 * * women miss age/bad diary 262 6.3 |10.8 100.0 * * ------- -------| * * total cases 7514 * * Valid cases 7049 Missing cases 465 * ********************************************************. Do if agesexgp=1. compute agesexwt =(12.7/11.1). Else if agesexgp=2. compute agesexwt =(21.7/22.6). Else if agesexgp=3. compute agesexwt =(22.6/19.5). Else if agesexgp=4. compute agesexwt =(17/15). Else if agesexgp=5. compute agesexwt =(11.2/12.5). Else if (agesexgp=6). compute agesexwt =(14.8/13.1). Else if agesexgp = 11. compute agesexwt =(12.1/8.4). Else if agesexgp = 12. compute agesexwt =(21/19.7). Else if agesexgp = 13. compute agesexwt =(21.3/18.9). Else if agesexgp = 14. compute agesexwt =(16/15.3). Else if agesexgp = 15. compute agesexwt =(11/12.2). Else if agesexgp = 16. compute agesexwt =(18.6/19.2). Else if agesexgp=8 or agesexgp=18. compute agesexwt =0. End if. Do if agesexg2=1. compute agesexw2 =(12.7/10.8). Else if agesexg2=2. compute agesexw2 =(21.7/21.9). Else if agesexg2=3. compute agesexw2 =(22.6/18.4). Else if agesexg2=4. compute agesexw2 =(17/14.4). Else if agesexg2=5. compute agesexw2 =(11.2/11.8). Else if (agesexg2=6). compute agesexw2 =(14.8/12.2). Else if agesexg2 = 11. compute agesexw2 =(12.1/8.2). Else if agesexg2 = 12. compute agesexw2 =(21/18.9). Else if agesexg2 = 13. compute agesexw2 =(21.3/17.9). Else if agesexg2 = 14. compute agesexw2 =(16/14.4). Else if agesexg2 = 15. compute agesexw2 =(11/11.4). Else if (agesexg2=16). compute agesexw2 =(18.6/18.4). Else if agesexg2=8 or agesexg2=18 or exclude=1. compute agesexw2 =0. End if. compute agesexwta=weight. if agesexg2=8 or agesexg2=18 agesexwta=0. compute agesexw2a=weight. if agesexg2=8 or agesexg2=18 or exclude=1 agesexw2a=0. desc agesexwt agesexwta agesexw2 agesexw2a. sort cases by agesexgp diaryday. aggregate outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\group.sav' /break=agesexgp /grouptot=sum(agesexwt) /grouptota=sum(agesexwta) /group2=sum(agesexw2) /group2a=sum(agesexw2a). aggregate outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\day.sav' /break= agesexgp diaryday /daytot=sum(agesexwt) /daytota=sum(agesexwta) /dayn=nu. match files file=* /table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\group.sav' /by agesexgp. execute. match files file=* /table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\day.sav' /by agesexgp diaryday. execute. sort cases by agesexg2 diaryday. aggregate outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\day2.sav' /break= agesexg2 diaryday /daytot2=sum(agesexw2) /daytot2a=sum(agesexw2a) /dayn2=nu. execute. match files file=* /table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\day2.sav' /by agesexg2 diaryday. execute. compute exptot=(grouptot/7). compute exptota=(grouptota/7). compute exptot2=(group2/7). compute exptot2a=(group2a/7). compute recwa=0. compute recwb=0. Do if lowqual=0 and baddem=0. compute recwa=(exptot/daytot)/(dayn/daytot). compute recwb=(exptota/daytota)/(dayn/daytota). End if. compute xtimewta=0. compute xtimewtb=0. Do if lowqual=0 and baddem=0 and exclude=0. compute xtimewta=(exptot2/daytot2)/(dayn2/daytot2). compute xtimewtb=(exptot2a/daytot2a)/(dayn2/daytot2a). End if. desc recwa recwb xtimewta xtimewtb weight. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK= survey /recsum = SUM(recwb) /xtsum = SUM(xtimewtb). freq recsum xtsum. compute recwght=recwb*7514/6777.53. compute xtimewt=xtimewtb*7514/6777.53. desc recwght xtimewt. *better standard deviation using the modified original weight. weight by recwght. fre diaryday. cro agesexgp by diaryday /cell=row. fre agesexgp. weight by xtimewt. fre diaryday. cro agesexgp by diaryday /cell=row. fre agesexgp. weight off. compute agegp2=-8. if sex=1 and (age>17 and age<30) agegp2=0. if sex=1 and (age>29 and age<40) agegp2=1. if sex=1 and (age>39 and age<50) agegp2=2. if sex=1 and (age>49 and age<60) agegp2=3. if sex=1 and (age>59 and age<70) agegp2=4. if sex=1 and age>69 agegp2=5. if sex=2 and (age>17 and age<30) agegp2=6. if sex=2 and (age>29 and age<40) agegp2=7. if sex=2 and (age>39 and age<50) agegp2=8. if sex=2 and (age>49 and age<60) agegp2=9. if sex=2 and (age>59 and age<70) agegp2=10. if sex=2 and age>69 agegp2=11. val lab agegp2 -8 missing 0 men aged 18-29 1 men aged 30-39 2 men aged 40-49 3 men aged 50-59 4 men aged 60-69 5 "men aged 70+" 6 women aged 18-29 7 women aged 30-39 8 women aged 40-49 9 women aged 50-59 10 women aged 60-69 11 "women aged 70+". weight by recwght. freq agegp2. weight off. ***************************************** * CPS age distributions * * population 18-65 * * diary * * MEN frequency % frequency * * age 18-29 11496 22.7 913 * * age 30-39 11951 23.6 828 * * age 40-49 10229 20.2 664 * * age 50-59 6735 13.3 473 * * age 60-69 5216 10.3 310 * * age 70+ 5013 9.9 226 * * total 50641 * * * * WOMEN frequency % * * age 18-29 12481 21.8 925 * * age 30-39 12825 22.4 1009 * * age 40-49 10936 19.1 854 * * age 50-59 7386 12.9 536 * * age 60-69 5954 10.4 399 * * age 70+ 7672 13.4 377 * * total 57254 * * * * total 107895 7514 * *****************************************. *produce a weight which inflates to the CPS *population size. Do if agegp2=0. compute infltwt=recwght*(11496/913). Else if agegp2=1. compute infltwt=recwght*(11951/828). Else if agegp2=2. compute infltwt=recwght*(10229/664). Else if agegp2=3. compute infltwt=recwght*(6735/473). Else if agegp2=4. compute infltwt=recwght*(5216/310). Else if agegp2=5. compute infltwt=recwght*(5013/226). Else if agegp2=6. compute infltwt=recwght*(12481/925). Else if agegp2=7. compute infltwt=recwght*(12825/1009). Else if agegp2=8. compute infltwt=recwght*(10936/854). Else if agegp2=9. compute infltwt=recwght*(7386/536). Else if agegp2=10. compute infltwt=recwght*(5954/399). Else if agegp2=11. compute infltwt=recwght*(7672/377). End if. execute. weight by infltwt. freq agegp2 diaryday. weight off. sort cases by survey wave hhid pid. Save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Diary\diary1992-94\USA1993hfsum.sav' /drop eatdr sleep perscare mstrav muchmiss lowep misbasic t1dig t2dig age sex weight agegp agesexgp agesexg2 agesexwt agesexw2 agesexwt agesexw2a grouptot grouptota group2 group2a daytot daytota daytot2 dayn daytot2a dayn2 exptot exptota exptot2 exptot2a recwa recwb xtimewta xtimewtb recsum xtsum agegp2 anycare exclude. Save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\addlow.sav' /keep survey wave hhid pid lowqual baddem caremflg origwght owghtflg xtimewt infltwt recwght. *double check all relevant variables present. Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\USA1993hfep.SAV'. select if kiddiary=1. execute. rename variables (end2=end). match files files=* table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1992-1994\addlow.sav' /BY hhid. apply dictionary from 'C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\History of harmonisation - Diary\schema\schema1.sav'. SAVE OUTFILE='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Diary\diary1992-94\USA1993hfep.sav' /drop age sex kiddiary weight exclude. *test labels and variables. Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Diary\diary1992-94\USA1993hfep.SAV'. desc survey wave hhid pid diaryday cday month year time clockst start end epnum main sec inout eloc mtrav alone infant child sppart clsfam hhadult animal shoprof cowork wellknw otherp unknwp origwght xtimewt infltwt recwght. freq survey wave diaryday cday month year epnum main sec inout eloc mtrav alone infant child sppart clsfam hhadult animal shoprof cowork wellknw otherp unknwp lowqual baddem caremflg. get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Diary\diary1992-94\USA1993hfsum.sav' /keep survey wave hhid pid diaryday cday month year tottime numep t0pcare t1paid t2ed t3unpaid t4acvol t5outhm t6exerc t7inhm t8media t9trav tmiss tmain1 tmain2 tmain3 tmain4 tmain5 tmain6 tmain7 tmain8 tmain9 tmain10 tmain11 tmain12 tmain13 tmain14 tmain15 tmain16 tmain17 tmain18 tmain19 tmain20 tmain21 tmain22 tmain23 tmain24 tmain25 tmain26 tmain27 tmain28 tmain29 tmain30 tmain31 tmain32 tmain33 tmain34 tmain35 tmain36 tmain37 tmain38 tmain39 tmain40 tmain41 tmain42 tmain43 tmain44 tmain45 tmain46 tmain48 tmain49 tmain50 tmain51 tmain52 tmain53 tmain54 tmain55 tmain56 tmain57 tmain58 tmain60 tmain62 tmain63 tmain64 tmain65 tmain66 tmain67 tmain68 tmain70 tmain71 tmain72 tmain73 tmain74 tmain75 tmain76 tmain77 tmain78 tmain81 tmain82 tmain83 tmain84 tmain85 tmain86 tmain87 tmain88 tmain89 tmain90 tmain91 tmain92 tmain93 tmain94 tmain95 tmain96 tmain97 tmain98 tsc1 tsc2 tsc3 tsc4 tsc5 tsc6 tsc7 tsc8 tsc9 tsc10 tsc11 tsc12 tsc13 tsc14 tsc15 tsc16 tsc17 tsc18 tsc19 tsc20 tsc21 tsc22 tsc23 tsc24 tsc25 tsc26 tsc27 tsc28 tsc29 tsc30 tsc31 tsc32 tsc33 tsc34 tsc35 tsc36 tsc37 tsc38 tsc39 tsc40 tsc41 tsc42 tsc43 tsc44 tsc45 tsc46 tsc48 tsc49 tsc50 tsc51 tsc52 tsc53 tsc54 tsc55 tsc56 tsc57 tsc58 tsc60 tsc62 tsc63 tsc64 tsc65 tsc66 tsc67 tsc68 tsc70 tsc71 tsc72 tsc73 tsc74 tsc75 tsc76 tsc77 tsc78 tsc81 tsc82 tsc83 tsc84 tsc85 tsc86 tsc87 tsc88 tsc89 tsc90 tsc91 tsc92 tsc93 tsc94 tsc95 tsc96 tsc97 tsc98 outside inside inveh locunk athome atwrksc elsewhr lunk walone wchild wsppart wclsfam wother withunk lowqual baddem caremflg origwght owghtflg xtimewt infltwt recwght. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Diary\diary1992-94\USA1993hfsum.sav'. desc survey wave hhid pid diaryday cday month year tottime numep t0pcare t1paid t2ed t3unpaid t4acvol t5outhm t6exerc t7inhm t8media t9trav tmiss tmain1 to tsc98 outside inveh inside locunk athome atwrksc elsewhr lunk walone wchild wsppart wclsfam wother withunk origwght xtimewt infltwt recwght. freq survey wave diaryday cday month year tottime numep lowqual baddem caremflg. temp. select if recwght=0. cro lowqual by baddem. temp. select if recwght~=0. freq diaryday. weight by recwght. freq diaryday.