**************************************************** **Syntax producing the USA heritage time use files** **1985 ** **written by Dr. Kimberly Fisher ** **Institute for Social and Economic Research ** **University of Essex, Wivenhoe Park Colchester ** **United Kingdom, 10 May 2006, upgraded by Dr. ** **Fisher 9 January 2010 ** ****************************************************. *significant note - originally, this dataset was recorded *in three episode files, one for each sample. An all *sample file of aggregated main activity was derived from *these files. Sadly, the episode files for the phone and *personal interview samples have become corrupted. The *mail-back sample episode file remains, but this file *did not match properly to demographic information. *not only is there no background information for the *child diaries, but also just under 300 adult diaries *are missing basic information (with the amount of *missing information varying across each variable). *for instance, in this file (mail85.sav), 12.7% of cases *are missing sex, 14.5% missing marital status, and *17.6% missing age. The summary file for the mail-back *sample (usa85.sav) includes sex for all 2921 cases; *only 2.5% of cases are missing marital status, and *6.4% are missing age. The episode file appears to *have mismatching of demographic information to diaries. *We conclude this as there are just over 800 diaries *were the diaries in both the episode and the summary *file do not match, while for all other diaries *match between the two files. The 800-odd cases which *do not match between the two files show standard *gender trends in the summary file (women are more *likely to work part-time than full-time and do *a lot more domestic work, adult care and child care *than men; men do more sports, repairs, and paid *work than women), while in the mismatched cases in *the episode file appear to show the reverse gender *distribution of time patterns. We ultimately used the *usa85.sav file for the background information, and the *episode file for the diaries. ******************************************************************** *creating the spouse ids in the episode files reveals four what are* *almost certainly mistakes in the coding of sex in the raw datafile* *two of these cases are retired couples living with adult children * *and grandchildren and the other two are middle-aged couples with * *young children, and both partners are coded as married, and one is* *a homemaker and has a lot of housework time - the sex for these * *cases reset to female * ********************************************************************. get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA85quest.sav'. freq sex. *In these four cases, a person coded as a man cares for a young child, reports being married *and reports being in a couple with children household, and reports being a homemaker. As no states *permitted gay marriage in 1985 and as only two people are coded as being married in these *households, we recoded these four cases as female as a part of the data cleaning process. if hhid=1407 and pid=3 sex=2. if hhid=7314 and pid=2 sex=2. if hhid=7339 and pid=2 sex=2. if hhid=7749 and pid=2 sex=2. freq sex. *some details of household composition permit lose approximation of age for *some missing cases (based on the age of the children and age of the spouse). freq age. if hhid=36 and pid=2 age=20. if hhid=164 and pid=2 age=18. if hhid=255 and pid<3 age=40. if hhid=451 and pid=3 age=52. if hhid=522 and pid=1 age=50. if hhid=522 and pid=2 age=52. if hhid=522 and pid=3 age=30. if hhid=522 and pid=4 age=28. if hhid=522 and pid=5 age=26. if hhid=522 and pid=6 age=24. if hhid=810 and pid=2 age=40. if hhid=810 and pid=3 age=19. if hhid=810 and pid=4 age=18. if hhid=999 and pid=3 age=20. if hhid=1336 and pid=2 age=45. if hhid=1343 and pid=1 age=50. if hhid=1343 and pid=2 age=48. if hhid=1343 and pid=3 age=23. if hhid=1343 and pid=4 age=21. if hhid=1343 and pid=5 age=20. if hhid=1518 and pid=2 age=42. if hhid=1518 and pid=3 age=44. if hhid=1547 and pid=3 age=42. if hhid=1547 and pid=4 age=40. if hhid=1656 and pid=5 age=42. if hhid=7114 and pid=7 age=40. if hhid=7042 and pid=3 age=23. if hhid=7042 and pid=4 age=20. if hhid=7042 and pid=5 age=19. if hhid=7042 and pid=6 age=18. if hhid=7262 and pid=3 age=22. freq age. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA85quest.sav'. ****************************** *open base time use variables* ******************************. GET FILE='C:\Documents and Settings\All Users\Documents\time-use-library\USA\1985\us85mail.sav' /keep hhid pid sttime endtime actcode act2 where rating tv day date min sex age marital mdaywt mailwt. missing values all (). if hhid=1407 and pid=3 sex=2. if hhid=7314 and pid=2 sex=2. if hhid=7339 and pid=2 sex=2. if hhid=7749 and pid=2 sex=2. *check demographic variable distributions. freq sex age marital. sort cases by hhid pid. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\maildiary.sav' /drop sex age marital. *********************** *begin to convert file* ***********************. ADD FILES /FILE='C:\Documents and Settings\All Users\Documents\time-use-library\USA\1985\usa85.sav' /FILE='C:\Documents and Settings\All Users\Documents\time-use-library\USA\1985\teen.sav' /in=group /RENAME (pid rush1 rush2 rush3 state=d0 d1 d2 d3 d4) /DROP=d0 d1 d2 d3 d4. val lab group 0 adult diary 1 child diary. freq group. *check demographic variable distributions - see above note. missing values all (). freq sex age marital. desc daywt wt. recode age (sysmis=-8). ************************************************************ *the summary file included the household level identifier, * *but not an individual identifier. To match the background * *variables to the diary variables, I used a combination of * *diary variables * ************************************************************. compute tot=sum(act00 to act21) + sum(act22 to act40) + sum(act41 to act62) + sum(act63 to act79) + sum(act80 to act96) + sum(act97 to act99). freq tot. compute tmain3 = ACT45. compute tmain86 = ACT91. compute tmain20 = ACT10. compute tmain22 = ACT12 + ACT13. compute testid=0. freq tmain3 tmain86 tmain20 tmain22. sort cases by hhid tmain3 tmain86 tmain20 tmain22. if hhid=lag(hhid) and tmain3=lag(tmain3) and tmain86=lag(tmain86) and tmain20=lag(tmain20) and tmain22=lag(tmain22) testid=1. *hhid and sleep alone uniquely identify all but 216 diaries; adding *watch TV identifies all but 46 diaries; adding food preparation *allows the unique identification of all but 2 diaries; adding *cleaning allows for a unique match. freq testid. temp. select if testid=1. freq hhid. *there are 11 cases where error corrections in the diaries mean *that this match won't work in these cases. Do if hhid=269 and sex=2. recode tmain20 (105=95). Else if hhid=483 and sex=2. recode tmain86 (0=45). Else if hhid=635 and sex=1 and age=38. recode tmain3 (450=440). Else if hhid=797. recode tmain86 (155=170). Else if hhid=7068 and tmain22=10. recode tmain3 (165=560). recode tmain20 (465=70). Else if hhid=1466 and tmain3=420. compute tmain3=330. Else if hhid=1466 and tmain3=450. compute tmain3=540. recode tmain22 (60=0). recode tmain86 (60=180). Else if hhid=1547 and tmain3=195. recode tmain20 (10=25). recode tmain86 (0=120). Else if hhid=1547 and tmain3=540. recode tmain20 (15=0). recode tmain86 (120=0). Else if hhid=1161 and tmain86=60. recode tmain86 (60=120). Else if hhid=1656 and tmain3=755. compute tmain3=682. End if. sort cases by hhid tmain3 tmain86 tmain20 tmain22. *a problem of 11-year-old apparently twins with identical days (hhid=7436). *another problem (hhid=7250) of a girl 13 (wt .99, 10 more min main73) & boy aged 12 (wt .95). save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\usa85demog.sav' /keep hhid tmain3 tmain86 tmain20 tmain22 sex age group daywt wt. Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\maildiary.sav'. SORT CASES BY hhid pid. *the documentation reports 3340 mailback diaries collected *in the 1985 sample, 2921 diaries from adults and 419 diaries *from children aged 12 to 17. This basefile includes 3352 *diaries. One of these cases belongs to the personal interview *sample, but 10 other cases not from the mailback sample remain. *The personal interview sample case is excluded. Further *examination detailed below reveals that there are 7 cases of *non-diaries (1 24-hour episode of missing activity) with missing *date of diary information, and a further 6 non-diaries with *identical age/sex/martial status information as another hh *member. These cases also are removed. This leaves a baseline *number of cases 2 less than the number reported in the *documentation. *below 11 diaries identified as having odd amounts of time in the *day - these 11 are investigated here. select if (hhid=29 and pid=1) or (hhid=29 and pid=2) or (hhid=262 and pid=2) or (hhid=262 and pid=3) or (hhid=1161 and pid=1) or (hhid=1240 and pid=2) or (hhid=1466 and pid=4) or (hhid=1547 and pid=1) or (hhid=1240 and pid=4) or (hhid=1656 and pid=5) or (hhid=1161 and pid=4) or (hhid=1656 and pid=4). execute. *reading down these diaries reveals errors in the time coding of *some activities. these errors are corrected after the calculation *of the episode number variable. *also a problem with some studies having a missing value for the *method of data collection. These investigated. This investigation *finds that one household from the personal interview study was *accidentally included in this file. Also, 22 households of one of *the other types also accidentally included in this file. these are *removed later. Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\maildiary.sav'. missing values all (). sort cases by hhid pid sttime. Compute epnum=1. Do if hhid=lag(hhid) and pid=lag(pid). compute epnum=lag(epnum)+1. end if. freq epnum. *fix 14 problem diaries. *these 8 diaries have some time coding problems. One also *has a spare line. Do if hhid=29 and pid=1 and epnum=14. compute endtime=1310. Else if hhid=29 and pid=1 and epnum=15. compute endtime=1420. Else if hhid=1161 and pid=4 and sttime=1500. compute endtime=1700. Else if hhid=1656 and pid=4 and epnum=1. compute endtime=837. Else if hhid=1656 and pid=4 and endtime=955. compute sttime=845. End if. execute. Do if hhid=1656 and pid=5 and endtime=837. compute endtime=845. end if. execute. Do if hhid=177 and pid=2 and sttime=2140 and actcode=699. compute endtime=2150. Else if hhid=177 and pid=2 and sttime=2140. compute sttime=2150. Else if hhid=269 and pid=1 and sttime=835 and endtime=835. compute endtime=845. Else if hhid=269 and pid=1 and sttime=835. compute sttime=845. Else if hhid=635 and pid=1 and sttime=2300 and endtime=2300. compute endtime=2310. Else if hhid=635 and pid=1 and sttime=2300. compute sttime=2310. Else if hhid=1161 and pid=1 and sttime=1600 and endtime=1700. compute sttime=1630. compute endtime=1650. Else if hhid=1161 and pid=1 and endtime=1700. compute sttime=1650. compute endtime=1700. End if. execute. *one case of a diary with a gap not coded as a missing *gap - row added following logical bounds imposed by the *acts before and after and the activities at the same time *of other household members. *hhid=29 pid=2 from 1310 to 1600, coded as main 752 sec 439 *in family room as other family members eating meal and *socialising in family room during missing gap for which *this person cooked - also day=6 date=1229 mailwt=.7861 *mdaywt=.9070 rating 99. *in the case of these three diaries, some of one person's *diary is coded with the pid of another person, but the *timimg of the diaries show the diary rows to which these *rows really belong. Do if hhid=262 and pid=2 and (epnum=2 or epnum=11 or epnum=12 or epnum=13). compute pid=3. Else if hhid=1240 and pid=4. compute pid=2. End if. execute. *these 2 diaries have two diaries insterspersed into *a single diary. the second diary extracted from the *first diary. Do if hhid=1466 and pid=4 and (epnum=2 or epnum=4 or epnum=7 or epnum=9 or epnum=11 or epnum=12 or epnum=14 or epnum=16 or epnum=17 or epnum=22 or epnum=25 or epnum=26 or epnum=30). compute pid=5. Else if hhid=1547 and pid=1 and (epnum=2 or epnum=14 or epnum=15 or epnum=20 or epnum=23 or epnum=24 or epnum=26 or epnum=30 or epnum=33 or epnum=35). compute pid=2. End if. execute. freq pid. *reset order and episode number to reflect the corrected values. sort cases by hhid pid sttime. Compute epnum=1. freq epnum. Do if hhid=lag(hhid) and pid=lag(pid). compute epnum=lag(epnum)+1. end if. freq epnum. *create time use and diary day variables. freq date. compute year=1985. Do if date<9999. compute month=trunc (date/100). Else. compute month=-8. end if. freq year month. cro date by month. Do if date<9999. compute cday=date - (trunc(date/100)*100). Else. compute cday=-8. end if. cro date by cday. freq cday. *fix some errors in the day of week and month coding. In *these cases, the majority of episodes in the diary have *one month or day recorded, but on a limited number of *episodes, a different month of day was recorded. All these *cases were visually checked - and compared with the diaries *from other persons in the same household. We are confident *that the the month and day recorded on the majority of the *episodes are the true month and day of the diary. freq day. Do if hhid=451 and pid=3. recode month (3=2). End if. Do if hhid=652 and pid=2. recode month (2=3). End if. Do if hhid=662 and pid=1. recode month (2=3). End if. Do if hhid=670 and pid=1. recode month (2=3). End if. Do if hhid=702 and pid=2. recode month (2=3). End if. Do if hhid=731 and pid=1. recode month (2=3). End if. Do if hhid=1552 and pid=2. recode month (3=6). recode day (2=3). End if. Do if hhid=5001 and pid=2. recode month (2=3). End if. Do if hhid=5013 and pid=2. recode month (2=3). End if. Do if hhid=5014 and pid=4. recode month (2=3). End if. freq day month. freq endtime sttime. *there is one diary where the end time of the first *activity (main sleep) and start time of the next *activity, cooking, is set at 75 - creating the *appearance of 75 minutes of sleep followed by 7 *hours of cooking, which is really unlikely - the 75 *changed to 7:50 before the start and stop times are *converted to 1440 minutes. recode sttime endtime (75=750). Compute start=trunc(sttime/100)*60+(sttime-(trunc(sttime/100))*100). Compute end=trunc(endtime/100)*60+(endtime-(trunc(endtime/100))*100). Execute. temp. select if start>60 and start<250. cro start by sttime. temp. select if end>60 and end<250. cro endtime by end. desc end start. *create duration variable (I do not use the existing min *as this variable has the error arising from the 75 *misscode as well as the 8 problematic diaries. compute time=end-start. var lab time duration of activity in minutes. desc time. *note there are cases with a maximum of 1440 - investigate these. temp. select if time=1440. freq epnum. *result = 13 1 episode diaries. compute main=-5. compute sec=-5. compute inout=-5. compute eloc=-5. compute mtrav=-5. compute clockst= sttime. 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=-9. compute otherp=-9. compute unknwp=-9. compute survey=3. compute wave=1. recode day (1=2) (2=3) (3=4) (4=5) (5=6) (6=7) (7=1) (9=-8) INTO diaryday. apply dictionary from 'C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\History of harmonisation - Diary\schema\schema1.sav'. cro day by diaryday. freq survey wave. desc clockst. freq actcode act2 where. *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 where=0 or where=13 or where=70 or actcode=139 or actcode=162 or actcode=168 or actcode=171 or actcode=192 or actcode=258 or actcode=259 or actcode=876 or actcode=811 or actcode=812 or actcode=813 or actcode=814 or actcode=815 or actcode=816 or act2=822 or actcode=824 or actcode=825 or actcode=826 or actcode=876 or act2=139 or act2=162 or act2=168 or act2=171 or act2=192 or act2=258 or act2=259 or act2=876 or act2=811 or act2=812 or act2=813 or act2=814 or act2=815 or act2=816 or act2=822 or act2=824 or act2=825 or act2=826 or act2=876 or ( ( (actcode>800 and actcode<810) or (act2>800 and act2<810) ) and where=89) or ((actcode=709 or actcode=789 or act2=709 or act2=789) and where~=60). compute inout=1. Else if (where>19 and where<23) or (actcode>96 and actcode<100) or actcode=298 or actcode=299 or actcode=361 or actcode=399 or actcode=498 or actcode=499 or (actcode>596 and actcode<600) or actcode=698 or actcode=699 or actcode=799 or actcode=899 or (actcode>996 and actcode<1000) or (act2>96 and act2<100) or act2=298 or act2=299 or act2=361 or act2=399 or act2=498 or act2=499 or (act2>596 and act2<600) or act2=698 or act2=699 or act2=799 or act2=899 or (act2>996 and act2<1000). compute inout=3. Else if (where>0 and where<13) or where=14 or where=82 or where=83 or where=60 or where=90 or actcode=161 or actcode=164 or actcode=165 or actcode=166 or actcode=173 or actcode=191 or actcode=248 or actcode=249 or actcode=877 or act2=161 or act2=164 or act2=165 or act2=166 or act2=173 or act2=191 or act2=248 or act2=249 or act2=877. compute inout=2. Else. compute inout=-8. End if. freq inout. temp. select if inout=1. freq actcode act2 where. temp. select if inout=2. freq actcode act2 where. temp. select if inout=3. freq actcode act2 where. temp. select if inout=-8. freq actcode act2 where. temp. select if where=99 or where=89. freq actcode act2. Do if where<20. compute eloc=1. Else if where=40. compute eloc=2. Else if where=30. compute eloc=3. Else if where=80. compute eloc=4. Else if where=82 or where=83. compute eloc=5. Else if where=50. compute eloc=6. Else if where=81. compute eloc=7. Else if where=20 or where=21 or where=22. compute eloc=8. Else if actcode=11 or actcode=12 or actcode=13 or actcode=14 or actcode=15 or actcode=128 or actcode=129 or actcode=411 or actcode=412 or actcode=439 or act2=11 or act2=12 or act2=13 or act2=14 or act2=15 or act2=128 or act2=129 or act2=411 or act2=412 or act2=439. compute eloc=1. Else if actcode=651 or act2=651. compute eloc=7. Else if actcode=509 or actcode=519 or act2=509 or act2=519. compute eloc=4. Else if (actcode=68 or actcode=69 or actcode=78 or actcode=79 or actcode=89 or act2=68 or act2=69 or act2=78 or act2=79 or act2=89) and lag(where)=30. compute eloc=3. Else if (actcode=68 or actcode=69 or actcode=78 or actcode=79 or actcode=89 or act2=68 or act2=69 or act2=78 or act2=79 or act2=89) and lag(where)<20. compute eloc=1. Else if actcode=771 or act2=771. compute eloc=6. Else if actcode=301 or actcode=302 or actcode=311 or actcode=312 or actcode=329 or actcode=339 or actcode=341 or actcode=342 or actcode=377 or actcode=379 or act2=301 or act2=302 or act2=311 or act2=312 or act2=329 or act2=339 or act2=341 or act2=342 or act2=377 or act2=379. compute eloc=5. Else if actcode=97 or actcode=98 or actcode=99 or actcode=298 or actcode=299 or actcode=361 or actcode=399 or actcode=498 or actcode=499 or actcode=597 or actcode=598 or actcode=599 or actcode=698 or actcode=699 or actcode=799 or actcode=899 or actcode=997 or actcode=998 or actcode=999 or act2=97 or act2=98 or act2=99 or act2=298 or act2=299 or act2=361 or act2=399 or act2=498 or act2=499 or act2=597 or act2=598 or act2=599 or act2=698 or act2=699 or act2=799 or act2=899 or actcode=997 or actcode=998 or actcode=999. compute eloc=8. Else if where=99. compute eloc=-8. Else. compute eloc=9. End if. freq eloc. cro eloc by where. Do if where=21. compute mtrav=1. Else if where=20. compute mtrav=2. Else if eloc=8 and (actcode=189 or actcode=821 or actcode=822 or act2=189 or act2=821 or act2=822). compute mtrav=3. Else if eloc=8 and (actcode=824 or act2=824). compute mtrav=4. Else if eloc=8. compute mtrav=5. Else. compute mtrav=-7. End if. freq mtrav. cro mtrav by eloc where. temp. select if mtrav>2. freq actcode act2. *Note that much of the walking and cycling is hidden in the *other travel category - no obvious way to disaggragate this time. If actcode=209 or actcode=218 or actcode=248 or act2=209 or act2=218 or act2=248 infant=1. freq infant. If infant=1 or actcode=219 or actcode=221 or actcode=222 or actcode=249 or actcode=258 or actcode=259 or actcode=278 or actcode=568 or act2=219 or act2=221 or act2=222 or act2=249 or act2=258 or act2=259 or act2=278 or act2=568 child=1. freq child. If actcode=189 or actcode=826 or actcode=844 or act2=189 or act2=826 or act2=844 animal=1. freq animal. If actcode=519 or actcode=568 or actcode=569 or actcode=360 or actcode=887 or actcode=888 or actcode=311 or actcode=312 or actcode=321 or actcode=339 or actcode=351 or actcode=352 or actcode=353 or actcode=354 or actcode=341 or actcode=342 or actcode=377 or actcode=379 or actcode=709 or actcode=719 or actcode=729 or actcode=739 or actcode=749 or actcode=771 or actcode=885 or actcode=886 or actcode=258 or act2=519 or act2=568 or act2=569 or act2=360 or act2=887 or act2=888 or act2=311 or act2=312 or act2=321 or act2=339 or act2=351 or act2=352 or act2=353 or act2=354 or act2=341 or act2=342 or act2=377 or act2=379 or act2=709 or act2=719 or act2=729 or act2=739 or act2=749 or act2=771 or act2=885 or act2=886 or act2=258 or (eloc>2 and (actcode=301 or actcode=302 or act2=301 or act2=302)) shoprof=1. freq shoprof. temp. select if actcode=0 or actcode=481 or actcode=579. cro tv by where. Do if (actcode>481 and actcode<485) or (actcode>486 and actcode<490). Compute main=1. Else if actcode=459 or actcode=460. Compute main=3. Else if actcode=469. Compute main=5. Else if actcode=408 or actcode=409. Compute main=6. Else if actcode=411. Compute main=7. Else if actcode=68 or actcode=69. Compute main=8. Else if actcode=439 or actcode=448 or actcode=449. Compute main=9. Else if (actcode=11 and where>19) or (actcode=944 and where>19). Compute main=10. Else if (actcode=11 and where<20) or (actcode=944 and where<20) or actcode=12 or actcode=14 or actcode=15. Compute main=11. Else if actcode=59 or actcode=13. Compute main=12. Else if actcode=89. Compute main=13. Else if actcode=78 or actcode=79. Compute main=14. Else if actcode>21 and actcode<25. Compute main=15. Else if actcode=500 or actcode=509. Compute main=16. Else if actcode=549 or actcode=945. Compute main=17. Else if actcode=519. Compute main=18. Else if actcode=568 or actcode=569 or actcode=360 or actcode=887 or actcode=888. Compute main=19. Else if actcode=108 or actcode=109. Compute main=20. Else if actcode=118 or actcode=119. Compute main=21. Else if actcode=128 or actcode=129 or actcode=139. Compute main=22. Else if actcode=148 or actcode=149. Compute main=23. Else if actcode>160 and actcode<169. Compute main=24. Else if actcode=389 or (actcode>190 and actcode<198). Compute main=25. Else if actcode=301 or actcode=302. Compute main=26. Else if actcode=311 or actcode=312 or actcode=320. Compute main=27. Else if actcode=321 or actcode=329. Compute main=28. Else if actcode=339. Compute main=29. Else if actcode>350 and actcode<355. Compute main=30. Else if actcode=341 or actcode=342. Compute main=31. Else if actcode=377 or actcode=379. Compute main=32. Else if actcode=209. Compute main=33. Else if actcode=218 or actcode=219 or actcode=369. Compute main=34. Else if actcode=269. Compute main=35. Else if actcode=248 or actcode=249. Compute main=36. Else if actcode=221 or actcode=222. Compute main=37. Else if actcode>235 and actcode<240. Compute main=38. Else if actcode>276 and actcode<280. Compute main=39. Else if actcode=412 or (actcode>420 and actcode<425). Compute main=40. Else if actcode=978 or actcode=689. Compute main=41. Else if actcode=621 or actcode=622. Compute main=42. Else if actcode=601 or actcode=602. Compute main=43. Else if actcode=671 or actcode=672. Compute main=44. Else if actcode=661 or actcode=662. Compute main=45. Else if actcode=611 or actcode=612 or (actcode>630 and actcode<636). Compute main=46. Else if actcode>640 and actcode<645. Compute main=48. Else if actcode=651 or actcode=652. Compute main=49. Else if actcode=789. Compute main=50. Else if actcode=709. Compute main=51. Else if actcode=729. Compute main=52. Else if actcode=739. Compute main=53. Else if actcode=749. Compute main=54. Else if actcode=719. Compute main=55. Else if actcode=771 or actcode=772. Compute main=56. Else if actcode=769. Compute main=57. Else if (actcode>800 and actcode<810) or actcode=816 or actcode=823 or actcode=825 or actcode=826 or actcode=865 or (actcode>882 and actcode<887). Compute main=60. Else if actcode=821. Compute main=62. Else if actcode=824. Compute main=63. Else if actcode=817. Compute main=64. Else if actcode=258 or actcode=259 or actcode=876. Compute main=65. Else if (actcode>810 and actcode<816) or actcode=822. Compute main=66. Else if actcode=171 or actcode=173. Compute main=67. Else if actcode=189 or actcode=844. Compute main=68. Else if actcode=889. Compute main=70. Else if actcode=984. Compute main=71. Else if actcode=752 or actcode=882. Compute main=72. Else if (actcode>870 and actcode<876) or actcode=877. Compute main=73. Else if (actcode>860 and actcode<865) or actcode=866. Compute main=74. Else if actcode=851 or actcode=852 or actcode=831. Compute main=75. Else if (actcode>840 and actcode<844). Compute main=76. Else if actcode>831 and actcode<836. Compute main=77. Else if actcode=981 or actcode=982 or actcode=983 or actcode=989. Compute main=78. Else if actcode=939 or actcode=943. Compute main=81. Else if actcode=941 or actcode=942. Compute main=82. Else if actcode=949. Compute main=83. Else if actcode>926 and actcode<931. Compute main=84. Else if actcode=909 or actcode=910. Compute main=85. Else if actcode=918 or actcode=919 or actcode=920 or actcode=925. Compute main=86. Else if actcode=979 or actcode=980. Compute main=87. Else if actcode=58 or (actcode>956 and actcode<969). Compute main=88. Else if actcode>893 and actcode<899. Compute main=89. Else if actcode=499. Compute main=91. Else if actcode>96 and actcode<100. Compute main=93. Else if actcode=361 or (actcode>596 and actcode<600). Compute main=94. Else if actcode=399. Compute main=95. Else if actcode=298 or actcode=299. Compute main=96. Else if actcode=698 or actcode=699 or actcode=498. Compute main=97. Else if actcode=799 or actcode=899 or (actcode>996 and actcode<1000). Compute main=98. Else if (actcode=0 or actcode=481 or actcode=579) and tv=1. Compute main=86. Else if actcode=0 or actcode=481 or actcode=579. Compute main=-8. end if. freq main. temp. select if main<15. cro actcode by main. temp. select if main>14 and main<28. cro actcode by main. temp. select if main>27 and main<42. cro actcode by main. temp. select if main>41 and main<56. cro actcode by main. temp. select if main>55 and main<70. cro actcode by main. temp. select if main>69 and main<84. cro actcode by main. temp. select if main>83. cro actcode by main. freq act2. temp. select if (act2=0 or act2=481 or act2=579) and actcode~=91. cro actcode by tv. Do if (act2>481 and act2<485) or (act2>486 and act2<490). Compute sec=1. Else if act2=459 or act2=460. Compute sec=3. Else if act2=469. Compute sec=5. Else if act2=408 or act2=409. Compute sec=6. Else if act2=411. Compute sec=7. Else if act2=68 or act2=69. Compute sec=8. Else if act2=439 or act2=448 or act2=449. Compute sec=9. Else if (act2=11 and where>19) or (act2=944 and where>19). Compute sec=10. Else if (act2=11 and where<20) or (act2=944 and where<20) or act2=12 or act2=14 or act2=15. Compute sec=11. Else if act2=59 or act2=13. Compute sec=12. Else if act2=89. Compute sec=13. Else if act2=78 or act2=79. Compute sec=14. Else if act2>21 and act2<25. Compute sec=15. Else if act2=500 or act2=509. Compute sec=16. Else if act2=549 or act2=945. Compute sec=17. Else if act2=519. Compute sec=18. Else if act2=568 or act2=569 or act2=360 or act2=887 or act2=888. Compute sec=19. Else if act2=108 or act2=109. Compute sec=20. Else if act2=118 or act2=119. Compute sec=21. Else if act2=128 or act2=129 or act2=139. Compute sec=22. Else if act2=148 or act2=149. Compute sec=23. Else if act2>160 and act2<169. Compute sec=24. Else if act2=389 or (act2>190 and act2<198). Compute sec=25. Else if act2=301 or act2=302. Compute sec=26. Else if act2=311 or act2=312 or act2=320. Compute sec=27. Else if act2=321 or act2=329. Compute sec=28. Else if act2=339. Compute sec=29. Else if act2>350 and act2<355. Compute sec=30. Else if act2=341 or act2=342. Compute sec=31. Else if act2=377 or act2=379. Compute sec=32. Else if act2=209. Compute sec=33. Else if act2=218 or act2=219 or act2=369. Compute sec=34. Else if act2=269. Compute sec=35. Else if act2=248 or act2=249. Compute sec=36. Else if act2=221 or act2=222. Compute sec=37. Else if act2>235 and act2<240. Compute sec=38. Else if act2>276 and act2<280. Compute sec=39. Else if act2=412 or (act2>420 and act2<425). Compute sec=40. Else if act2=978 or act2=689. Compute sec=41. Else if act2=621 or act2=622. Compute sec=42. Else if act2=601 or act2=602. Compute sec=43. Else if act2=671 or act2=672. Compute sec=44. Else if act2=661 or act2=662. Compute sec=45. Else if act2=611 or act2=612 or (act2>630 and act2<636). Compute sec=46. Else if act2>640 and act2<645. Compute sec=48. Else if act2=651 or act2=652. Compute sec=49. Else if act2=789. Compute sec=50. Else if act2=709. Compute sec=51. Else if act2=729. Compute sec=52. Else if act2=739. Compute sec=53. Else if act2=749. Compute sec=54. Else if act2=719. Compute sec=55. Else if act2=771 or act2=772. Compute sec=56. Else if act2=769. Compute sec=57. Else if (act2>800 and act2<810) or act2=816 or act2=823 or act2=825 or act2=826 or act2=865 or (act2>882 and act2<887). Compute sec=60. Else if act2=821. Compute sec=62. Else if act2=824. Compute sec=63. Else if act2=817. Compute sec=64. Else if act2=258 or act2=259 or act2=876. Compute sec=65. Else if (act2>810 and act2<816) or act2=822. Compute sec=66. Else if act2=171 or act2=173. Compute sec=67. Else if act2=189 or act2=844. Compute sec=68. Else if act2=889. Compute sec=70. Else if act2=984. Compute sec=71. Else if act2=752 or act2=882. Compute sec=72. Else if (act2>870 and act2<876) or act2=877. Compute sec=73. Else if (act2>860 and act2<865) or act2=866. Compute sec=74. Else if act2=851 or act2=852 or act2=831. Compute sec=75. Else if (act2>840 and act2<844). Compute sec=76. Else if act2>831 and act2<836. Compute sec=77. Else if act2=981 or act2=982 or act2=983 or act2=989. Compute sec=78. Else if act2=939 or act2=943. Compute sec=81. Else if act2=941 or act2=942. Compute sec=82. Else if act2=949. Compute sec=83. Else if act2>926 and act2<931. Compute sec=84. Else if act2=909 or act2=910. Compute sec=85. Else if act2=918 or act2=919 or act2=920 or act2=925. Compute sec=86. Else if act2=979 or act2=980. Compute sec=87. Else if act2=58 or (act2>956 and act2<969). Compute sec=88. Else if act2>893 and act2<899. Compute sec=89. Else if act2=499. Compute sec=91. Else if act2>96 and act2<100. Compute sec=93. Else if act2=361 or (act2>596 and act2<600). Compute sec=94. Else if act2=399. Compute sec=95. Else if act2=298 or act2=299. Compute sec=96. Else if act2=698 or act2=699 or act2=498. Compute sec=97. Else if act2=799 or act2=899 or (act2>996 and act2<1000). Compute sec=98. Else if (act2=0 or act2=481 or act2=579) and tv=1 and actcode~=91. Compute sec=86. Else if act2=0 or act2=481 or act2=579. Compute sec=0. end if. freq sec. temp. select if sec<15. cro act2 by sec. temp. select if sec>14 and sec<28. cro act2 by sec. temp. select if sec>27 and sec<42. cro act2 by sec. temp. select if sec>41 and sec<56. cro act2 by sec. temp. select if sec>55 and sec<70. cro act2 by sec. temp. select if sec>69 and sec<84. cro act2 by sec. temp. select if sec>83. cro act2 by sec. temp. select if day=9. freq hhid pid epnum main. *the seven cases with unknown diary days/dates all have a *single episode record with no recorded activity. *for the heritage files, need to keep diaries of people aged *18+ separate from the diaries of children aged 12-17. The *child diaries include special codes not used in adult diaries. compute childd=0. var lab childd marker for child diary. val lab childd 0 no child only codes 1 includes child only codes. Do if actcode=194 or actcode=195 or actcode=196 or actcode=248 or actcode=369 or actcode=487 or actcode=488 or actcode=568 or actcode=597 or actcode=598 or actcode=866 or actcode=875 or actcode=876 or actcode=877 or (actcode>881 and actcode<889) or actcode=896 or actcode=943 or actcode=966 or actcode=967 or actcode=997 or actcode=998 or act2=194 or act2=195 or act2=196 or act2=248 or act2=369 or act2=487 or act2=488 or act2=568 or act2=597 or act2=598 or act2=866 or act2=875 or act2=876 or act2=877 or (act2>881 and act2<889) or act2=896 or act2=943 or act2=966 or act2=967 or act2=997 or act2=998. compute childd=1. End if. freq childd. compute homework=0. If main=17 or sec=17 homework=1. freq homework. *check if these codes really relate to the child diaries. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=hhid pid /kidcodes = MAX(childd) /hmwork = MAX(homework). *more than half of the diaries containing time coded as homework *also contain child codes, but a number of diaries include codes *for homework that do not also include child codes, so these must *be older students. *check for number of non-diaries - one activity of no information. temp. select if start=0 and end=1440. freq main hhid pid. *13 cases of non-diaries - 1 episode of no reported activity. *hhid=133 pid=1 *hhid=152 pid=2 *hhid=265 pid=1 *hhid=342 pid=2 *hhid=524 pid=5 *hhid=823 pid=1 *hhid=1036 pid=1 *hhid=1481 pid=1 *hhid=1665 pid=1 *hhid=6114 pid=1 *hhid=7269 pid=1 *hhid=7624 pid=1 *hhid=7659 pid=1. compute badcase=0. *while it appears that some households are misassigned from *other samples, but we have elected to keep all diaries with *episode information. if start=0 and end=1440 badcase=1. var lab badcase non diary. val lab badcase 0 no - include 1 bad case - remove. freq badcase. freq main. *1406 (1393 after removal of 13 non-diaries) episodes *1.7% of main activity time missing in this file before *imputation. Note that in the summary files most commonly *used in previous publications using this data, the codes *for missing time were recoded as unspecified personal *care. We first undertake other imputation and diary *management procedures before, reluctantly, adopting the *same strategy to allow for the consistent interpretation *of results using this data. vector dqcheck(3). Loop i=1 to 3. compute dqcheck(i)=0. end loop. var lab dqcheck1 "miss main, mode of transport". var lab dqcheck2 "miss main, 2nd act reported". var lab dqcheck3 "miss 20 min before/after travel". val lab dqcheck1 to dqcheck3 0 ordinary diary 1 includes pattern. freq dqcheck1 to dqcheck3. temp. Select if main=-8. freq sec. *13 cases where a secondary activity recorded but no main *activity recorded. These cases changed so that the *secondary activity becomes the main activity and the *secondary activity is set to 0 (no secondary activity). Do if main=-8 and sec>0. compute main=sec. compute sec=0. compute dqcheck2=1. End if. freq dqcheck2. temp. Select if main=-8. freq sec eloc. temp. select if eloc=8 and sec=0. freq main. *one case of main activty missing but location *travelling; several cases of location travelling *but main activity not travel and no secondary *activity. The former set to main activity imputed *travel; the latter set to secondary activity *imputed travel. Do if main=-8 and eloc=8. compute main=90. compute dqcheck1=1. End if. If main<90 and sec=0 and eloc=8 sec=90. freq main sec dqcheck1. *If the main activity is missing and the location is *valid and not at home or another home and the *previous location is valid, not travelling, and *different from the present location, the main *activity is coded to impute travel * *if the main activity is valid and not travel and *both the current and previous locations are valid *and the previous location is not travelling and the *current and previous location differ, the secondary *activity is coded as imputed travel * *if the main activity is missing and the location is *at home or another home and the previous location is *travel, main activity is coded as unknown personal *or household care * *if the main activity is missing and the previous location *is travel and the present location is valid but not at *a home, the main activity is coded as imputed out of *home activity. *data cleaning. Do if main=62 and eloc=9. compute eloc=8. compute mtrav=3. End if. If hhid=123 and pid=2 and end=1440 eloc=1. If hhid=106 and pid=1 and start=720 eloc=1. If hhid=162 and pid=4 and (start=740 or start=780) eloc=4. If hhid=179 and pid=1 and start=720 main=11. If hhid=179 and pid=1 and start=720 eloc=1. Do if hhid=lag(hhid) and pid=lag(pid). Do if main<0 and ((eloc=1 or eloc=2) and lag(eloc)=8). compute main=2. compute dqcheck3=1. Else if main<0 and eloc>2 and lag(eloc)=8. compute main=58. Else if main<0 and ((eloc>0 and eloc~=8 and lag(eloc)>0 and lag(eloc)~=8) and eloc~=lag(eloc)). compute main=90. compute dqcheck1=1. Else if (main>0 and main<90) and sec=0 and ( ((eloc>1 and eloc<6) or eloc=7) and ((lag(eloc)>1 and lag(eloc)<6) or lag(eloc)=7)) and eloc~=lag(eloc). compute sec=90. End if. End if. freq sec dqcheck1 dqcheck3. temp. select if main=-8 or main=2 or main=58 or main=90. freq main. *if main activity still missing and the location is *valid and not at home, code the main activity as *imputed activity away from home. If main<0 and eloc>2 main=58. temp. select if main=-8 or main=58. freq main. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=hhid pid /maxep = MAX(epnum). freq maxep. *unlike the 1975-76 case, all these diaries have at least *4 episodes, so that element of the 75/76 imputation code *is not used here. compute lastep=0. If epnum=maxep lastep=1. freq lastep. compute test=0. if lastep=1 and main=-8 and lag(main)>0 test=1. temp. select if test=1. freq time eloc. compute test2=0. if test=1 test2=lag(eloc). freq test2. compute prevact=0. if test=1 prevact=lag(main). freq prevact. temp. select if test=1. cro eloc by test2 by prevact. *missing episodes where people are at their own home *or another person's home doing personal care *activities before a missing last activity taking *place at home are coded as imputed sleep. * *missing episodes following time at the workplace or *a restaurant or other away from home activity are *coded as imputed time away from home. * *missing time doing activity at home which follow *domestic or voluntary work or in-home leisure are *coded as imputed personal or home care. If main=-8 and lastep=1 and (test2=1 or test2=2) and prevact<10 main=4. If main=-8 and lastep=1 and ((prevact=10 or prevact=56) or prevact>90) main=58. If main=-8 and lastep=1 and ((prevact>19 and prevact<50) or (prevact>70 and prevact<90)) main=2. temp. select if main=-8 or main=2 or main=4 or main=58. freq main. compute test=0. If epnum=1 and main=-8 test=1. freq test. temp. select if test=1. freq time eloc inout. *In 1 case the first time slot is missing, then the *diarist drove home from work, did a few things around *the house and went to sleep - this slot coded as imputed *away from home; in 3 cases where the person is at home *but outside but first activity missing, the activity is *coded as imputed personal or household care; other *cases where the first activity is missing are coded *as imputed sleep. Do If test=1 and hhid=1305 and pid=3. compute main=58. Else if test=1 and inout=1 and eloc=-8. compute eloc=1. compute main=2. Else if test=1 and inout=1. compute main=2. Else if test=1 and eloc=-8. compute main=4. compute eloc=1. Else if test=1. compute main=4. End if. temp. select if main=-8 or main=2 or main=4 or main=58. freq main. compute test=0. if hhid=lag(hhid) and pid=lag(pid) and main=-8 and lag(main)=3 test=1. temp. select if test=1. freq eloc time. *where a short gap follows sleep, the gap is recoded *as imputed personal or household care. If test=1 and eloc=-8 eloc=lag(eloc). If test=1 and time<100 main=2. temp. select if main=-8 or main=2. freq main. compute test=0. if main=-8 and maxep>3 and (lag(main)=9 or lag(main)=20 or lag(main)=21) test=1. temp. select if test=1. freq time eloc. compute test2=0. if test=1 and eloc=-8 test2=lag(eloc). freq test2. *where the time gap in a diary follows eating a *meal or food preparation of setting table/putting *away dishes and the location is missing but the *previous location is at home or at another home, *location is set to the previous location. in these *same cases and cases where the stated location is *home, main is set to unknown imputed personal or *household care. If eloc=-8 and (test2>0 and test2<3) eloc=test2. If test=1 and (test2>0 and test2<3) main=2. temp. select if main=-8 or main=2. freq main. compute test=0. if main=-8 and lag(main)=93 test=1. freq test. temp. select if test=1. freq eloc. *cases where main is missing and the previous activity *is travel to or from work, if the subsequent destination *is home, main is set to imputed personal or home care; *if the subsequent destination is work, main is set to *imputed time away from home. compute test2=0. If lag(test)=1 test2=eloc. compute ep2=epnum. compute ep3=epnum-1. AGGREGATE /OUTFILE='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\usa85nxtep.sav' /BREAK=hhid pid epnum /ep2 = max(ep3) /nextep=max(test2). match files files=* table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\usa85nxtep.sav' /BY hhid pid ep2. freq nextep. If test=1 eloc=nextep. temp. select if test=1. freq eloc. Do If test=1 and eloc=1. compute main=2. compute dqcheck3=1. Else if test=1 and eloc>1. compute main=58. End if. temp. select if main=-8 or main=2 or main=58. freq main. temp. select if main=-8. freq time. cro inout mtrav by eloc. *amend inout to reflect further corrections to eloc. If mtrav=-7 and eloc=8 mtrav=5. If inout=-8 and eloc=8 inout=3. *impute missing activity based on the surrounding activity. compute ep2=epnum-1. sort cases by survey wave hhid pid epnum. AGGREGATE /OUTFILE='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\aggr2.sav' /BREAK=hhid pid ep2 /nextact=MAX(main) /nextloc=MAX(eloc) /epnum=max(ep2). match files files=* table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\aggr2.sav' /by hhid pid epnum. freq nextloc. temp. select if eloc=-8. cro main by nextloc. freq eloc. Do if eloc=-8 and (main>0 and main<90) and nextloc~=-8 and nextloc~=8. compute eloc=nextloc. end if. freq eloc. temp. select if eloc=8 and main<90. freq sec. if main>-8 and sec=0 and eloc=8 sec=90. freq sec. temp. select if eloc=-8. cro main by nextact. cro eloc by inout. *impute eating where no main activity eating but *main activity food preparation or setting table reported. 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). freq anyeat. temp. select if anyeat=0. freq maxep main. *some really low episode diaries with missing eating. Do if anyeat=0 and (main=20 or main=21) and sec=0 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. AGGREGATE /OUTFILE='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA1985marker.SAV' /BREAK=survey wave hhid pid /dqcheck1=MAX(dqcheck1) /dqcheck2=MAX(dqcheck2) /dqcheck3=MAX(dqcheck3). save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA1985hfep.SAV' /KEEP 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 badcase childd mailwt. rename variables (hhid pid=hldid persid). save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA85withrate.SAV' /KEEP hldid persid start time epnum actcode where rating. Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA1985hfep.SAV'. freq main. *1.1% of main activity time missing in this file. sort cases by survey hhid pid. 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=-9. 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 tmiss=time. If main=8 or main=9 or main=20 or main=21 or main=56 or sec=2 or sec=8 or sec=9 or sec=20 or sec=21 or sec=56 eatdr=time. If main=3 or main=4 or main=5 or main=13 or main=78 or sec=3 or sec=5 or sec=13 or sec=78 sleep=time. If main=1 or main=2 or main=6 or main=7 or main=28 or sec=1 or sec=6 or sec=7 or sec=28 perscare=time. If (main>89 and main<99) or (main>59 and main<70) or (sec>89 and sec<99) or (sec>59 and sec<70) 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. Do repeat a=tmain1 to tmain98 /b=tsc1 to tsc98 /i=1 to 98. compute a=0. compute b=0. if main=i a=time. if main=i and ((sec>32 and sec<40) or sec=96) b=time. End repeat. 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 (tmiss to tmain98). execute. *set all variable codes which could not be constructed to -9 for *missing. recode tmain92 tsc92 (0=-9). execute. AGGREGATE /OUTFILE='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA1985hfsum.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 = SUM(tmain2) /tmain3 = SUM(tmain3) /tmain4 = SUM(tmain4) /tmain5 = SUM(tmain5) /tmain6 = SUM(tmain6) /tmain7 = SUM(tmain7) /tmain8 = SUM(tmain8) /tmain9 = SUM(tmain9) /tmain10 = SUM(tmain10) /tmain11 = SUM(tmain11) /tmain12 = SUM(tmain12) /tmain13 = SUM(tmain13) /tmain14 = SUM(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 = SUM(tmain50) /tmain51 = SUM(tmain51) /tmain52 = SUM(tmain52) /tmain53 = SUM(tmain53) /tmain54 = SUM(tmain54) /tmain55 = SUM(tmain55) /tmain56 = SUM(tmain56) /tmain57 = SUM(tmain57) /tmain58 = SUM(tmain58) /tmain60 = SUM(tmain60) /tmain62 = SUM(tmain62) /tmain63 = SUM(tmain63) /tmain64 = SUM(tmain64) /tmain65 = SUM(tmain65) /tmain66 = SUM(tmain66) /tmain67 = SUM(tmain67) /tmain68 = SUM(tmain68) /tmain70 = SUM(tmain70) /tmain71 = SUM(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 = SUM(tmain90) /tmain91 = SUM(tmain91) /tmain92 = MAX(tmain92) /tmain93 = SUM(tmain93) /tmain94 = SUM(tmain94) /tmain95 = SUM(tmain95) /tmain96 = SUM(tmain96) /tmain97 = SUM(tmain97) /tmain98 = SUM(tmain98) /tsc1 = SUM(tsc1) /tsc2 = SUM(tsc2) /tsc3 = SUM(tsc3) /tsc4 = SUM(tsc4) /tsc5 = SUM(tsc5) /tsc6 = SUM(tsc6) /tsc7 = SUM(tsc7) /tsc8 = SUM(tsc8) /tsc9 = SUM(tsc9) /tsc10= SUM(tsc10) /tsc11= SUM(tsc11) /tsc12= SUM(tsc12) /tsc13= SUM(tsc13) /tsc14= SUM(tsc14) /tsc15= SUM(tsc15) /tsc16= SUM(tsc16) /tsc17= SUM(tsc17) /tsc18= SUM(tsc18) /tsc19= SUM(tsc19) /tsc20= SUM(tsc20) /tsc21= SUM(tsc21) /tsc22= SUM(tsc22) /tsc23= SUM(tsc23) /tsc24= SUM(tsc24) /tsc25= SUM(tsc25) /tsc26= SUM(tsc26) /tsc27= SUM(tsc27) /tsc28= SUM(tsc28) /tsc29= SUM(tsc29) /tsc30= SUM(tsc30) /tsc31= SUM(tsc31) /tsc32= SUM(tsc32) /tsc33= SUM(tsc33) /tsc34= SUM(tsc34) /tsc35= SUM(tsc35) /tsc36= SUM(tsc36) /tsc37= SUM(tsc37) /tsc38= SUM(tsc38) /tsc39= SUM(tsc39) /tsc40= SUM(tsc40) /tsc41= SUM(tsc41) /tsc42= SUM(tsc42) /tsc43= SUM(tsc43) /tsc44= SUM(tsc44) /tsc45= SUM(tsc45) /tsc46= SUM(tsc46) /tsc48= SUM(tsc48) /tsc49= SUM(tsc49) /tsc50= SUM(tsc50) /tsc51= SUM(tsc51) /tsc52= SUM(tsc52) /tsc53= SUM(tsc53) /tsc54= SUM(tsc54) /tsc55= SUM(tsc55) /tsc56= SUM(tsc56) /tsc57= SUM(tsc57) /tsc58= SUM(tsc58) /tsc60= SUM(tsc60) /tsc62= SUM(tsc62) /tsc63= SUM(tsc63) /tsc64= SUM(tsc64) /tsc65= SUM(tsc65) /tsc66= SUM(tsc66) /tsc67= SUM(tsc67) /tsc68= SUM(tsc68) /tsc70= SUM(tsc70) /tsc71= SUM(tsc71) /tsc72= SUM(tsc72) /tsc73= SUM(tsc73) /tsc74= SUM(tsc74) /tsc75= SUM(tsc75) /tsc76= SUM(tsc76) /tsc77= SUM(tsc77) /tsc78= SUM(tsc78) /tsc81= SUM(tsc81) /tsc82= SUM(tsc82) /tsc83= SUM(tsc83) /tsc84= SUM(tsc84) /tsc85= SUM(tsc85) /tsc86= SUM(tsc86) /tsc87= SUM(tsc87) /tsc88= SUM(tsc88) /tsc89= SUM(tsc89) /tsc90= SUM(tsc90) /tsc91= SUM(tsc91) /tsc92= MAX(tsc92) /tsc93= SUM(tsc93) /tsc94= SUM(tsc94) /tsc95= SUM(tsc95) /tsc96= SUM(tsc96) /tsc97= SUM(tsc97) /tsc98= SUM(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 = MAX(wother) /withunk=MAX(withunk) /eatdr = SUM(eatdr) /sleep = SUM(sleep) /perscare=SUM(perscare) /mstrav= SUM(mstrav) /t1dig = SUM(t1dig) /t2dig = SUM(t2dig) /anycare=MAX(anycare) /badcase=MAX(badcase) /childd=MAX(childd) /mailwt=max(mailwt). Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA1985hfsum.sav'. *check that variables sum to 1440 in aggregated file. formats t0pcare to t2dig (f8.0). execute. freq t1dig t2dig tottime. *3352 cases - the documentation suggests that there are 3340 mailback *diaries, this is 12 more cases than expected - though there are 13 *non-diaries. *this step also revealed 11 problem cases, hhid 29 pids 1 & 2; *hhid 262 pids 2&3; hhid 1161 pid 1; hhid 1240 pid 2; hhid 1466 pid 4; *hhid 1547 pid 1; hhid 1161 pid 4; hhid 1656 pid 4. *select if t1dig<1440 or t1dig>1440 or t2dig<1440 or t2dig>1440. *execute. *these cases now addressed at the beginning of the file. 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. compute lowep=0. If numep<7 lowep=1. var lab lowep "<7 episodes". cro lowep by numep. freq lowep. 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. cro misbasic by anycare. temp. select if anycare=1 and misbasic>1. freq numep. *all carers missing 2 basic activities have a *reasonable number of episodes. compute caremflg=0. if anycare=1 and misbasic>1 and numep>9 caremflg=1. cro caremflg by anycare by misbasic. temp. select if misbasic>1. freq numep athome. if numep>14 and muchmiss=0 and misbasic=2 misbasic=1. if numep>12 and muchmiss=0 and athome>999 and misbasic=2 misbasic=1. freq misbasic. compute lowqual=0. If muchmiss=1 or lowep=1 or (misbasic>1 and caremflg=0) lowqual=1. freq diaryday lowqual. cro diaryday by badcase. *the 7 missing diary day cases are all among the 13 *non-diaries. checking the 13 non-diaries against the *original summary file reveals that these 13 cases *were not included in that summary file. They also *interfere with the match to the original summary file, *so are removed now. select if badcase=0. execute. sort cases by hhid tmain3 tmain86 tmain20 tmain22. match files files=*/in=diary files='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\usa85demog.sav' /in=origsum /by hhid tmain3 tmain86 tmain20 tmain22. cro diary by origsum. *both cases checked carefully and ok. *a problem of 11-year-old apparently twins with identical days (hhid=7436). *another problem (hhid=7250) of a girl 13 (wt .99, 10 more min main73) & boy aged 12 (wt .95). cro childd by group. *245 of the child diaries include child only codes. Child-only codes appear in 174 adult diaries, but *are not in 173 child diaries. *correct the error of 4 women coded as men. freq sex. if hhid=1407 and pid=3 sex=2. if hhid=7314 and pid=2 sex=2. if hhid=7339 and pid=2 sex=2. if hhid=7749 and pid=2 sex=2. freq sex. *some details of household composition permit lose approximation of age for *some missing cases. freq age. if hhid=36 and pid=2 age=20. if hhid=164 and pid=2 age=18. if hhid=255 and pid<3 age=40. if hhid=451 and pid=3 age=52. if hhid=522 and pid=1 age=50. if hhid=522 and pid=2 age=52. if hhid=522 and pid=3 age=30. if hhid=522 and pid=4 age=28. if hhid=522 and pid=5 age=26. if hhid=522 and pid=6 age=24. if hhid=810 and pid=2 age=40. if hhid=810 and pid=3 age=19. if hhid=810 and pid=4 age=18. if hhid=999 and pid=3 age=20. if hhid=1336 and pid=2 age=45. if hhid=1343 and pid=1 age=50. if hhid=1343 and pid=2 age=48. if hhid=1343 and pid=3 age=23. if hhid=1343 and pid=4 age=21. if hhid=1343 and pid=5 age=20. if hhid=1518 and pid=2 age=42. if hhid=1518 and pid=3 age=44. if hhid=1547 and pid=3 age=42. if hhid=1547 and pid=4 age=40. if hhid=1656 and pid=5 age=42. if hhid=7114 and pid=7 age=40. if hhid=7042 and pid=3 age=23. if hhid=7042 and pid=4 age=20. if hhid=7042 and pid=5 age=19. if hhid=7042 and pid=6 age=18. if hhid=7262 and pid=3 age=22. freq age. desc wt daywt mailwt. freq diaryday sex. weight by wt. freq diaryday sex. weight by daywt. freq diaryday sex. weight by mailwt. freq diaryday sex. weight off. *the documentation lists mailwt at the correct weight to use for the mail-back survey, but *this weight is not available for a large number of diaries.Use the "overall" weight wt. compute origwght = wt. compute owghtflg = 2. 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'. desc origwght. compute baddem=0. freq sex diaryday age. *no missing sex or diaryday. the value 99 for age is missing. temp. select if age=-8. freq group. *all missing age cases are adult diaries. if age=-8 baddem=1. means age by baddem. cro lowqual by muchmiss lowep misbasic. freq muchmiss lowep misbasic lowqual baddem caremflg. cro lowqual by baddem misbasic. cro muchmiss lowep misbasic caremflg by group. cro lowqual by group /cell=count col. cro lowqual by baddem by group. cro lowqual baddem by group. recode age (10 thru 17=1) (18 thru 19=2)(20 thru 29=3)(30 thru 39=4) (40 thru 49=5)(50 thru 59=6)(60 thru 69=7)(70 thru 98=8)(-8=9) into agegp. If lowqual=1 or baddem=1 or diaryday=-8 agegp=9. compute agesexgp=agegp+ 10*(sex-1). If sex=-8 agesexgp=19. val lab agesexgp 1 "men 10-17" 2 "men 18-19" 3 "men 20-29" 4 "men 30-39" 5 "men 40-49" 6 "men 50-59" 7 "men 60-69" 8 "men 70+" 9 "men age missing or bad diary" 11 "women 10-17" 12 "women 18-19" 13 "women 20-29" 14 "women 30-39" 15 "women 40-49" 16 "women 50-59" 17 "women 60-69" 18 "women 70+" 19 "women age missing or bad diary". fre agesexgp. compute agesexwt=daywt. *if agesexgp=1 agesexwt =(4.5/3.1). *if agesexgp=2 agesexwt =(24.5/22.5). *if agesexgp=3 agesexwt =(22.6/22.8). *if agesexgp=4 agesexwt =(15.3/13.9). *if agesexgp=5 agesexwt =(13.4/12.6). *if agesexgp=6 agesexwt =(11.3/10). *if agesexgp=7 agesexwt =(8.4/6.2). *if agesexgp eq 11 agesexwt =(4.1/4). *if agesexgp eq 12 agesexwt =(23.0/20.7). *if agesexgp eq 13 agesexwt =(21.4/21.9). *if agesexgp eq 14 agesexwt =(14.5/14.8). *if agesexgp eq 15 agesexwt =(13.0/12.2). *if agesexgp=16 agesexwt =(11.8/9.2). *if agesexgp=17 agesexwt =(12.2/8.4). sort cases by agesexgp diaryday. if lowqual=1 or baddem=1 agesexwt=0. desc agesexwt. aggregate outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\group.sav' /break=agesexgp /grouptot=sum(agesexwt). aggregate outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\day.sav' /break= agesexgp diaryday /daytot=sum(agesexwt) /dayn=nu. execute. match files file=* /table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\group.sav' /by agesexgp. execute. match files file=* /table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\day.sav' /by agesexgp diaryday. execute. compute exptot=(grouptot/7). Do if lowqual=0 and baddem=0. compute recwght=(exptot/daytot)/(dayn/daytot). compute xtimewt=(exptot/daytot)/(dayn/daytot). End if. des recwght xtimewt. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK= survey /wtsum = SUM(recwght). freq wtsum. desc recwght. compute recwght=recwght*3339/3103.44. compute xtimewt=recwght*3339/3103.44. weight by recwght. fre diaryday. cro agesexgp by diaryday /cell=row. weight off. desc recwght. temp. select if (age>-8 and age<15) and lowqual=0. freq sex. temp. select if (age>14 and age<20) and lowqual=0. freq sex. temp. select if lowqual=0. freq sex. ************************************************** * Value Label Frequency | CPS * * men 10 to 14 105 | 8525 * * men 15 to 19 155 | 4.5 9322 * * men 20 to 29 332 | 24.5 13316 * * men 30 to 39 338 | 22.6 12284 * * men 40 to 49 205 | 15.3 8316 * * men 50 to 59 185 | 13.4 7283 * * men 60 to 69 149 | 11.3 6142 * * men 70+ 91 | 8.4 4566 * * 1523 69754 * * women 10 to 14 113 | 8102 * * women 15 to 19 148 | 4.1 8928 * * women 20 to 29 358 | 23.0 14195 * * women 30 to 39 377 | 21.4 13207 * * women 40 to 49 257 | 14.5 8949 * * women 50 to 59 210 | 13.0 8023 * * women 60 to 69 160 | 11.8 7283 * * women 70+ 145 | 12.2 7529 * * 1720 76216 * **************************************************. if agesexgp<11 infltwt =recwght*45.8. if agesexgp>10 infltwt =recwght*44.3. desc infltwt. weight by infltwt. freq agesexgp diaryday. weight off. sort cases by survey wave hhid pid. Save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\addlow.sav' /keep survey wave hhid pid lowqual baddem caremflg origwght owghtflg xtimewt infltwt recwght origsum group. Save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA1985hfsum.sav' /drop eatdr sleep perscare mstrav t1dig t2dig anycare badcase childd mailwt muchmiss lowep misbasic sex age daywt wt diary origsum agegp agesexgp agesexwt grouptot daytot dayn exptot wtsum. freq group. select if group=1. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\usa1985childsum.sav' /drop eatdr sleep perscare mstrav t1dig t2dig anycare badcase childd mailwt muchmiss lowep misbasic daywt wt diary origsum agegp agesexgp agesexwt grouptot daytot dayn exptot wtsum group. Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA1985hfep.SAV'. sort cases by survey wave hhid pid. freq main. match files files=* table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\addlow.sav' /BY survey wave hhid pid. freq group. recode origsum (sysmis=0). apply dictionary from 'C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\History of harmonisation - Diary\schema\schema1.sav'. *remove non-diaries. select if origsum=1. execute. SAVE OUTFILE='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA1985hfep.sav' /drop origsum badcase childd. select if group=1. save outfile'C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\usa1985childep.sav' /drop origsum badcase childd group. *test labels and variables. Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA1985hfep.SAV'. freq group. select if group=0. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Diary\diary1985\USA1985hfep.SAV' /drop group. 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 lowqual 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\1985\usa1985childep.sav'. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1985\usa1985childep.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 lowqual 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\1985\USA1985hfsum.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 group. freq group. select if group=0. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Diary\diary1985\USA1985hfsum.sav' /drop group. 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 lowqual origwght xtimewt infltwt recwght. freq survey wave diaryday cday month year tottime numep lowqual baddem caremflg. cro lowqual by baddem. temp. select if recwght=0. cro lowqual by baddem. temp. select if recwght~=0. freq diaryday. weight by recwght. freq diaryday. weight off. get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\usa1985childsum.sav' /keep survey wave hhid pid diaryday cday month year 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 caremflg lowqual baddem caremflg origwght owghtflg xtimewt infltwt recwght sex age. 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\Supplementary files\1985\usa1985childsum.sav'. desc survey wave hhid pid diaryday cday month year 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 lowqual origwght xtimewt infltwt recwght. freq survey wave diaryday cday month year numep lowqual baddem caremflg. cro lowqual by baddem. temp. select if recwght=0. cro lowqual by baddem. temp. select if recwght~=0. freq diaryday. weight by recwght. freq diaryday. weight off. *construct extra variables for child files. get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA85quest.sav' /keep hhid pid state regionc regione urban ownhome hhtype nadult under18 under5 ageyngst nwork incomeqt ethnic hisp. sort cases by hhid pid. AGGREGATE /OUTFILE='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\kidhadd.sav' /BREAK=hhid /pidmax=MAX(pid) /state=MAX(state) /regionc=MAX(regionc) /regione=MAX(regione) /urban=MAX(urban) /ownhome=MAX(ownhome) /hhtype=MAX(hhtype) /nadult=MAX(nadult) /under18=MAX(under18) /under5=MAX(under5) /ageyngst=MAX(ageyngst) /nwork=MAX(nwork) /incomeqt=MAX(incomeqt). *note original file did not contain pid numbers for the children. get file='C:\Documents and Settings\All Users\Documents\time-use-library\USA\1985\teen.sav' /keep hhid sex age educ marital full part retired unemp student homemake other. sort cases by hhid(a) age(d). match files /file=* /table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\kidhadd.sav' /BY hhid. execute. compute ethnic=-9. compute ethnic2=-9. compute hisp=-9. *four cases in three households where there is no corresponding adult diary info *for household level variables. Take what information is availale in files, list of *pids in main files and such household variables as are available in the teen file. Do if pidmax=-5. compute hhtype=1. compute under5=0. compute state=-9. compute regionc=-9. compute regione=-9. compute ownhome=-9. End if. Do if hhid=823. compute urban=0. compute nadult=2. compute under18=1. compute nwork=1. compute incomeqt=-8. Else if hhid=1101. compute urban=1. compute nadult=2. compute under18=2. compute nwork=2. compute incomeqt=2. Else if hhid=1149. compute urban=0. compute nadult=2. compute under18=2. compute nwork=2. compute incomeqt=3. End if. freq urban. fre educ. recode educ (9=-8). compute cohab=-9. compute marrflag=-9. fre age under18 under5. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK= hhid /minage = MIN(age). compute ageyngst=-8. Do if under5>0. compute ageyngst=3. Else. compute ageyngst=minage. End if. freq ageyngst. freq hhtype. Do if (hhtype>0 and hhtype<5) or (hhtype=5 and hhid>1207). compute famstat=4. else if hhtype>4. compute famstat=5. end if. variable label FAMSTAT "Individual life cycle status". value labels FAMSTAT -8 missing 0 Adult 18 to 39, no co-resident child <18 1 Adult 18+ living with co-resident child aged <5 2 Adult 18+ living with co-resident child 5-17, no <5 3 Adult 40+ no co-resident child <18 4 child living with parents 5 child in other arrangements. freq famstat. cro age by famstat. cro hhtype by famstat. *the reason the one male-headed household with the 17-year-old is *coded separately as there are a number of young men in this household. *The other such households have young children who need care, but *this young man could be independent. Do if full=1. compute empstat=1. Else if part=1. compute empstat=2. Else. compute empstat=3. End if. var lab empstat "employment status of respondent". val lab empstat 1 'employed full-time' 2 'employed part-time' 3 'not employed' -8 'missing or dirty on the case record' -9 'could not be constructed' -3 'routed out in the 1992-94 survey'. freq empstat. cro full part by empstat. compute occup=-9. temp. select if marital>1 and marital<9. freq hhtype. compute empsp=-8. if marital>1 and marital<9 empsp=-7. var lab empsp employment status of spouse. val lab empsp -8 missing -7 no spouse 1 "full-time" 2 "part-time" 3 unknown hours of work 4 not working. freq empsp. compute civstat=marital. recode civstat (sysmis=4). execute. var label civstat "marital status". value labels civstat -9 not asked -8 missing 1 Married 2 Separated, divorced 3 Widowed 4 Never married. fre civstat. cro civstat by marital. compute fulltime=0. compute parttime=0. compute noemploy=0. if empstat=1 fulltime=1. if empstat=2 parttime=1. if empstat=3 noemploy=1. cro empstat by fulltime parttime noemploy. rename variables (homemake=homemakr). recode unemp retired student homemakr (sysmiss=-8). fre unemp retired student homemakr. compute disab=-7. compute wkhrs=-9. compute wagelm=-7. compute cohab=-9. freq cohab. AGGREGATE /OUTFILE='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\agekid.sav' /BREAK=hhid /corctage=MAX(ageyngst) /ncdiary = N. *test duplicate pids. compute test=0. if hhid=lag(hhid) and sex=lag(sex) and age=lag(age) test=1. freq test. *5 such cases, apparently twins, all information on both rows identical. sort cases by hhid age sex. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\kiddem.sav' /keep hhid state regionc regione urban ownhome hhtype nadult under18 under5 ageyngst nwork incomeqt sex age ethnic ethnic2 hisp civstat cohab famstat educ empstat fulltime parttime noemploy retired unemp student homemakr occup empsp wkhrs wagelm disab. get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1985\usa1985childsum.sav'. sort cases by hhid age sex. match files files=* files='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\kiddem.sav' /BY hhid age sex. freq age. sort cases by hhid pid. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1985\usa1985childsum.sav' /keep survey wave hhid pid diaryday cday month year 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 caremflg lowqual baddem origwght owghtflg xtimewt infltwt recwght state regionc regione urban ownhome hhtype nadult under18 under5 ageyngst nwork incomeqt sex age ethnic ethnic2 hisp civstat cohab famstat educ empstat fulltime parttime noemploy retired unemp student homemakr occup empsp wkhrs wagelm disab. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\kiddem.sav' /keep hhid pid state regionc regione urban ownhome hhtype nadult under18 under5 ageyngst nwork incomeqt sex age ethnic ethnic2 hisp civstat cohab famstat educ empstat fulltime parttime noemploy retired unemp student homemakr occup empsp wkhrs wagelm disab. get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1985\usa1985childep.sav'. sort cases by hhid pid. match files files=* table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\kiddem.sav' /BY hhid pid. freq age. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1985\usa1985childep.sav'. *amend age youngest child to reflect information from child diaries. Get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA85quest.sav'. match files files=* table='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\agekid.sav' /BY hhid. freq corctage. recode corctage (sysmis=-7). cro corctage by under18 under5. cro ncdiary by under18. Do if under5>0. compute ageyngst=3. Else if corctage>0 and ncdiary=under18. compute ageyngst=corctage. Else if under18>0. compute ageyngst=9. Else if under5=-8 and under18=-8. compute ageyngst=-8. Else. compute ageyngst=-7. End if. freq ageyngst. freq sex. if hhid=1407 and pid=3 sex=2. if hhid=7314 and pid=2 sex=2. if hhid=7339 and pid=2 sex=2. if hhid=7749 and pid=2 sex=2. freq sex. *some details of household composition permit lose approximation of age for *some missing cases. freq age. if hhid=36 and pid=2 age=20. if hhid=164 and pid=2 age=18. if hhid=255 and pid<3 age=40. if hhid=522 and pid=1 age=50. if hhid=522 and pid=2 age=52. if hhid=522 and pid=3 age=30. if hhid=522 and pid=4 age=28. if hhid=522 and pid=5 age=26. if hhid=522 and pid=6 age=24. if hhid=810 and pid=2 age=40. if hhid=810 and pid=3 age=19. if hhid=810 and pid=4 age=18. if hhid=999 and pid=3 age=20. if hhid=1336 and pid=2 age=45. if hhid=1343 and pid=1 age=50. if hhid=1343 and pid=2 age=48. if hhid=1343 and pid=3 age=23. if hhid=1343 and pid=4 age=21. if hhid=1343 and pid=5 age=20. if hhid=1518 and pid=2 age=42. if hhid=1518 and pid=3 age=44. if hhid=1547 and pid=3 age=42. if hhid=1547 and pid=4 age=40. if hhid=7114 and pid=7 age=40. if hhid=7042 and pid=3 age=23. if hhid=7042 and pid=4 age=20. if hhid=7042 and pid=5 age=19. if hhid=7042 and pid=6 age=18. if hhid=7262 and pid=3 age=22. freq age. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA85quest.sav'. get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA85quest.sav' /drop corctage ncdiary. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA85quest.sav'. get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1985\usa1985childsum.sav'. FREQUENCIES VARIABLES=survey wave diaryday cday month year numep caremflg lowqual baddem state regionc regione urban ownhome hhtype nadult under18 under5 ageyngst nwork incomeqt sex age ethnic ethnic2 hisp civstat cohab famstat educ empstat fulltime parttime noemploy retired unemp student homemakr occup empsp wkhrs wagelm disab. recode state regionc regione ownhome (sysmis=-9). recode under5 (sysmis=-8). Do if hhid=823. compute hhtype=8. compute famstat=5. Else if hhid=1101 or hhid=1149. compute hhtype=1. compute famstat=4. End if. freq hhtype famstat state regionc regione ownhome hhtype under5. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1985\usa1985childsum.sav'. get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1985\usa1985childep.sav'. FREQUENCIES VARIABLES=survey wave diaryday cday month year caremflg lowqual baddem state regionc regione urban ownhome hhtype nadult under18 under5 ageyngst nwork incomeqt sex age ethnic ethnic2 hisp civstat cohab famstat educ empstat fulltime parttime noemploy retired unemp student homemakr occup empsp wkhrs wagelm disab. recode state regionc regione ownhome (sysmis=-9). recode under5 (sysmis=-8). Do if hhid=823. compute hhtype=8. compute famstat=5. Else if hhid=1101 or hhid=1149. compute hhtype=1. compute famstat=4. End if. freq hhtype famstat state regionc regione ownhome hhtype under5. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1985\usa1985childep.sav'. **************************************************************** *Note syntax below from the initial creation of the AHTUS, when* *the MTUS used the all samples summary file. We no longer use * *this file in the MTUS * ****************************************************************. ************************************************************** *test two 1985 files to see why the our initial episode file * *produced different results to the original aggregated file. * **************************************************************. match files file='C:\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Diary\diary1985\USA1985hfsum.sav' /in=diary file='C:\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA85quest.sav' /in=quest /BY survey wave hhid pid. cro diary by quest. rename variables (diaryday lowqual baddem 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 tmiss= inepdday ineplowq inepbadd otmain1 otmain2 otmain3 otmain4 otmain5 otmain6 otmain7 otmain8 otmain9 otmain10 otmain11 otmain12 otmain13 otmain14 otmain15 otmain16 otmain17 otmain18 otmain19 otmain20 otmain21 otmain22 otmain23 otmain24 otmain25 otmain26 otmain27 otmain28 otmain29 otmain30 otmain31 otmain32 otmain33 otmain34 otmain35 otmain36 otmain37 otmain38 otmain39 otmain40 otmain41 otmain42 otmain43 otmain44 otmain45 otmain46 otmain48 otmain49 otmain50 otmain51 otmain52 otmain53 otmain54 otmain55 otmain56 otmain57 otmain58 otmain60 otmain62 otmain63 otmain64 otmain65 otmain66 otmain67 otmain68 otmain70 otmain71 otmain72 otmain73 otmain74 otmain75 otmain76 otmain77 otmain78 otmain81 otmain82 otmain83 otmain84 otmain85 otmain86 otmain87 otmain88 otmain89 otmain90 otmain91 otmain92 otmain93 otmain94 otmain95 otmain96 otmain97 otmain98 otmiss). recode wkhrs (-9 thru 0=0). sort cases by hhid age sex wkhrs. select if diary=1. save outfile='c:\kimberly\time\ATUS\1985\test85eptosum.sav' /keep survey hhid pid inepdday ineplowq inepbadd otmain1 otmain2 otmain3 otmain4 otmain5 otmain6 otmain7 otmain8 otmain9 otmain10 otmain11 otmain12 otmain13 otmain14 otmain15 otmain16 otmain17 otmain18 otmain19 otmain20 otmain21 otmain22 otmain23 otmain24 otmain25 otmain26 otmain27 otmain28 otmain29 otmain30 otmain31 otmain32 otmain33 otmain34 otmain35 otmain36 otmain37 otmain38 otmain39 otmain40 otmain41 otmain42 otmain43 otmain44 otmain45 otmain46 otmain48 otmain49 otmain50 otmain51 otmain52 otmain53 otmain54 otmain55 otmain56 otmain57 otmain58 otmain60 otmain62 otmain63 otmain64 otmain65 otmain66 otmain67 otmain68 otmain70 otmain71 otmain72 otmain73 otmain74 otmain75 otmain76 otmain77 otmain78 otmain81 otmain82 otmain83 otmain84 otmain85 otmain86 otmain87 otmain88 otmain89 otmain90 otmain91 otmain92 otmain93 otmain94 otmain95 otmain96 otmain97 otmain98 sex age wkhrs otmiss recwght. add files file='C:\Kimberly\time\AHTUS & MTUS papers\usa87.sav' file='C:\Kimberly\time\AHTUS & MTUS papers\usa85.sav'. execute. missing values all (). recode day (1=2) (2=3) (3=4) (4=5) (5=6) (6=7) (7=1) (9=-8) INTO diaryday. rename variables (respid=hhid). vector tmain(98). Do repeat a = tmain1 to tmain98. compute a=0. End repeat. compute eatdr=0. compute sleep=0. compute perscare=0. compute mstrav=0. compute anycare=0. compute lowqual=0. compute baddem=0. apply dictionary from 'c:\kimberly\time\ATUS\AHTUS final files\History of harmonisation - Diary\schema\schema2.sav'. cro day by diaryday. compute tmain1 = ACT48. compute tmain3 = ACT45. compute tmain5 = ACT46. compute tmain6 = ACT40. compute tmain7 = ACT41. compute tmain8 = ACT06. compute tmain9 = ACT43 + ACT44. compute tmain10 = ACT00. compute tmain12 = ACT05. compute tmain13 = ACT08. compute tmain14 = ACT07. compute tmain15 = ACT02. compute tmain16 = ACT50. compute tmain17 = ACT54. compute tmain18 = ACT51. compute tmain19 = ACT56. compute tmain20 = ACT10. compute tmain21 = ACT11. compute tmain22 = ACT12 + ACT13. compute tmain23 = ACT14. compute tmain24 = ACT16. compute tmain25 = ACT19 + ACT38. compute tmain26 = ACT30. compute tmain27 = ACT31. compute tmain28 = ACT32. compute tmain29 = ACT33. compute tmain30 = ACT35. compute tmain31 = ACT34. compute tmain32 = ACT37. compute tmain33 = ACT20. compute tmain34 = ACT21. compute tmain35 = ACT26. compute tmain36 = ACT24. compute tmain37 = ACT22. compute tmain38 = ACT23. compute tmain39 = ACT27. compute tmain40 = ACT42. compute tmain41 = ACT68. compute tmain42 = ACT62. compute tmain43 = ACT60. compute tmain44 = ACT67. compute tmain45 = ACT66. compute tmain46 = ACT61 + ACT63. compute tmain48 = ACT64. compute tmain49 = ACT65. compute tmain50 = ACT78. compute tmain51 = ACT70. compute tmain52 = ACT72. compute tmain53 = ACT73. compute tmain54 = ACT74. compute tmain55 = ACT71. compute tmain56 = ACT77. compute tmain57 = ACT76. compute tmain60 = ACT80 + ACT82. compute tmain65 = ACT25. compute tmain66 = ACT81. compute tmain67 = ACT17. compute tmain70 = ACT88. compute tmain72 = ACT75. compute tmain73 = ACT87. compute tmain74 = ACT86. compute tmain75 = ACT85. compute tmain76 = ACT84. compute tmain77 = ACT83. compute tmain78 = ACT98. compute tmain81 = ACT93. compute tmain82 = ACT94. compute tmain83 = ACT95. compute tmain84 = ACT92. compute tmain85 = ACT90. compute tmain86 = ACT91. compute tmain87 = ACT97. compute tmain88 = ACT58 + ACT96. compute tmain91 = ACT49. compute tmain93 = ACT09. compute tmain94 = ACT59. compute tmain95 = ACT39. compute tmain96 = ACT29. compute tmain97 = ACT69. compute tmain98 = ACT79 + ACT89 + ACT99. compute tottime=sum(tmain1 to tmain98). des tmain1 to tmain98, tottime. compute eatdr= tmain8 + tmain9 + tmain56. compute sleep = tmain3 + tmain4 + tmain5 + tmain78. compute perscare= tmain1 + tmain2 + tmain6 + tmain7. compute mstrav= tmain91 + tmain93 + tmain94 + tmain95 + tmain96 + tmain97 + tmain98. compute anycare= SUM(tmain33 to tmain40). recode anycare (1 thru high=1). freq eatdr sleep perscare mstrav anycare. compute ncats=0. do repeat a= act00 to act21 /b= act22 to act40 /c= act41 to act62 /d= act63 to act79 /e= act80 to act96. if a>0 ncats=ncats+1. if b>0 ncats=ncats+1. if c>0 ncats=ncats+1. if d>0 ncats=ncats+1. if e>0 ncats=ncats+1. end repeat. if act97>0 ncats=ncats+1. if act98>0 ncats=ncats+1. if act99>0 ncats=ncats+1. var lab ncats number of activity original categories in diary. freq ncats. 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. compute lowep=0. If ncats<6 lowep=1. var lab lowep "<7 episodes". cro lowep by ncats. freq lowep. 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. cro misbasic by anycare ncats. temp. select if anycare=1 and misbasic>1. freq ncats. compute caremflg=0. if anycare=1 and misbasic>1 and ncats>7 caremflg=1. freq caremflg. *are some cases where no eating reported, but where *food preparation or setting/clearing table reported, *and these may be diaries where the eating is a *secondary activity during the food prep or table setting. temp. select if eatdr=0. freq tmain20 tmain21. if eatdr=0 and (tmain20>0 or tmain21>0) misbasic=misbasic-1. freq misbasic. compute lowqual=0. If muchmiss=1 or lowep=1 or (misbasic>1 and caremflg=0) lowqual=1. freq diaryday lowqual age sex. recode age (99=-8). if diaryday=-8 or sex=-8 or age=-8 baddem=1. freq baddem. cro baddem by diaryday age sex. recode tmain2 tmain4 tmain11 tmain58 tmain62 tmain63 tmain64 tmain68 tmain71 tmain89 tmain90 tmain92 (0=-9). recode wkhrs (-9=0). sort cases by hhid age sex wkhrs. match file files=*/in=J files='c:\kimberly\time\ATUS\1985\test85eptosum.sav'/in=AHTUS /by hhid age sex wkhrs. cro j by AHTUS. freq otmiss. temp. select if AHTUS=1. desc tmain1 otmain1 tmain2 otmain2 tmain3 otmain3 tmain4 otmain4 tmain5 otmain5. temp. select if AHTUS=1. desc tmain6 otmain6 tmain7 otmain7 tmain8 otmain8 tmain9 otmain9 tmain10 otmain10. temp. select if AHTUS=1. desc tmain11 otmain11 tmain12 otmain12 tmain13 otmain13 tmain14 otmain14 tmain15 otmain15. temp. select if AHTUS=1. desc tmain16 otmain16 tmain17 otmain17 tmain18 otmain18 tmain19 otmain19 tmain20 otmain20. temp. select if AHTUS=1. desc tmain21 otmain21 tmain22 otmain22 tmain23 otmain23 tmain24 otmain24 tmain25 otmain25. temp. select if AHTUS=1. desc tmain26 otmain26 tmain27 otmain27 tmain28 otmain28 tmain29 otmain29 tmain30 otmain30. temp. select if AHTUS=1. desc tmain31 otmain31 tmain32 otmain32 tmain33 otmain33 tmain34 otmain34 tmain35 otmain35. temp. select if AHTUS=1. desc tmain36 otmain36 tmain37 otmain37 tmain38 otmain38 tmain39 otmain39 tmain40 otmain40. temp. select if AHTUS=1. desc tmain41 otmain41 tmain42 otmain42 tmain43 otmain43 tmain44 otmain44 tmain45 otmain45. temp. select if AHTUS=1. desc tmain46 otmain46 tmain48 otmain48 tmain49 otmain49 tmain50 otmain50. temp. select if AHTUS=1. desc tmain51 otmain51 tmain52 otmain52 tmain53 otmain53 tmain54 otmain54 tmain55 otmain55. temp. select if AHTUS=1. desc tmain56 otmain56 tmain57 otmain57 tmain58 otmain58 tmain60 otmain60. temp. select if AHTUS=1. desc tmain62 otmain62 tmain63 otmain63 tmain64 otmain64 tmain65 otmain65. temp. select if AHTUS=1. desc tmain66 otmain66 tmain67 otmain67 tmain68 otmain68 tmain70 otmain70. temp. select if AHTUS=1. desc tmain71 otmain71 tmain72 otmain72 tmain73 otmain73 tmain74 otmain74 tmain75 otmain75. temp. select if AHTUS=1. desc tmain76 otmain76 tmain77 otmain77 tmain78 otmain78. temp. select if AHTUS=1. desc tmain81 otmain81 tmain82 otmain82 tmain83 otmain83 tmain84 otmain84 tmain85 otmain85. temp. select if AHTUS=1. desc tmain86 otmain86 tmain87 otmain87 tmain88 otmain88 tmain89 otmain89 tmain90 otmain90. temp. select if AHTUS=1. desc tmain91 otmain91 tmain92 otmain92 tmain93 otmain93 tmain94 otmain94 tmain95 otmain95. temp. select if AHTUS=1. desc tmain96 otmain96 tmain97 otmain97 tmain98 otmain98. cro tmain1 by otmain1. cro diaryday by inepdday. cro lowqual by ineplowq. compute sameday=0. if tmain1~=otmain1 sameday=sameday+1. if tmain3~=otmain3 sameday=sameday+1. if tmain5~=otmain5 sameday=sameday+1. if tmain6~=otmain6 sameday=sameday+1. if tmain7~=otmain7 sameday=sameday+1. if tmain8~=otmain8 sameday=sameday+1. if tmain9~=otmain9 sameday=sameday+1. if tmain10~=otmain10 sameday=sameday+1. if tmain12~=otmain12 sameday=sameday+1. if tmain13~=otmain13 sameday=sameday+1. if tmain14~=otmain14 sameday=sameday+1. if tmain15~=otmain15 sameday=sameday+1. if tmain16~=otmain16 sameday=sameday+1. if tmain17~=otmain17 sameday=sameday+1. if tmain18~=otmain18 sameday=sameday+1. if tmain19~=otmain19 sameday=sameday+1. if tmain20~=otmain20 sameday=sameday+1. if tmain21~=otmain21 sameday=sameday+1. if tmain22~=otmain22 sameday=sameday+1. if tmain23~=otmain23 sameday=sameday+1. if tmain24~=otmain24 sameday=sameday+1. if tmain25~=otmain25 sameday=sameday+1. if tmain26~=otmain26 sameday=sameday+1. if tmain27~=otmain27 sameday=sameday+1. if tmain28~=otmain28 sameday=sameday+1. if tmain29~=otmain29 sameday=sameday+1. if tmain30~=otmain30 sameday=sameday+1. if tmain31~=otmain31 sameday=sameday+1. if tmain32~=otmain32 sameday=sameday+1. if tmain33~=otmain33 sameday=sameday+1. if tmain34~=otmain34 sameday=sameday+1. if tmain35~=otmain35 sameday=sameday+1. if tmain36~=otmain36 sameday=sameday+1. if tmain37~=otmain37 sameday=sameday+1. if tmain38~=otmain38 sameday=sameday+1. if tmain39~=otmain39 sameday=sameday+1. if tmain40~=otmain40 sameday=sameday+1. if tmain41~=otmain41 sameday=sameday+1. if tmain42~=otmain42 sameday=sameday+1. if tmain43~=otmain43 sameday=sameday+1. if tmain44~=otmain44 sameday=sameday+1. if tmain45~=otmain45 sameday=sameday+1. if tmain46~=otmain46 sameday=sameday+1. if tmain48~=otmain48 sameday=sameday+1. if tmain49~=otmain49 sameday=sameday+1. if tmain50~=otmain50 sameday=sameday+1. if tmain51~=otmain51 sameday=sameday+1. if tmain52~=otmain52 sameday=sameday+1. if tmain53~=otmain53 sameday=sameday+1. if tmain54~=otmain54 sameday=sameday+1. if tmain55~=otmain55 sameday=sameday+1. if tmain56~=otmain56 sameday=sameday+1. if tmain57~=otmain57 sameday=sameday+1. if tmain60~=otmain60 sameday=sameday+1. if tmain65~=otmain65 sameday=sameday+1. if tmain66~=otmain66 sameday=sameday+1. if tmain67~=otmain67 sameday=sameday+1. if tmain70~=otmain70 sameday=sameday+1. if tmain72~=otmain72 sameday=sameday+1. if tmain73~=otmain73 sameday=sameday+1. if tmain74~=otmain74 sameday=sameday+1. if tmain75~=otmain75 sameday=sameday+1. if tmain76~=otmain76 sameday=sameday+1. if tmain77~=otmain77 sameday=sameday+1. if tmain78~=otmain78 sameday=sameday+1. if tmain81~=otmain81 sameday=sameday+1. if tmain82~=otmain82 sameday=sameday+1. if tmain83~=otmain83 sameday=sameday+1. if tmain84~=otmain84 sameday=sameday+1. if tmain85~=otmain85 sameday=sameday+1. if tmain86~=otmain86 sameday=sameday+1. if tmain87~=otmain87 sameday=sameday+1. if tmain88~=otmain88 sameday=sameday+1. if tmain91~=otmain91 sameday=sameday+1. if tmain93~=otmain93 sameday=sameday+1. if tmain94~=otmain94 sameday=sameday+1. if tmain95~=otmain95 sameday=sameday+1. if tmain96~=otmain96 sameday=sameday+1. if tmain97~=otmain97 sameday=sameday+1. if tmain98~=otmain98 sameday=sameday+1. *-9 both: t92 *not create in JR File - t90, t89, t71, t68, * t62, t63, t64, t58, t11, t4, t2 *identical timing in both files t53, t54, t55, * t42, t43, t44, t45, t35, t29, t30, t18. val lab sameday 0 both diaries identical. If j=1 and ahtus=0 sameday=-7. freq sameday. compute paid=0. compute paid1=tmain10 + sum(tmain12 to tmain15) + tmain93. compute paid2=sum(otmain10 to otmain15) + otmain93. var lab paid1 paid work from John R file. var lab paid2 paid work from new file. means paid1 paid2 by sex. weight by wt. means paid1 paid2 by sex. weight by recwght. means paid1 paid2 by sex. weight off. compute unpaid=0. compute unpaid1=sum(tmain20 to tmain40) + tmain91 + tmain95 + tmain96. compute unpaid2=sum(otmain20 to otmain40) + otmain91 + otmain95 + otmain96. var lab unpaid1 unpaid work from John R file. var lab unpaid2 unpaid work from new file. means unpaid1 unpaid2 by sex. weight by wt. means unpaid1 unpaid2 by sex. weight by recwght. means unpaid1 unpaid2 by sex. weight off. temp. select if sameday<2. means paid1 paid2 unpaid1 unpaid2 by sex. temp. select if sameday>7. means paid1 paid2 unpaid1 unpaid2 by sex. *men do more paid work than women and women more unpaid work than men where *sameday=0-3; 5-6; but above sameday=7 (where the records between the original *aggregated file and the new file) differ in more than 7 variables, men appear *to do more unpaid work than women and women more paid work than men. Investigate *these diaries more carefully. aggregate /outfile='c:\kimberly\time\ATUS\1985\aggr.sav' /BREAK=hhid /maxsame=max(sameday). sort cases by hhid pid. match files files=* table='c:\kimberly\time\ATUS\1985\aggr.sav' /BY hhid. execute. freq maxsame. select if maxsame=-7 or maxsame>5. freq marital. aggregate outfile='c:\kimberly\time\ATUS\1985\usa85check.sav' /BREAK=hhid /nhhcase=n. match files files=* table='c:\kimberly\time\ATUS\1985\usa85check.sav' /BY hhid. cro nhhcase by marital. sort cases by nhhcase hhid pid sameday. save outfile='c:\kimberly\time\ATUS\1985\usa85check.sav' /keep hhid pid sameday sex age wkhrs marital age wkhrs j ahtus tmain1 otmain1 tmain2 otmain2 tmain3 otmain3 tmain4 otmain4 tmain5 otmain5 tmain6 otmain6 tmain7 otmain7 tmain8 otmain8 tmain9 otmain9 tmain10 otmain10 tmain11 otmain11 tmain12 otmain12 tmain13 otmain13 tmain14 otmain14 tmain15 otmain15 tmain16 otmain16 tmain17 otmain17 tmain18 otmain18 tmain19 otmain19 tmain20 otmain20 tmain21 otmain21 tmain22 otmain22 tmain23 otmain23 tmain24 otmain24 tmain25 otmain25 tmain26 otmain26 tmain27 otmain27 tmain28 otmain28 tmain29 otmain29 tmain30 otmain30 tmain31 otmain31 tmain32 otmain32 tmain33 otmain33 tmain34 otmain34 tmain35 otmain35 tmain36 otmain36 tmain37 otmain37 tmain38 otmain38 tmain39 otmain39 tmain40 otmain40 tmain41 otmain41 tmain42 otmain42 tmain43 otmain43 tmain44 otmain44 tmain45 otmain45 tmain46 otmain46 tmain48 otmain48 tmain49 otmain49 tmain50 otmain50 tmain51 otmain51 tmain52 otmain52 tmain53 otmain53 tmain54 otmain54 tmain55 otmain55 tmain56 otmain56 tmain57 otmain57 tmain58 otmain58 tmain60 otmain60 tmain62 otmain62 tmain63 otmain63 tmain64 otmain64 tmain65 otmain65 tmain66 otmain66 tmain67 otmain67 tmain68 otmain68 tmain70 otmain70 tmain71 otmain71 tmain72 otmain72 tmain73 otmain73 tmain74 otmain74 tmain75 otmain75 tmain76 otmain76 tmain77 otmain77 tmain78 otmain78 tmain81 otmain81 tmain82 otmain82 tmain83 otmain83 tmain84 otmain84 tmain85 otmain85 tmain86 otmain86 tmain87 otmain87 tmain88 otmain88 tmain89 otmain89 tmain90 otmain90 tmain91 otmain91 tmain92 otmain92 tmain93 otmain93 tmain94 otmain94 tmain95 otmain95 tmain96 otmain96 tmain97 otmain97 tmain98 otmain98 lowqual baddem tottime ncats inepdday ineplowq inepbadd recwght paid1 paid2 unpaid1 unpaid2 nhhcase year nwork day diaryday htype under5 under18 income educ full part retired unemp student homemake other rururb daywt wt. get file='c:\kimberly\time\ATUS\1985\usa85check.sav'. recode pid (sysmis=-9). freq j ahtus. temp. select if pid=-9. freq J ahtus. temp. select if pid=-9. desc hhid. sort cases by hhid pid. *the 845 cases in Jonathan Gershuny's original aggregated 1985 files from John *Robinson but not in the base episode file supplied by Timothy Tripplet are in *household where there is no potential overlapping of pids and hhids, so delete *these cases now. select if AHTUS=1. *some cases simply look like one or more people in the household happened *to do activities which are moved in disaggregation from the 3 digit codes *or where we reassigned an activity from John Robinson's original assumption *or resulting from data cleaning. execute. *in many of these households, diaries in the episode file are *swapped with members of the same household. Some diaries show minor *variations, mainly from the data cleaning I undertook but the team *who created the original aggregated file did not undertake, and also *from some disaggregation possible from the 3 digit codes and not *possible in the 2 digit codes (such as splitting walking and cycling *out from other outside exercise. The upshot here is that the codes *in the original data labelled as missing or unreported main activity *are in the original aggregated file coded as general personal care time, *and the various imputations we made for the missing time. Thus we deem *cases with some variation to be acceptable - but cases with variation *on more than 5 variables seems to indicate swapping, which can be *tracked by comparing where the time signature appears in the original *aggregated file and the summary file derived from the episode file. *add in the corrections of pids (see end of this syntax file). *this is necessary as the original summary files did not *keep person identifier, just household identifier, and not *all pids matched correctly to some individuals within a *selection of households. *correct adults whose pids are swapped to child only codes, also *correct additional diaries where person number swapped within *households and some doubt about the sample of some household *members appeared in initial looks at these files. Do if hhid=6072. recode pid (1=2) (2=1). End if. Do if hhid=549. recode pid (1=2) (2=3) (3=1) (4=4) (5=5). End if. execute. Do if hhid=34 or hhid=164 or hhid=371 or hhid=7238. recode pid (1=2) (2=1). Else if hhid=146. recode pid (1=1) (2=3) (3=2). End if. execute. Do if hhid=148 or hhid=474 or hhid=6087. recode pid (2=2) (1=3) (3=1). *household 152 has a non-diary from person 1, but *possible this diary was misallocated. Else if hhid=152. recode pid (1=3) (3=1). Else if hhid=632 or hhid=668 or hhid=1510 or hhid=1712. recode pid (1=1) (2=3) (3=2). Else if hhid=7733. recode pid (2=3) (3=2). Else if hhid=7055 or hhid=7651. recode pid (1=4) (4=1). Else if hhid=195. recode pid (1=1) (3=3) (2=6) (6=2). Else if hhid=749. recode pid (1=1) (3=3) (2=4) (4=2). Else if hhid=794. recode pid (3=3) (2=4) (4=2). Else if hhid=1032 or hhid=1254 or hhid=1735 or hhid=6130 or hhid=7598 or hhid=7672. recode pid (1=1) (2=2) (3=4) (4=3). Else if hhid=1037 or hhid=1171 or hhid=6068 or hhid=7375. recode pid (1=1) (2=3) (3=2). Else if hhid=1582 or hhid=6003. recode pid (1=1) (3=3) (2=4) (4=2). End if. Do if hhid=1481 or hhid=1665. recode pid (1=2) (2=3) (3=1). End if. execute. Do if hhid=7314 or hhid=7607. recode pid (1=2) (2=3) (3=4) (4=1). End if. Do if hhid=7494. recode pid (1=3) (2=1) (3=2) (4=4). End if. *(1=3) and (2=4) confirmed; other two not confirmed; *1 of these returned a non-diary (24 hours of no *activity). Do if hhid=7624. recode pid (1=3) (2=4) (3=1) (4=2). End if. Do if hhid=149. recode pid (1=5) (2=1) (3=2) (4=4) (5=3). End if. Do if hhid=505. recode pid (1=3) (2=4) (3=2) (4=1). End if. Do if hhid=539. recode pid (1=3) (2=1) (3=4) (4=2). End if. Do if hhid=1301. recode pid (1=2) (2=1) (4=5) (5=4). End if. Do if hhid=1407. recode pid (1=1) (2=2) (3=3) (4=5) (5=4). End if. Do if hhid=1496. recode pid (1=1) (2=3) (3=2) (4=4). End if. Do if hhid=1499. recode pid (1=1) (2=2) (3=5) (4=4) (5=3). End if. Do if hhid=1549. recode pid (1=3) (2=4) (3=2) (4=1) (5=5). End if. execute. *1=3 and 2=4 confirmed - recheck other codings if ever possible. Do if hhid=6014. recode pid (1=3) (2=5) (3=1) (4=4) (5=2). End if. Do if hhid=7280. recode pid (1=1) (2=2) (3=3) (4=5) (5=4). End if. Do if hhid=7638. recode pid (1=1) (2=2) (3=5) (4=4) (5=3). End if. Do if hhid=688. recode pid (1=2) (2=3) (3=4) (4=5) (5=1). End if. *1 & 2 look like child diaries, but could not verify if *have the right pids; 3 correctly changed to 4, but 4 also *could be 1 oe 2. Do if hhid=1261. recode pid (1=1) (2=2) (3=4) (4=3). End if. *could only verify one change (2=1), double check others is possible. Do if hhid=1395. recode pid (1=2) (2=1) (3=3) (4=4) (5=5). End if. Do if hhid=1466. recode pid (1=5) (2=1) (3=2) (4=3) (5=4). End if. Do if hhid=7545. recode pid (1=2) (2=1) (3=3) (4=5) (5=4). End if. *these are largely unverified - only one diary *available for comparison - may need to check again. Do if hhid=1547. recode pid (1=2) (2=1) (3=3) (4=4). End if. *only (1=1) (2=7) (3=5) verified; may need to *relook at rest of household. Do if hhid=6056. recode pid (1=1) (2=7) (3=5) (4=4) (5=3) (6=6) (7=2). End if. execute. *could only verify (3=1) - may need to look again at household. Do if hhid=6180. recode pid (1=3) (2=2) (3=1) (4=4). End if. Do if hhid=7594. recode pid (1=7) (2=6) (3=1) (4=2) (5=5) (6=3) (7=4). End if. *only (4=3) checked; may need to revisit household. Do if hhid=425. recode pid (1=1) (2=2) (3=4) (4=3) (5=5). End if. Do if hhid=193 or hhid=7274 or hhid=7316 or hhid=7704. recode pid (1=3) (2=1) (3=2). End if. Do if hhid=41 or hhid=233 or hhid=935 or hhid=1151 or hhid=7117 or hhid=162. recode pid (1=2) (2=3) (3=1). End if. Do if hhid=289. recode pid (1=4) (2=3) (3=2) (4=1). End if. Do if hhid=309 or hhid=7290. recode pid (1=3) (2=1) (3=4) (4=2). End if. Do if hhid=517. recode pid (1=3) (2=4) (3=1) (4=2). End if. Do if hhid=7000 or hhid=7090. recode pid (1=1) (2=4) (3=2) (4=3). End if. Do if hhid=7259. recode pid (2=3) (3=4) (4=2). End if. Do if hhid=7519. recode pid (1=3) (2=4) (3=2) (4=1). End if. Do if hhid=7615. recode pid (1=2) (2=4) (3=3) (4=1). End if. Do if hhid=6074. recode pid (1=5) (2=4) (3=3) (4=2) (5=1). End if. Do if hhid=7161. recode pid (1=3) (2=1) (3=2) (4=4) (5=5). End if. Do if hhid=7190. recode pid (1=2) (2=1) (3=5) (4=4) (5=3). End if. Do if hhid=7496. recode pid (2=3) (3=2) (4=5) (5=4). End if. execute. *could not verify 5 & 6. Do if hhid=154. recode pid (1=4) (2=3) (3=2) (4=1) (5=5) (6=6). End if. Do if hhid=171. recode pid (1=3) (2=5) (3=4) (4=2) (5=1). End if. Do if hhid=227. recode pid (1=2) (2=3) (3=4) (4=1) (5=5) (6=6). End if. execute. Do if hhid=8 or hhid=18 or hhid=19 or hhid=56 or hhid=115 or hhid=131 or hhid=134 or hhid=163 or hhid=204 or hhid=211 or hhid=217 or hhid=218 or hhid=237 or hhid=257 or hhid=264 or hhid=264 or hhid=279 or hhid=280 or hhid=284 or hhid=296 or hhid=297 or hhid=305 or hhid=324 or hhid=363 or hhid=388 or hhid=392 or hhid=399 or hhid=417 or hhid=420 or hhid=428 or hhid=434 or hhid=443 or hhid=451 or hhid=453 or hhid=469 or hhid=484 or hhid=511 or hhid=512 or hhid=521 or hhid=540 or hhid=541 or hhid=574 or hhid=576 or hhid=614 or hhid=632 or hhid=667 or hhid=670 or hhid=682 or hhid=684 or hhid=701 or hhid=716 or hhid=720 or hhid=749 or hhid=767 or hhid=786 or hhid=869 or hhid=904 or hhid=916 or hhid=932 or hhid=942 or hhid=956 or hhid=983 or hhid=1024 or hhid=1026 or hhid=1058 or hhid=1118 or hhid=1157 or hhid=1163 or hhid=1185 or hhid=1270 or hhid=1315 or hhid=1334 or hhid=1335 or hhid=1438 or hhid=1468 or hhid=1491 or hhid=1510 or hhid=1519 or hhid=1545 or hhid=1582 or hhid=1595 or hhid=1596 or hhid=1627 or hhid=1628 or hhid=1632 or hhid=1634 or hhid=1645 or hhid=1683 or hhid=1700 or hhid=1722 or hhid=5007 or hhid=5008 or hhid=5013 or hhid=6023 or hhid=6027 or hhid=6051 or hhid=6057 or hhid=6079 or hhid=6156 or hhid=7003 or hhid=7004 or hhid=7073 or hhid=7078 or hhid=7082 or hhid=7083 or hhid=7085 or hhid=7113 or hhid=7115 or hhid=7127 or hhid=7138 or hhid=7151 or hhid=7152 or hhid=7180 or hhid=7181 or hhid=7186 or hhid=7217 or hhid=7275 or hhid=7292 or hhid=7307 or hhid=7318 or hhid=7328 or hhid=7348 or hhid=7359 or hhid=7371 or hhid=7374 or hhid=7375 or hhid=7378 or hhid=7384 or hhid=7393 or hhid=7408 or hhid=7410 or hhid=7413 or hhid=7420 or hhid=7449 or hhid=7472 or hhid=7481 or hhid=7482 or hhid=7490 or hhid=7507 or hhid=7517 or hhid=7558 or hhid=7570 or hhid=7590 or hhid=7599 or hhid=7621 or hhid=7689 or hhid=7701 or hhid=7718 or hhid=7740 or hhid=7741 or hhid=7757. recode pid (1=2) (2=1). Else if hhid=161 or hhid=418 or hhid=829 or hhid=1303 or hhid=7096. recode pid (1=3) (3=1). Else if hhid=563 or hhid=1208 or hhid=1234 or hhid=1479 or hhid=5001 or hhid=6003 or hhid=6018 or hhid=7015 or hhid=7131 or hhid=7441. recode pid (2=3) (3=2). Else if hhid=7135 or hhid=7352. recode pid (3=4) (4=3). End if. execute. sort cases by hhid pid. AGGREGATE /OUTFILE='c:\kimberly\time\ATUS\1985\usa85check.sav' /BREAK=hhid pid /method = MAX(method) /anymis = MIN(method) /sex = MAX(sex) /marital = MAX(marital) /age = MAX(age) /ncase=n /mailwt=MAX(mailwt) /mdaywt=MAX(mdaywt). AGGREGATE /OUTFILE='c:\kimberly\time\ATUS\1985\usa85check2.sav' /BREAK=hhid /hhmeth = MAX(method). get file='c:\kimberly\time\ATUS\1985\usa85check.sav'. cro method by anymis. freq sex marital age. match files files=* table='c:\kimberly\time\ATUS\1985\usa85check2.sav' /BY hhid. cro hhmeth by method anymis. *no help to identify the sample of people whose sample *group is listed as unknown. Get file='c:\kimberly\time\ATUS\1985\usa85checkchild.sav'. freq sex childm age. cro childm by sex. temp. select if childm=1. freq age. *The child diary codes marker does produce the *correct number of child diaries (419) - and 2919 *diaries contain no child codes - 2 less than the *reported number of adult diaries - though it is *possible both that two diaries are missing or *that two non-diaries previously were counted. *nevertheless, a number of the supposedly child *diaries contain apparently adult demographic *information, and the child diaries partly, but do *not completely overlap the missing age and sex *information - though this issue may also reflect *mismatching of pids within the same household *in the adult diaries - and the result seen by *someone checking this syntax at a future point *may have already been corrected in the pid *reassignment just before the computation of the *child marker earlier in this code. AGGREGATE outfile='c:\kimberly\time\ATUS\1985\nkiddiary.sav' /BREAK hhid /ncdiary=SUM(childm) /ndiary=n. match files files=* table='c:\kimberly\time\ATUS\1985\nkiddiary.sav' /BY hhid. var lab ncdiary number of child diaries. var lab ndiary number of diaries. freq ncdiary ndiary. compute nadult=ndiary-ncdiary. var lab nadult number of adult diaries. freq nadult. *note that there are 42 peculiar cases from 30 households *where there seems to be no adult diary from the household. sort cases by ncdiary(d) hhid pid. compute nowght=0. if mailwt=-8 nowght=1. var lab nowght no weight in orginal data. val lab nowght 0 weight in orig 1 no weight. freq nowght. cro nowght by childm. *2691 cases have an original sample weight and no child codes; *244 have child codes and no sample weight - not problems here - *BUT 229 have no child codes and no weight, and 175 have child *codes and a weight. compute baddem=0. If sex=-8 or age=-8 baddem=1. freq baddem. cro sex by age. *all 473 cases missing a value for sex also are missing a *value for age. cro nowght by childm by baddem. * *BADDEM CHILDM marker for child diary Total * 0 no child 1 includes child * codes codes *0 Valid age and sex * NOWGHT * 0 - no weight 0 0 0 * in orginal data * 1 - weight in 2519 163 2682 * original data * * Total 2519 163 2682 * *1 Missing age or sex * NOWGHT * 0 - no weight 163 19 182 * in orginal data * 1 - weight in 237 237 474 * original data * * Total 400 256 656 *. *note that future reruns of this syntax may no longer produce *this result once the pid reallocation before the coding of *the child codes has been included - but these results will be *replicated if that pid reassignment is not run. compute badflag=0. If baddem=1 and childm=1 badflag=1. sort cases by hhid pid. If mailwt=-8 mailwt= hhwtmax. temp. select if baddem=1 and childm=0. desc mailwt. temp. select if baddem=1 and childm=0 and mailwt=-8. freq childm. *26 cases that have bad demographics and no child codes *have no weight assigned in the household - these cases *also are added to the supplementary file not used with *with the main file. if baddem=1 and childm=0 and mailwt=-8 badflag=1. freq badflag. *after constructing the full heritage file for the *1985 survey, I read through the diaries of the remaining *persons whose diaries include child diary codes and who *have valid demographic details. These people cluster into *four groups: (a) people whose diary days look like the *days of adults and whose demographic details look plausible *for the nature of the day they recorded and where there is *a possibility that a child only code reflects the diarist's *time interacting with a child; (b) people whose diary entry *could reflect the diary day of a person of any age except *a very young child or very infirm person; c) people who *undertook some form of study on the diary day, but whose *daily pattern appear to be taking university, night school, *or adult education courses; and people who record a diary *entry that covers study at regular school, travel to school *and or homework at timings that correspond to attending *regular high school classes, though these people have *apparently a much older age profile. This fourth group is *later added to the child file as we assume that these *diarists are teens and that the demographic data may be *mismatched. Timothy Tripplet from the original survey team *has advised us that such mismatching likely occurred. save outfile='c:\kimberly\time\ATUS\1985\usa85checkchild.sav' /drop marital hhwtmax ncdiary ndiary nadult nowght. *check prevalence of secondary activities. get file='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\ATUS\1985\USA1985hfep.sav'. compute anysec=0. compute sectime=0. compute secep=0. compute seccc=0. compute seccctm=0. compute secccep=0. Do If sec>0. compute anysec=1. compute sectime= time. compute secep=1. End if. Do If (sec>32 and sec<40) or sec=96 or sec=99. compute seccc=1. compute seccctm= time. compute secccep=1. End if. freq anysec secep seccc secccep. desc sectime seccctm.