**************************************************** **Syntax producing the USA heritage time use files** **1975-1976 ** **written by Dr. Kimberly Fisher ** **Institute for Social and Economic Research ** **University of Essex, Wivenhoe Park Colchester ** **United Kingdom ** **11 April 2006, updated 20 May 2010, further ** **amendments 18 March 2012 ** ****************************************************. ***************************************************** *Part 4 - final adjustments * *****************************************************. **************************************************** * create combined spouse/main respondent files * ****************************************************. *save a subset of the household level variables. note that in *this case, famstat is like a household level variable as this *condition applies equally to both members of the couple. Get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA75_76quest.sav' /keep survey wave hhid state regionc regione urban ownhome famstat hhtype nadult under18 under5 ageyngst nkidflag incomeqt income75. aggregate outfile='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\usa75_76allhh.sav' /break wave hhid /state=MAX(state) /regionc=MAX(regionc) /regione=MAX(regione) /urban=MAX(urban) /ownhome=MAX(ownhome) /famstat=MAX(famstat) /hhtype=MAX(hhtype) /nadult=MAX(nadult) /under18=MAX(under18) /under5=MAX(under5) /ageyngst=MAX(ageyngst) /nkidflag= MAX(nkidflag) /incomeqt=MAX(incomeqt) /income75=MAX(income75). get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\usa75_76allhh.sav'. sort cases by hhid wave. *save a second subset of the person-level variables with a parallel in the spouse files. get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975hfsum.sav'. Get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA75_76quest.sav' /keep survey wave hhid pid age sex educ civstat cohab empstat unemp retired disab student wkhrs wagelm. match files files=* files='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975hfsum.sav' /drop origwght owghtflg xtimewt infltwt recwght /BY survey wave hhid pid. execute. match files files=* files='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975allweights.sav' /BY wave hhid pid. execute. add files files=* files='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975spousehfsum.sav'. execute. recode spouse (sysmis=0). val lab spouse 0 main respondent diary 1 spouse diary. freq spouse. sort cases by hhid. AGGREGATE /OUTFILE=* mode=addvariables /BREAK=hhid /couple = MAX(spouse). var lab couple couple household marker. val lab couple 0 individual 1 couple. freq couple. if spouse=1 age=agesp. val lab age -8 missing. freq age. if spouse=1 sex=sexsp. val lab sex 1 man 2 woman. freq sex. if spouse=1 educ= educsp. val lab educ -8 missing 1 0-8th grade 2 9-11th grade 3 high school graduate 4 some college 5 college graduate 6 post college. freq educ. if spouse=1 wkhrs= wkhrsp. val lab wkhrs -8 missing -7 not applicable. freq wkhrs. means wkhrs by empstat /cells=min median max. freq empstat empstsp. recode empstsp (sysmis=-7). AGGREGATE /OUTFILE=* mode=addvariables /BREAK=wave hhid /empsp = MAX(empstsp) /empmrsp = MAX(empstat). recode empstat (3=4) (else=copy). val lab empstat -8 missing 1 full-time hours 2 part-time hours 3 working, hrs unknown 4 not working. if spouse=1 empstat=empstsp. freq empstat. sort cases by wave hhid pid. cro empsp by couple spouse. recode empmrsp (3=4). if spouse=1 empsp=empmrsp. if couple=1 and spouse=0 and empsp=-7 empsp=-8. recode empsp (sysmis=-8). val lab empsp -8 missing -7 no spouse 1 full time 2 part time 3 working, hours unknown 4 not working. cro empsp by couple spouse. cro empsp by empstat. if spouse=1 unemp=unempsp. val lab unemp -8 missing 0 no 1 yes. freq unemp. do if disrtsp=1 and (age>0 and age<60). compute retired=0. compute disab=1. else if disrtsp=1 and age>59. compute retired=1. compute disab=0. else if disrtsp=0. compute retired=0. compute disab=0. else if disrtsp=-9. compute retired=-9. compute disab=-9. end if. val lab retired disab -9 not asked that wave -8 missing 0 no 1 yes. recode retired disab (sysmis=-8). freq retired disab. if spouse=1 student=students. val lab student -9 not asked -8 missing 0 no 1 yes. freq student. if spouse=1 wagelm= mwagesp. recode wagelm (sysmis=-8). freq wagelm. sort cases by survey wave hhid. match files files=* table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\usa75_76allhh.sav' /BY wave hhid. execute. sort cases by survey hhid pid wave. *check that variation in famstat by wave preserved - cases with change hhid 314, 443, 466, *591, 686, 688, 812, 927, 1170, 1337, 1369, 1464. sort cases by survey wave hhid pid. recode civstat (sysmis=1). if civstat=-8 and couple=1 civstat=1. freq civstat. freq state. recode state to income75 (sysmis=-8). freq state. *one diary from a spouse where only the spouse returned information. *hhid=335. This case was missed out in the original AHTUS conversion, *original file checked, and this cases is in Georgia. if hhid=335 state=11. freq state. cro famstat by ageyngst. *some incorrectly coded famstat cases - fix. compute test=0. if age>39 and famstat=0 test=1. if age<40 and famstat=3 test=1. freq test. if test=1 and age<40 famstat=0. if test=1 and age>39 famstat=3. save outfile='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975withspousehfsum.sav' /keep survey wave hhid pid spouse couple 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 outside inside inveh locunk athome atwrksc elsewhr lunk walone wchild wsppart wclsfam wother withunk lowqual baddem caremflg orgallwt allrecwt allinfwt couplewt age sex educ civstat empstat empsp unemp retired disab student wkhrs wagelm state regionc regione urban ownhome famstat hhtype nadult under18 under5 ageyngst nkidflag incomeqt income75. save outfile='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\semp.sav' /keep survey wave hhid pid empsp. save outfile='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975withspouseaddvars.sav' /keep survey wave hhid pid spouse couple orgallwt allrecwt allinfwt couplewt age sex educ civstat empstat empsp unemp retired disab student wkhrs wagelm state regionc regione urban ownhome famstat hhtype nadult under18 under5 ageyngst nkidflag incomeqt income75. get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975withspousehfsum.sav'. sort cases by hhid wave. get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\semp.sav'. get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975withspousehfsum.sav'. freq survey wave spouse couple diaryday cday month year tottime numep lowqual baddem caremflg age sex educ civstat empstat empsp unemp retired disab student wkhrs state regionc regione urban ownhome famstat hhtype nadult under18 under5 ageyngst nkidflag incomeqt income75. FREQUENCIES VARIABLES=hhid pid 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 outside inside inveh locunk athome atwrksc elsewhr lunk walone wchild wsppart wclsfam wother withunk /FORMAT=NOTABLE /STATISTICS=MEAN MEDIAN /ORDER=ANALYSIS. Get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975hfep.sav' /drop origwght xtimewt infltwt recwght. match files files=* table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975allweights.sav' /BY wave hhid pid. execute. add files files=* files='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975spousehfep.sav' /drop agesp sexsp educsp wkhrsp empstsp unempsp disrtsp students mwagesp spouse maxep. execute. sort cases by survey wave hhid pid. match files files=* table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975withspouseaddvars.sav' /BY survey wave hhid pid. execute. recode couplewt (sysmis=-5). execute. temp. select if couplewt=-5. freq start end time clockst cday month. *again these are non-diary cases. select if couplewt>-5. save outfile='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975withspousehfep.sav' /keep survey wave hhid pid spouse couple 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 baddem caremflg orgallwt allrecwt allinfwt couplewt age sex educ civstat empstat empsp unemp retired disab student wkhrs wagelm state regionc regione urban ownhome famstat hhtype nadult under18 under5 ageyngst nkidflag incomeqt income75. ************************************************************* *add spouse employment status variable to questionnaire file* *************************************************************. *only rerun if changing this file again - otherwise completed. *get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA75_76quest.sav'. * *compute occup=-9. *var lab occup occupation. *val lab occup *-9 not asked in study *-8 item missing *-7 not working *1 management *2 finance & accounts *3 "science (life, physical, social)" *4 engineer, technical & architecture *5 community & social services *6 legal professions *7 education *8 health professionals *9 other professionals *10 health care support *11 protective services *12 sales *13 office support, administration *14 farming, fishing, forestry *15 services *16 construction & production *17 "self-employed non-professional". * *match files files=* * file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\semp.sav' * /by survey wave hhid pid. *freq empsp. * *val lab empsp * -8 missing * -7 no spouse * 1 full time * 2 part time * 3 working, hours unknown * 4 not working. * *select if pid<2000. * *save outfile='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Questionnaire\USA75_76quest.sav' * /keep survey wave hhid pid state regionc regione urban * ownhome age sex ethnic ethnic2 hisp educ civstat cohab * marrflag famstat hhtype kidflag nadult under18 under5 * ageyngst nkidflag fulltime parttime noemploy empstat * occup unemp retired empsp disab student homemakr wkhrs * nwork empflag wkhrflag wagelm incomeqt income65 * income75 income03. ********************************* * check spouse supplement files * *********************************. get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975withspousehfep.sav'. recode spouse (sysmis=-99). compute test=0. if spouse=-99 and wave=lag(wave) and hhid=lag(hhid) and pid=lag(pid) test=1. freq test. *some non-participation rows retained, remove these. *select if spouse>-99. desc hhid pid time clockst start end epnum age wagelm orgallwt allrecwt allinfwt couplewt. freq survey wave spouse couple diaryday cday month year main sec inout eloc mtrav alone infant child sppart clsfam hhadult animal shoprof cowork wellknw otherp unknwp lowqual baddem caremflg sex educ civstat empstat empsp unemp retired disab student wkhrs state regionc regione urban ownhome famstat hhtype nadult under18 under5 ageyngst nkidflag incomeqt income75. FREQUENCIES VARIABLES=hhid pid time clockst start end wagelm /FORMAT=NOTABLE /STATISTICS=MINIMUM MAXIMUM MEDIAN /ORDER=ANALYSIS. SAVE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1975-76\USA1975withspousehfep.sav' /drop test. get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\1975\USA1975withspousehfsum.sav'. desc hhid pid numep t0pcare t1paid t2ed t3unpaid t4acvol t5outhm t6exerc t7inhm t8media t9trav tmiss to tmain72. desc tmain73 to tmain98 outside inside inveh locunk athome atwrksc elsewhr lunk walone wchild wsppart wclsfam wother withunk orgallwt allrecwt allinfwt couplewt age wagelm. freq survey wave spouse couple diaryday cday month year lowqual baddem caremflg sex educ civstat empstat empsp unemp retired disab student wkhrs state regionc regione urban ownhome famstat hhtype nadult under18 under5 ageyngst nkidflag incomeqt income75. SAVE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\ATUS\AHTUS final files\Harmonised files\Supplementary files\1975-76\USA1975withspousehfsum.sav'.