* Encoding: UTF-8. ********************************************************** *SYNTAX TO CREATE FRANCE 1998-99 episode file, & region * *& ethnicity supplement, updated 4 March 2016 * *Kimberly Fisher, CTUR, University of Oxford * * * *originally written by Fernando De Maio and Kimberly * *Fisher Institute for Social and Economic Research Univ * *of Essex, Wivenhoe Park, Colchester 8 February 2006 * **********************************************************. *merging of original datasets. **sorting the individual-level dataset**. get file='D:\MTUS-archive\France\1998\sourcefiles\edtind98\edtind98_2.sav'. freq excar nblic debc finc. *15441 - 75.8 have diary booklet; 4929 - 24.2% have no diary booklet. select if(excar = 1). execute. sort cases by ident (a) no (a). save outfile='D:\MTUS-archive\France\1998\sourcefiles\edtind98\edtind98_3.sav'. **sorting the household-level dataset**. get file='D:\MTUS-archive\France\1998\sourcefiles\edtmen98\edtmen98_2.sav'. sort cases by ident (a). save outfile='D:\MTUS-archive\France\1998\sourcefiles\edtmen98\edtmen98_2.sav'. **sorting the time diary dataset**. get file='D:\MTUS-archive\France\1998\sourcefiles\act98b\act98_2.sav'. sort cases by ident (a) no (a). freq no. *this confirms that there are 15441 diaries. save outfile='D:\MTUS-archive\France\1998\sourcefiles\act98b\act98_2.sav'. **merge files - 1st step**. match files table='D:\MTUS-archive\France\1998\sourcefiles\edtmen98\edtmen98_2.sav' file='D:\MTUS-archive\France\1998\sourcefiles\edtind98\edtind98_3.sav' /by ident. execute. **merge files - 2nd step**. match files file=* file='D:\MTUS-archive\France\1998\sourcefiles\act98b\act98_2.sav' /by ident no. execute. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\interim.sav'. get file='D:\MTUS-archive\France\1998\sourcefiles\edtind98\edtind98_2.sav'. freq age. *all ages recorded in the individual file. compute kid=0. if (age < 18) kid=1. means age by kid /cells=min max. means age by excar /cells=min max mean. *most of the people without a diary are the young people who were not asked to complete the *diary, but there are some older people who should have completed diaries, but did not do so. temp. select if excar=0 and age>14. freq age. *1021 such cases. *create spouse + parent id markers, but there are errors in the *base file while spouse markers are not correctly assigned. freq no. *1 case with a missing person number value. *look at this case - this person is the older child in a couple and children household. *the missing case is person number 3. recode no (sysmis=3). sort cases by ident (a) no (a). *check how the ident0 variable calculated (answer is ident*100 +no) *and also check that noc variable indeed marks another household *member's person number and does not duplicate the respondent number. compute test=0. if no=noc test=1. compute test1=1. compute test2=ident*100+no. if test2=ident0 test1=0. freq test test1. *the only case flagged by test1 is the case of the missing no. *105 cases have the same person number and person number of the spouse. temp. select if test=1. freq lien viecou. recode viecou (sysmis=-9). temp. select if test=1. cro lien by viecou. *103 cases are the reference person of the spouse or the reference person. *2 are children of the reference person. compute test1=0. if viecou=-9 and test=1 test=3. freq test. *the two children should not have a spouse number. recode noc (sysmis=-9). if viecou=-9 and test=3 noc=-9. if viecou=-9 and test=3 test=0. cro noc no by test. *all these cases have no and noc values of 1 & 2. cro no by noc by viecou. cro no by noc by lien. *4 people have no reply to couple but have a noc code. *some peculiar inconsistencies. cro viecou by lien. means age by viecou /cells min max. *viecou - in couple - is consistent with lien - relation to hh reference person. *65 cases which are not the reference person but in a couple. temp. select if lien>2 and viecou=1. cro no by noc. *these other cases look very odd and full of errors. temp. select if (lien=1 or lien=2) and viecou=1. cro no by noc. *more odd errors. compute test1=0. if lien>2 and viecou=1 test1=1. freq test1. cro test1 by matri. temp. select if test1=1 and matri=2. freq ident. *enough inconsistency to examine this case by case. *fix one error noted. If ident=9307089270 and no=4 lien=3. *construct alternative variables to create partner id. compute p1=0. compute p2=0. var lab p1 'person numbers of first couple'. var lab p2 'person numbers of 2nd couple'. Do if lien=2. compute p1=no. Else if lien=1 and viecou=1. compute p1=no. Else if viecou=1 and (ident=1101004280 or ident=2102011890 or ident=2105044010 or ident=5303027430 or ident=7202012350 or ident=7207047420 or ident=7208051250 or ident=7303020040 or ident=7304021070 or ident=7304025650 or ident=7401001130 or ident=7401001910 or ident=8202026770 or ident=8302006980 or ident=8306017780 or ident=9301003850 or ident=9308093350). compute p2=no. Else if test1=1. compute viecou=2. End if. freq p1 p2. cro p1 p2 by no viecou. *already know from mean of age by viecou that only the people missing information *are those people too young to have been asked to complete a diary. compute civstat=viecou. recode civstat (-9=-7). recode matri (sysmis=-5). cro civstat by viecou matri. *look at matri=1 (single) and civstat=1 1298 cases; *and at matri=2 (married) and civstat=2 91 cases *and 395 cases of couples who are divorced or widowed. compute test=0. compute test1=0. compute test2=0. if matri=1 and civstat=1 test=1. if matri=2 and civstat=2 test1=1. if matri>2 and civstat=1 test2=1. freq test test1 test2. cro p1 p2 by test test1 test2. *matri=1 or >2 & viecou=1 (test=1 & test2=1) are cohabitting couple. Do if civstat=-7. compute cohab=-7. Else if civstat=1 and test=1 or test2=1. compute cohab=1. Else. compute cohab=0. End if. cro cohab by civstat test test2. *now look at the test1=1 cases of people with matri=2 (married) but not in couple. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=ident /no_max=MAX(no). temp. select if test1=1. freq age noc lien no_max. *all adults, only 2 originally had a partner marker code. *84 cases are the reference person. These cases all have no person coded as *the spouse of the reference person in the house. 47 in 1-person households. temp. select if test1=1. cro lien by no_max. *remove the cases that are clearly errors. Look at the remaining cases. If no_max=1 test1=0. freq test1. *the majority of these cases are single parents. recode nop nom (sysmis=-5). cro nop nom by lien. compute test=0. if lien=3 or lien=4 test=1. cro nop by nom by test. compute test1=0. compute test2=0. if test=1 and nop=-5 and nom=-5 and lien=3 test1=1. if test=1 and nop=-5 and nom=-5 and lien=4 test2=1. freq test1 test2. *one too many parents of the reference person + 134 cases of child or grandchild of *ref person but not indication of the parents. cro test1 test2 by lien. If ident=3107056720 and no=1 nom=3. If ident=3107056720 and no=3 lien=5. freq lien. Do if ident=8306017780 and (no=3 or no=4). compute nop=1. compute nom=2. Else if ident=8306017780 and (no=5 or no=6). compute nop=3. compute nom=4. End if. if ident=9104027120 and no=4 nom=3. if ident=2102011890 and no>1 nom=1. if ident=2102012800 and no=5 nom=2. freq nop nom. Do if ident=2308043820 and no=1. compute nom=3. Else if ident=2308043820 and no=3. compute lien=5. Else if ident=2308043820 and no=4. compute lien=3. compute nop=1. compute nom=2. End if. freq nom nop. *a small number of errors amended for the grandchildren. compute parntid1=-7. compute parntid2=-7. if nom>0 parntid1=nom. if nop>0 parntid2=nop. if nom=-5 and nop=-5 and test1=1 parntid1=1. cro nom by parntid1. cro nop by parntid2. compute spref=0. if lien=2 spref=1. *at this point, the extra couples are a problem, make two variables. compute p1a=p1. recode p1a (0=99). compute p2a=p2. recode p2a (0=99). AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=ident /p1min=MIN(p1a) /p1max=MAX(p1) /p2min=MIN(p2a) /p2max=MAX(p2) /sprefinhh=MAX(spref). freq p1min p1max p2min p2max sprefinhh. if nom=-5 and nop=-5 and sprefinhh=1 and test1=1 parntid2=2. Do if parntid1=-7 and parntid2>-7. compute parntid1=parntid2. compute parntid2=-7. End if. cro nom by parntid1. cro nop by parntid2. cro parntid1 parntid2 by lien. compute cphome=0. if civstat=2 and parntid1>0 cphome=1. cro cphome by civstat parntid1. compute kidage=125. if age<18 or (age>17 and parntid1>0) kidage=age. means kidage by kid /cells = min max mean. Do if civstat=2 or civstat=-7. compute partid=-7. Else if civstat=1. Do if p2>0 and no=p2max. compute partid=p2min. Else if p2>0 and no=p2min. compute partid=p2max. Else if p1>0 and no=p1min. compute partid=p1max. Else if p1>0 and no=p1max. compute partid=p1min. Else. compute partid=-8. end if. end if. freq partid. cro partid by civstat noc. recode lien (1=1) (2=2) (3=3) (4=9) (5=4) (6=9) (7 thru 9=10) into relrefp. fre relrefp. cro relrefp by lien civstat. recode occupa sal7 (sysmis=-5). compute empstat=-5. do if occupa=4. compute empstat=3. else if occupa>1. compute empstat=4. else if occupa=1 and sal7=1. compute empstat=1. else if occupa=1 and sal7=2. compute empstat=2. else if occupa=1. compute empstat=3. else. compute empstat=-8. end if. fre empstat. cro empstat by occupa sal7 excar. means age by empstat /cells=min max mean. *identify single parents. do repeat a=md1 to md10. compute a=0. End repeat. if age<30 and (parntid1=1 or parntid2=1) md1=1. if age<30 and (parntid1=2 or parntid2=2) md2=2. if age<30 and (parntid1=3 or parntid2=3) md3=3. if age<30 and (parntid1=4 or parntid2=4) md4=4. if age<30 and (parntid1=5 or parntid2=5) md5=5. if age<30 and (parntid1=6 or parntid2=6) md6=6. if age<30 and (parntid1=7 or parntid2=7) md7=7. if age<30 and (parntid1=8 or parntid2=8) md8=8. if age<30 and (parntid1=9 or parntid2=9) md9=9. if age<30 and (parntid1=10 or parntid2=10) md10=10. freq md1 to md10. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=ident /momdad1=MAX(md1) /momdad2=MAX(md2) /momdad3=MAX(md3) /momdad4=MAX(md4) /momdad5=MAX(md5) /momdad6=MAX(md6) /momdad8=MAX(md8) /momdad10=MAX(md10). compute singpar=0. if civstat=2 and no=momdad1 singpar=1. if civstat=2 and no=momdad2 singpar=1. if civstat=2 and no=momdad3 singpar=1. if civstat=2 and no=momdad4 singpar=1. if civstat=2 and no=momdad5 singpar=1. if civstat=2 and no=momdad6 singpar=1. if civstat=2 and no=momdad8 singpar=1. if civstat=2 and no=momdad10 singpar=1. freq singpar. sort cases by ident (a) no (a). aggregate /outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\hhadd.sav' /break=ident /agekid2 = min(kidage) /nkids "no children aged <18 in hh" = sum(kid) /hhldsiz1'sum of cases'=n /hhldsiz2 'max person no'=max(no). compute spid=no. compute empsp=empstat. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\empsp.sav' /keep ident no spid civstat empsp. select if(excar = 1). execute. aggregate /outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\indadd.sav' /break=ident no /partid = max(partid) /parntid1 = max(parntid1) /parntid2 = max(parntid2) /civstat = max(civstat) /cohab = max(cohab) /cphome = max(cphome) /relrefp = max (relrefp) /empstat = max (empstat) /singpar= max(singpar). get file='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\empsp.sav'. select if civstat=1. rename variables (spid=partid). freq civstat. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\empsp.sav' /drop no civstat. *now put together file for construction of the mtus. match files table='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\hhadd.sav' file='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\interim.sav' /by ident. execute. match files files=* files='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\indadd.sav' /by ident no. execute. sort cases by ident partid. match files files=* table='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\empsp.sav' /by ident partid. recode empsp (sysmis=-7). cro empstat civstat by empsp. sort cases by ident no. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\interim.sav'. new file. get file='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\interim.sav'. *515 cases where both partners noted on household grid but one did not complete a diary. *********************** *set up mtus variables* ***********************. string country (A2). compute country = 'FR'. freq country. compute survey = 1998. compute swave=0. compute msamp=0. compute hldid = ident. compute persid = no. compute id = 1. compute cday=-5. compute day=-5. compute month=-5. compute year=-5. compute diary = 1. compute badcase = 0. compute hhtype=-5. compute agekidx=-5. compute incorig=-5. compute income=-5. compute ownhome=log4. compute urban=-5. compute computer=-5. compute vehicle=-5. compute sex=sexe. compute famstat=-5. compute citizen=-5. compute emp=-5. compute unemp=-5. compute student=-5. compute retired=-5. compute workhrs=-5. compute empinclm=-5. compute isco1=-5. compute sector=-5. compute edcat=-5. compute rushed=-5. compute health=-5. compute carer=-5. compute disab=-5. apply dictionary from 'C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\MTUS database\schema&etc\MTUSHAFschema.sav'. ****************************** *create demographic variables* ******************************. freq survey swave msamp diary ownhome. desc id persid hldid. freq djc jours. recode jours djc (sysmis=0). do if jours>100 and jours<9999. compute cday = trunc(jours/100). else if djc>0. compute cday = trunc(djc/10000). else. compute cday=-8. end if. freq cday. cro jours by cday. recode jourc (1=2) (2=3) (3=4) (4=5) (5=6) (6=7) (7=1) (sysmis=-8) into day. cro day by jourc. freq day. recode jours djc (sysmis=0). do if jours>100 and jours<9999. compute month = jours - trunc(jours/100)*100. else if djc>0. compute month = trunc(djc/100) - trunc(djc/10000)*100. else. compute month=-8. end if. cro jours by month. freq month. do if djc>0. compute year= djc - trunc(djc/100)*100. compute year=year+1900. else. compute year=-8. end if. freq year. compute hhtype= typmena. recode hhtype (3 thru 5 = 3) (6=4) (7=4) (sysmis=-8). fre hhtype. cro hhtype by typmena hhldsiz2. *some errors for people with hhtype=2 but 3+ members. compute cmark=0. if civstat=1 cmark=1. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=ident /cmark2=MAX(cmark). cro civstat hhtype by cmark2. Do if (hhtype=2 or hhtype=3) and cmark2=0. compute hhtype=4. Else if hhtype=2 and cmark2=1 and hhldsiz2>2. compute hhtype=3. Else if hhtype=4 and cmark2=1 and hhldsiz2=2. compute hhtype=2. Else if hhtype=4 and cmark2=1 and hhldsiz2>2. compute hhtype=3. end if. cro hhtype by cmark2 hhldsiz2. cro hhldsiz1 by hhldsiz2. rename variables (hhldsiz1=hhldsize). cro hhldsize by nind. freq hhldsize. compute nchild= nkids. recode agekid2 (125=-7) (60 thru 99=60). execute. recode agekid2 (-7=-7) (0 thru 4=1) (5 thru 12=2) (13 thru 17=3) (18 thru high=4) into agekidx. freq agekidx agekid2. means agekid2 by agekidx /cells=min max mean. cro agekidx by nchild. cro hhtype by nchild agekidx. Do if hhtype<3 and agekidx=4. compute agekidx=-7. compute agekid2=-7. compute parntid1=-7. compute parntid2=-7. End if. cro hhtype by agekidx parntid1 parntid2. cro revcor by revtot. compute incorig=revcor. var lab incorig 'original household income'. val lab incorig 1 "<3500" 2 "3500-7000" 3 "7000-10,000" 4 "10,000-14,000" 5 "14,000-17,500" 6 "17,500-21,000" 7 "21,000-35,000" 8 "35,000-50,000" 9 "50,000+" 99 "doesn't know". fre incorig. recode incorig (0 thru 2 = 1) (3 thru 5 = 2) (6 thru 9 = 3) (99=-8) into income. cro income by incorig. do if strate=1. compute urban = 2. else if strate >1. compute urban = 1. else. compute urban = -8. end if. fre urban. cro urban by strate. recode log604 log605 log611 log612 log612n (sysmis=-8). freq log604 log605 log611 log612 log612n. Do if log604=1 or log605=1. compute computer=1. Else if log604=2 and log605=2. compute computer=0. Else. compute computer=-8. End if. freq computer. cro computer by log604 log605. compute vehicle=0. Do if log612n>1. compute vehicle=4. Else if log612n=1 or log611=1 or log612=1. compute vehicle=3. Else if log612n=-8 or log611=-8 or log612=-8. compute vehicle=-8. End if. freq vehicle. cro vehicle by log611 log612 log612n. recode age (90 thru high=90). freq age. Do if age>17 and age<40 and nchild=0. compute famstat=0. Else if age>17 & agekidx=1. compute famstat=1. Else if age>17 and (agekidx>1 and agekidx<4). compute famstat=2. Else if age>39 and nchild=0. compute famstat=3. Else if age<18 and (parntid1>0 or parntid2>0). compute famstat=4. Else if age<18. compute famstat=5. Else. compute famstat=-8. End if. freq famstat. cro famstat by nchild agekidx. means age agekid2 by famstat /cells min max. recode natio (sysmis=999). Do if natio=1 or natio=2. compute citizen=1. Else if natio>9 and natio<999. compute citizen=0. Else if pnais=1. compute citizen=1. Else. compute citizen=-8. End if. freq citizen. cro natio pnais by citizen. recode empstat (1 thru 3=1) (4=0) (else=-8) into emp. cro emp by empstat. recode occupa (2=1) (1=0) (3 thru 8 =0)(else = -8) into unemp. recode occupa (5 thru 6 = 1) (1 thru 4 = 0) (7 thru 8 = 0)(else = -8) into retired. if retired=0 and age>69 retired=1. fre unemp retired. cro retired unemp by occupa. do if etudi<3 or occupa=3. compute student=1. else if etudi=3. compute student=0. else. compute student=-8. end if. freq student. cro student by occupa etudi. recode sal3h (sysmis=-8). compute workhrs= sal3h. if sal3h=-8 and empstat=4 workhrs=-7. fre workhrs. means workhrs by empstat /cells min max mean. freq sal38. recode sal38 for12 (sysmis=-1). temp. select if sal38=-1. freq empstat. do if sal38>-1 and sal38<80000. compute empinclm=sal38. else if for12>0 and for12<99999. compute empinclm=for12. else if (sal38 = -1 or sal38>80000) and empstat=4. compute empinclm=-7. else if (sal38 = -1 or sal38>80000). compute empinclm=-8. end if. freq empinclm. means empinclm by empstat /cells min max mean. temp. select if empstat=4. freq empinclm. Do if empinclm>0 and empstat=4. compute empstat=3. compute emp=1. end if. means empinclm by empstat /cells min max mean. recode statutpr (sysmis=-8) (9=-8) (1,2,3=1) (else=2) into sector. freq sector. cro statutpr by sector. recode act0 cs posit (sysmis=-5). cro cs by act0. do if cs=23. compute occup=1. else if cs=53. compute occup=10. else if act0=11 or cs=10 or cs=69. compute occup=12. else if cs=33. compute occup=4. else if act0=43 and (cs>25 and cs<42). compute occup=2. else if act0=45 and (cs>25 and cs<42). compute occup=5. else if cs=34 or cs=38. compute occup=3. else if cs=37. compute occup=1. else if (cs>25 and cs<42) or cs=44. compute occup=7. else if act2=1. compute occup=14. End if. Do if occup=-5 and (act0=45 or cs=42 or cs=43 or cs=45). compute occup=8. else if occup=-5 and (act0=43 or act0=48 or cs=46 or cs=54). compute occup=9. else if occup=-5 and (cs=52 or cs=55 or cs=56 or act0=44 or act0=46 or act0=47). compute occup=11. else if occup=-5 and (act0=21 or act0=22 or act0=31 or act0=41 or act0=42 or cs=21 or cs=22 or (cs>54 and cs<69)). compute occup=13. else if posit=5 or posit=6 or posit=7 or cs=47. compute occup=8. else if posit=3 or posit=4. compute occup=9. else if posit=9. compute occup=11. else if occup=-5 and empstat=4. compute occup=-7. else if occup=-5. compute occup=-8. end if. freq occup. cro cs act0 act2 posit by occup. rename variables (cs=occupo). recode occupo (-5=-8). freq occupo. *isco1 code cretaed by Ewa Jarosz. recode occupo (53=0) (23, 48=1) (10, 31, 33, 34, 35=2) (38, 42, 43, 44, 47=3) (37, 45, 46, 52, 54=4) (22, 55, 56=5) (69=6) (21, 62, 63=7) (64, 65=8) (67, 68 =9) (-8=-8) (else=-5) into isco1. cro occupo by isco1. compute educa=diplo. recode educa (0=1) (1 thru 3=2) (4 thru 7 = 3) into edcat. fre edcat. cro edcat by educa. recode ser6q san1 san2 san3 tem2 tem3 tem4 tem5 (sysmis=-5). freq ser6q san1 san2 san3 tem2 tem3 tem4 tem5. cro tem2 by tem3 tem4 tem5. *these various rushed alternatives are not associated, thus not *suitable to make a combined scale; just use tem2. recode tem2 (1=0) (2,3=1) (4,5=2) (else=-8) into rushed. cro tem2 by rushed. recode san1 (1=3) (2=2) (3=1) (4,5=0) (else=-8) into health. cro san1 by health. recode ser6q (1 thru high =1) (else=0) into carer. freq carer. cro san2 by san3. do if san3=1. compute disab = 1. else if san2=2 or san3=2 or san3=3. compute disab=0. else. compute disab=-8. end if. fre disab. cro disab by san2 san3. means age by disab. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\interima.sav' /drop ident nkids hhldsiz2 dj1 djc dj2 djs remp1 remp2 remp3 remp4 remp5 remp6 refc1 refc2 refc3 refc4 refc5 refc6 refq1 refq2 refq3 refq4 refq5 refq6 dji log1 log2 log31 log32 log33 log4 log5 log601 log601n log602 log603 log604 log605 log606 log607 log608 log609 log610 log611 log612 log612n log7 log8 log9 log10 log111 log112 log1201t log1202t log1203t log1204t log1205t log1206t log1207t log1208t log1209t log1210t aid11 aid12 aid13 aid14 aid15 aid16 aid17 aid21 aid22 aid23 aid24 aid25 aid3 aid4 aid5 aid61 aid62 aid63 aid64 aid61f aid62f aid63f aid64f aid61p aid62p aid63p aid64p aid71 aid72 aid73 aid74 aid75 aid76 aid77 aid71f aid72f aid73f aid74f aid75f aid76f aid77f aid71q aid72q aid73q aid74q aid75q aid76q aid77q rec1 recp2 recp2f recp2n reca2 reca2f reca2n rec3 recp4 recp4f recp4n reca4 reca4f reca4n rec5 recp6 recp6f reca6 reca6f rev1 rev2 rev3 rev4 rev5 rev6 rev7 rev1p rev2p rev3p rev4p rev5p rev6p rev7p revtot rg strate dep jourdo jour nact n15 nind ncar nqui nsem ngri sexepr viecoupr cspr cscj occupapr occupbpr statutpr nbenf excj anaispr diegpr diespr dieppr occupacj occupbcj diplopr diplocj enf3 regi poidsb typm zeat typmen typmena revcor poicomp no anais mnais prenom sexe pnais lien nop nom noc viecou matri natio preshab etudi nivetud1 nivetud2 dieg diep dies occupa occupb actpa profess statut nbsal grade posit natempl activ reche lieu1 lieu2 lieu3 lieu4 lieu5 lieu6 lieu6m lieu7h lieu7m lieu8 lieu91 lieu92 lieu93 lieu94 lieu95 lieu96 lieu97 lieu98 lieu10h lieu10m lieu11 sal0 sal1 sal2mi sal2ma sal3h sal3m sal4 sal5 sal61 sal62 sal63 sal7 sal8 sal9 sal10 sal11 sal12 sal13 sal14 sal15 sal16 sal17 sal18 sal19 sal20 sal21 sal21f sal22 sal23 sal23f sal241 sal242 sal243 sal25 sal26 sal27 sal28 sal29 sal30 sal31 sal32 sal32f sal33s sal33j sal33v sal34s sal34j sal34v sal34a sal34b sal35 sal35b sal36 sal37 sal38 sal39 ind1 ind2mi ind2ma ind3 ind41m ind42m ind43m ind44m ind45m ind46m ind47m ind41p ind42p ind43p ind44p ind45p ind46p ind47p ind5 ind6s ind6j ind7 ind8 act0 act1a act1m act2 act3 act4 act51 act52 act53 act54 act55 act56 act57 act6 act71 act72 act73 act74 act75 act76 act77 act78 act8a act8b act9 act10 act11 act12 act13 act14 act15 act16 act171 act172 act173 act174 act175 act181 act182 act183 act19 act20 act21 act22 act23mi act23ma act24 act25 ina1 ina2 ina2f ina3 ina3f ina4 ina5 ina6 cho1 cho2 cho3 cho4h cho4m cho51 cho52 cho53 cho54 cho55 cho56 cho57 cho58 cho6 cho71 cho72 cho73 cho74 cho75 cho76 cho77 cho78 cho8 cho9 cho10 cho11 cho12 cho12f cho13 cho14 cho15 cho15f cho16 cho17 cho18 cho19 cho20 cho21 cho22 occ for1 for21 for22 for23 for31 for32 for33 for34 for4 for5 for6 for7 for8 for9 for10 for11 for12 for13 cul1 cul2 cul3 cul4 cul5 cul6 cul7 cul1f cul2f cul3f cul4f cul5f cul6f cul7f cul8 cul9 cul10 cul11 spo1 spo2 spo3 spo4 spo5 spo6 spo7 spo1f spo2f spo3f spo4f spo5f spo6f spo7f spo8 men1 men2 men3 men4 men5 men6 men7 men8 men1f men2f men3f men4f men5f men6f men7f men8f men1p men2p men3p men4p men5p men6p men7p men8p ass1 ass2 ass3 ass4 ass5 ass5f ass6 ass7 ass8 ass8f ser1 ser2 ser3 ser4 ser5 ser6 ser7 ser8 ser9 ser10 ser1f ser2f ser3f ser4f ser5f ser6f ser7f ser8f ser9f ser10f ser1q ser2q ser3q ser4q ser5q ser6q ser7q ser8q ser9q ser10q san1 san2 san3 tem1 tem2 tem3 tem4 tem5 tem6 nblic debc finc jourc exej typj cz11 cz12 cz13 cz14 cz15 cz16 cz17 cz18 cz21 cz22 cz23 cz24 cz25 cz26 cz27 cz28 fing1 fing2 fing3 fing4 fing5 fing6 fing7 fing8 jour1 jour2 jour3 jour4 jour5 jour6 jour7 sz11 sz12 sz13 sz14 sz15 sz16 sz17 sz21 sz22 sz23 sz24 sz25 sz26 sz27 fins1 fins2 fins3 fins4 fins5 fins6 fins7 jours typs code ident0 diplo csp tag6 excar exqui csc. New file. get file='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\interima.sav'. freq actpr1 to actpr144. freq actse1 to actse144. recode actse1 to actse144 (sysmis=999). freq lieup1 to lieup144. recode lieup1 to lieup144 (sysmis=999). freq butp1 to butp144. recode butp1 to butp144 (sysmis=999). freq presp1 to presp144. recode presp1 to presp144 (sysmis=999). temp. select if lieup1=999. freq actpr1. cro actpr70 by lieup70. compute test=0. if lieup1=999 and actpr1=132 test=1. freq test. *this case examined or unknown location but medical care away from home at beginning of diary day examined. Do repeat a=lieup1 to lieup72. Do if test=1. compute a=2. End if. End repeat. *this case set to location away from home. execute. *other 61 missing location at the beginning of the day activities as home or hotel or similar. *Fill in these locations as at home if the person's next reported location is at home. if lieup1=999 and lieup2=0 lieup1=0. Do if lieup1=999 and lieup2=999 and lieup3=0. compute lieup1=0. compute lieup2=0. End if. Do if lieup1=999 and lieup2=999 and lieup3=999 and lieup4=0. compute lieup1=0. compute lieup2=0. compute lieup3=0. End if. Do if lieup1=999 and lieup2=999 and lieup3=999 and lieup4=999 and lieup5=0. compute lieup1=0. compute lieup2=0. compute lieup3=0. compute lieup4=0. End if. Do if lieup1=999 and lieup2=999 and lieup3=999 and lieup4=999 and lieup5=999 and lieup6=0. compute lieup1=0. compute lieup2=0. compute lieup3=0. compute lieup4=0. compute lieup5=0. End if. Do if lieup1=999 and lieup2=999 and lieup3=999 and lieup4=999 and lieup5=999 and lieup6=999 and lieup7=0. compute lieup1=0. compute lieup2=0. compute lieup3=0. compute lieup4=0. compute lieup5=0. compute lieup6=0. End if. Do if lieup1=999 and lieup2=999 and lieup3=999 and lieup4=999 and lieup5=999 and lieup6=999 and lieup7=999 and lieup8=0. compute lieup1=0. compute lieup2=0. compute lieup3=0. compute lieup4=0. compute lieup5=0. compute lieup6=0. compute lieup7=0. End if. Do if lieup1=999 and lieup2=999 and lieup3=999 and lieup4=999 and lieup5=999 and lieup6=999 and lieup7=999 and lieup8=999 and lieup9=0. compute lieup1=0. compute lieup2=0. compute lieup3=0. compute lieup4=0. compute lieup5=0. compute lieup6=0. compute lieup7=0. compute lieup8=0. End if. Do if lieup1=999 and lieup2=999 and lieup3=999 and lieup4=999 and lieup5=999 and lieup6=999 and lieup7=999 and lieup8=999 and lieup9=999 and lieup10=0. compute lieup1=0. compute lieup2=0. compute lieup3=0. compute lieup4=0. compute lieup5=0. compute lieup6=0. compute lieup7=0. compute lieup8=0. compute lieup9=0. End if. Do repeat a=lieup1 to lieup27. Do if lieup1=999 and lieup28=2. compute a=2. End if. End repeat. Do repeat a=lieup1 to lieup30. Do if lieup1=999 and lieup31=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup36. Do if lieup1=999 and lieup37=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup37. Do if lieup1=999 and lieup38=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup38. Do if lieup1=999 and lieup39=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup42. Do if lieup1=999 and lieup43=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup45. Do if lieup1=999 and lieup46=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup48. Do if lieup1=999 and lieup49=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup51. Do if lieup1=999 and lieup52=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup52. Do if lieup1=999 and lieup53=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup54. Do if lieup1=999 and lieup55=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup60. Do if lieup1=999 and lieup61=0. compute a=0. End if. End repeat. Do repeat a=lieup1 to lieup144. do if hldid=2401011390 and persid=1. compute a=0. end if. end repeat. Do repeat a=lieup1 to lieup43. do if hldid=9302022060 and persid=1. compute a=0. end if. end repeat. Do repeat a=lieup74 to lieup78. do if hldid=9302022060 and persid=1. compute a=0. end if. end repeat. Do repeat a=lieup121 to lieup144. do if hldid=9302022060 and persid=1. compute a=0. end if. end repeat. do if hldid=9302022060 and persid=1. compute lieup113=0. compute lieup114=0. compute lieup44=3. compute lieup45=3. compute lieup46=3. compute lieup47=3. compute lieup48=3. compute lieup73=3. compute lieup79=3. compute lieup80=3. compute lieup81=3. compute lieup100=3. end if. Do repeat a=lieup100 to lieup112. do if hldid=9302022060 and persid=1. compute a=3. end if. end repeat. Do repeat a=lieup49 to lieup72. do if hldid=9302022060 and persid=1. compute a=1. end if. end repeat. Do repeat a=lieup82 to lieup99. do if hldid=9302022060 and persid=1. compute a=1. end if. end repeat. Do repeat a=lieup115 to lieup120. do if hldid=9302022060 and persid=1. compute a=4. end if. end repeat. Do repeat a=lieup1 to lieup144. do if hldid=9302026990. compute a=0. end if. end repeat. freq lieup1. *address other missing location using patterns in diary - if people at home but *do not travel then have a missing location, they logically must still be at home - *an exception seems to be long shopping, here people must walk to local shops. *start by using activity codes which have being at home as a part of the activity - if *location not recorded but the activity is not at home, then code the location as at home. vector lieup=lieup1 to lieup144 /actpr=actpr1 to actpr144. loop i=1 to 144. if lieup(i)=999 and (actpr(i)<123 or (actpr(i)>123 and actpr(i)<142) or actpr(i)=143 or actpr(i)=212 or actpr(i)=413 or actpr(i)=611) lieup(i)=0. end loop. freq lieup2 to lieup144. *similarly where location is not recroded but the activity code includes being at the workplace *or somewhere away from home, code the location accordingly. vector lieup=lieup1 to lieup144 /actpr=actpr1 to actpr144. loop i=1 to 144. if lieup(i)=999 and (actpr(i)=142 or actpr(i)=145 or actpr(i)=211 or actpr(i)=214 or actpr(i)=231) lieup(i)=1. if lieup(i)=999 and (actpr(i)=213 or actpr(i)=811) lieup(i)=3. if lieup(i)=999 and (actpr(i)=123 or actpr(i)=132 or actpr(i)=143 or actpr(i)=146 or actpr(i)=221 or actpr(i)=223 or actpr(i)=232 or actpr(i)=233 or (actpr(i)>262 and actpr(i)<310) or actpr(i)=412 or actpr(i)=423 or actpr(i)=424 or actpr(i)=513 or (actpr(i)>531 and actpr(i)<611) or (actpr(i)>611 and actpr(i)<631) or (actpr(i)>641 and actpr(i)<663)) lieup(i)=2. if lieup(i)=999 and (actpr(i)=810 or actpr(i)=812 or actpr(i)=813 or actpr(i)=819) lieup(i)=4. end loop. freq lieup29 to lieup144. *looking at the cases of missing location lead to identification of 3 diaries *suggesting extreme lengths of time completing the diary at the end of the diary day. *these are not realistic, left 30 minutes as completing the diary, changed the next *30 minutes to imputed personal and household care, and the remaining hours to imputed *sleep. Do if lieup144=999. recode lieup79 to lieup144 (999=0). End if. Do if hldid=4106032400 and persid=2. recode actpr82 to actpr84 (911=109). recode actpr85 to actpr144 (911=110). Else if (hldid=4106032400 and persid=1) or (hldid=8201012050 and persid=1). recode actpr112 to actpr114 (911=109). recode actpr115 to actpr144 (911=110). End if. Do if hldid=5402010660 and persid=1. recode lieup124 to lieup135 (999=0). Else if (hldid=8201012940 and persid=1). recode lieup118 to lieup120 (999=0). End if. Do if hldid=4106032400 and persid=2. recode actpr82 to actpr84 (110=109). Else if (hldid=4106032400 and persid=1) or (hldid=8201012050 and persid=1). recode actpr112 to actpr114 (110=109). End if. freq actpr144. *now identify remaining diaries with missing location codes. compute misloc=0. do repeat a=lieup29 to lieup143. if a=999 misloc=misloc+1. end repeat. freq misloc. *437 cases with missing location time now - 97.2% have no missing location. cro actpr62 by lieup62. *a range of different activities covered. Do if hldid=8304012550 and persid=1. recode lieup61 to lieup66 (999=2). recode lieup79 to lieup90 (999=0). recode lieup91 to lieup102 (999=2). recode lieup103 to lieup111 (999=0). Else if hldid=9308092010 and persid=1. recode lieup46 to lieup51 (999=0). recode lieup52 to lieup60 (999=2). recode lieup61 to lieup72 (999=0). recode lieup79 to lieup84 (999=0). recode lieup111 to lieup114 (999=0). recode lieup130 to lieup132 (999=0). Else if hldid=2305030600 and persid=1. recode lieup86 to lieup117 (999=0). Else if hldid=9308092010 and persid=2. recode lieup82 to lieup84 (999=0). recode lieup97 to lieup114 (999=0). recode lieup82 to lieup84 (999=0). Else if hldid=2304024740 and persid=1. recode lieup61 to lieup66 (999=2). recode lieup109 to lieup114 (999=0). recode lieup125 to lieup138 (999=0). End if. vector lieup=lieup1 to lieup144. loop i=1 to 142. compute j=i+1. compute k=i+2. if lieup(j)=999 and lieup(i)<999 and lieup(i)=lieup(k) lieup(j)=lieup(i). end loop. loop i=1 to 141. compute j=i+1. compute k=i+2. compute l=i+3. Do if lieup(j)=999 and lieup(k)=999 and lieup(i)<999 and lieup(i)=lieup(l). compute lieup(j)=lieup(i). compute lieup(k)=lieup(i). End if. end loop. compute misloc=0. do repeat a=lieup29 to lieup143. if a=999 misloc=misloc+1. end repeat. freq misloc. *310 cases with missing location time now - 98% have no missing location. Do if hldid=7207041910 and persid=2. recode lieup124 to lieup141 (999=0). recode lieup109 to lieup114 (999=2). Else if hldid=9304046730 and persid=4. recode lieup87 to lieup108 (999=0). recode lieup136 to lieup138 (999=0). Else if hldid=4202004480 and persid=1. recode lieup80 to lieup102 (999=2). Else if hldid=9306072290 and persid=3. recode lieup58 to lieup78 (999=0). Else if hldid=3108075240 and persid=4. recode lieup103 to lieup115 (999=0). recode lieup120 to lieup126 (999=0). Else if hldid=2404030430 and persid=2. recode lieup94 to lieup114 (999=0). End if. Do if hldid=2308048230 and persid=2. recode lieup79 to lieup83 (999=0). recode lieup109 to lieup113 (999=0). Else if hldid=1102029780 and persid=2. recode lieup65 to lieup69 (999=0). recode lieup94 to lieup99 (999=0). Else if hldid=2407056410 and persid=1. recode lieup68 to lieup78 (999=2). Else if hldid=4207029810 and persid=2. recode lieup93 (999=0). recode lieup122 to lieup131 (999=0). Else if hldid=7301004330 and persid=1. recode lieup131 to lieup141 (999=0). End if. Do if hldid=8202021810 and persid=2. recode lieup103 to lieup113 (999=2). Else if hldid=9101000200 and persid=1. recode lieup92 to lieup102 (999=2). Else if hldid=1105089610 and persid=2. recode lieup124 to lieup134 (999=0). Else if hldid=1108162540 and persid=2. recode lieup55 to lieup63 (999=2). recode lieup130 to lieup132 (999=0). Else if hldid=2606041700 and persid=1. recode lieup49 to lieup55 (999=1). recode lieup105 to lieup109 (999=1). End if. Do if hldid=4203010630 and persid=2. recode lieup100 to lieup111 (999=0). Else if hldid=5305052100 and persid=1. recode lieup58 to lieup69 (999=2). Else if hldid=9108049810 and persid=2. recode lieup124 to lieup135 (999=0). Else if hldid=9302022170 and persid=1. recode lieup85 to lieup96 (999=0). Else if hldid=9302030180 and persid=2. recode lieup67 to lieup71 (999=0). recode lieup126 to lieup132 (999=0). Else if hldid=8201002660 and persid=1. recode lieup126 to lieup138 (999=0). End if. vector lieup=lieup1 to lieup144 /actpr=actpr1 to actpr144. loop i=1 to 142. compute j=i+1. compute k=i+2. if lieup(i)=999 and ((actpr(i)>349 and actpr(i)<370) and (actpr(j)>349 and actpr(j)<370) and (actpr(k)>349 and actpr(k)<370)) lieup(i)=2. if (lieup(i)=3 or lieup(i)=4) and lieup(j)=999 and lieup(k)=0 lieup(j)=0. if (lieup(k)=3 or lieup(k)=4) and lieup(j)=999 and lieup(i)=0 lieup(j)=0. end loop. execute. vector lieup=lieup1 to lieup144 /actpr=actpr1 to actpr144. loop i=1 to 143. compute j=i+1. if lieup(i)=2 and lieup(j)=999 and (actpr(j)>349 and actpr(j)<370) lieup(j)=2. end loop. compute misloc=0. do repeat a=lieup29 to lieup143. if a=999 misloc=misloc+1. end repeat. freq misloc. *266 cases with missing location time now - 98.3% have no missing location. vector lieup=lieup1 to lieup144. loop i=1 to 141. compute j=i+1. compute k=i+2. compute l=i+3. Do if (lieup(i)=3 or lieup(i)=4) and (lieup(j)=999 and lieup(k)=999) and lieup(l)=0. compute lieup(j)=0. compute lieup(k)=0. End if. Do if (lieup(l)=3 or lieup(l)=4) and (lieup(j)=999 and lieup(k)=999) and lieup(i)=0. compute lieup(j)=0. compute lieup(k)=0. End if. end loop. loop i=1 to 140. compute j=i+1. compute k=i+2. compute l=i+3. compute m=i+4. Do if lieup(i)<999 and (lieup(j)=999 and lieup(k)=999 and lieup(l)=999) and lieup(m)=lieup(i). compute lieup(j)=lieup(i). compute lieup(k)=lieup(i). compute lieup(l)=lieup(i). End if. Do if (lieup(i)=3 or lieup(i)=4) and (lieup(j)=999 and lieup(k)=999 and lieup(l)=999) and lieup(m)=0. compute lieup(j)=0. compute lieup(k)=0. compute lieup(l)=0. End if. Do if (lieup(m)=3 or lieup(m)=4) and (lieup(j)=999 and lieup(k)=999 and lieup(l)=999) and lieup(i)=0. compute lieup(j)=0. compute lieup(k)=0. compute lieup(l)=0. End if. end loop. Do if hldid=7304023230 and persid=3. recode lieup128 to lieup143 (999=2). End if. loop i=1 to 137. compute j=i+1. compute k=i+2. compute l=i+3. compute m=i+4. compute n=i+5. compute o=i+6. compute p=i+7. Do if (lieup(i)=3 or lieup(i)=4) and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(m)=999 and lieup(n)=999 and lieup(o)=999 and lieup(p)<3. compute lieup(j)=lieup(p). compute lieup(k)=lieup(p). compute lieup(l)=lieup(p). compute lieup(m)=lieup(p). compute lieup(n)=lieup(p). compute lieup(o)=lieup(p). End if. Do if (lieup(p)=3 or lieup(p)=4) and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(m)=999 and lieup(n)=999 and lieup(o)=999 and lieup(i)<3. compute lieup(j)=lieup(i). compute lieup(k)=lieup(i). compute lieup(l)=lieup(i). compute lieup(m)=lieup(i). compute lieup(n)=lieup(i). compute lieup(o)=lieup(i). End if. Do if lieup(i)<999 and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(m)=999 and lieup(n)=999 and lieup(o)=999 and lieup(i)=lieup(p). compute lieup(j)=lieup(p). compute lieup(k)=lieup(p). compute lieup(l)=lieup(p). compute lieup(m)=lieup(p). compute lieup(n)=lieup(p). compute lieup(o)=lieup(p). End if. end loop. loop i=1 to 138. compute j=i+1. compute k=i+2. compute l=i+3. compute m=i+4. compute n=i+5. compute o=i+6. Do if (lieup(i)=3 or lieup(i)=4) and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(m)=999 and lieup(n)=999 and lieup(o)<3. compute lieup(j)=lieup(o). compute lieup(k)=lieup(o). compute lieup(l)=lieup(o). compute lieup(m)=lieup(o). compute lieup(n)=lieup(o). End if. Do if (lieup(o)=3 or lieup(o)=4) and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(m)=999 and lieup(n)=999 and lieup(i)<3. compute lieup(j)=lieup(i). compute lieup(k)=lieup(i). compute lieup(l)=lieup(i). compute lieup(m)=lieup(i). compute lieup(n)=lieup(i). End if. Do if lieup(i)<999 and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(m)=999 and lieup(n)=999 and lieup(i)=lieup(o). compute lieup(j)=lieup(o). compute lieup(k)=lieup(o). compute lieup(l)=lieup(o). compute lieup(m)=lieup(o). compute lieup(n)=lieup(o). End if. end loop. loop i=1 to 139. compute j=i+1. compute k=i+2. compute l=i+3. compute m=i+4. compute n=i+5. Do if (lieup(i)=3 or lieup(i)=4) and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(m)=999 and lieup(n)<3. compute lieup(j)=lieup(n). compute lieup(k)=lieup(n). compute lieup(l)=lieup(n). compute lieup(m)=lieup(n). End if. Do if (lieup(n)=3 or lieup(n)=4) and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(m)=999 and lieup(i)<3. compute lieup(j)=lieup(i). compute lieup(k)=lieup(i). compute lieup(l)=lieup(i). compute lieup(m)=lieup(i). End if. Do if lieup(i)<999 and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(m)=999 and lieup(i)=lieup(n). compute lieup(j)=lieup(n). compute lieup(k)=lieup(n). compute lieup(l)=lieup(n). compute lieup(m)=lieup(n). End if. end loop. loop i=1 to 140. compute j=i+1. compute k=i+2. compute l=i+3. compute m=i+4. Do if (lieup(i)=3 or lieup(i)=4) and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(m)<3. compute lieup(j)=lieup(m). compute lieup(k)=lieup(m). compute lieup(l)=lieup(m). End if. Do if (lieup(m)=3 or lieup(m)=4) and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(i)<3. compute lieup(j)=lieup(i). compute lieup(k)=lieup(i). compute lieup(l)=lieup(i). End if. Do if lieup(i)<999 and lieup(j)=999 and lieup(k)=999 and lieup(l)=999 and lieup(i)=lieup(m). compute lieup(j)=lieup(m). compute lieup(k)=lieup(m). compute lieup(l)=lieup(m). End if. end loop. loop i=1 to 141. compute j=i+1. compute k=i+2. compute l=i+3. Do if (lieup(i)=3 or lieup(i)=4) and lieup(j)=999 and lieup(k)=999 and lieup(l)<3. compute lieup(j)=lieup(l). compute lieup(k)=lieup(l). End if. Do if (lieup(l)=3 or lieup(l)=4) and lieup(j)=999 and lieup(k)=999 and lieup(i)<3. compute lieup(j)=lieup(i). compute lieup(k)=lieup(i). End if. end loop. loop i=1 to 142. compute j=i+1. compute k=i+2. if (lieup(i)=3 or lieup(i)=4) and lieup(j)=999 and (lieup(k)=1 or lieup(k)=2) lieup(j)=lieup(k). if (lieup(k)=3 or lieup(k)=4) and lieup(j)=999 and (lieup(i)=1 or lieup(i)=2) lieup(j)=lieup(k). end loop. compute misloc=0. do repeat a=lieup29 to lieup143. if a=999 misloc=misloc+1. end repeat. freq misloc. *97 cases with missing location time now - 99.4% have no missing location. do repeat a=lieup1 to lieup144 /b= actpr1 to actpr144. if a=999 and b=634 a=0. if a=999 and b=251 a=1. end repeat. Do if hldid=1102037130 and persid=3. recode lieup133 to lieup137 (999=0). Else if hldid=1108152310 and persid=1. recode lieup103 to lieup120 (999=0). Else if hldid=2102017030 and persid=1. recode lieup124 to lieup138 (999=0). end if. Do if hldid=8208100580 and persid=1. recode lieup106 to lieup114 (999=2). End if. Do if misloc=9. recode lieup29 to lieup143 (999=0). End if. compute misloc=0. do repeat a=lieup29 to lieup143. if a=999 misloc=misloc+1. end repeat. freq misloc. *56 cases with missing location time now - 99.4% have no missing location. sort cases by misloc(d). *these 56 cases manually examined, with patterns in diaries read before final recoding. Do if hldid=8302005790 and persid=2. recode lieup106 to lieup111 (999=2). Else if (hldid=8303009260 and persid=1) or (hldid=8208110080 and persid=2) or (hldid=9103012830 and persid=2) or (hldid=9306068420 and persid=2) or (hldid=9308104380 and persid=2) or (hldid=5304042770 and persid=2) or (hldid=5307072650 and persid=1) or (hldid=5203013010 and persid=2) or (hldid=4101002900 and persid=3) or (hldid=4202003470 and persid=1) or (hldid=2108068940 and persid=1) or (hldid=2303013870 and persid=1) or (hldid=2404031020 and persid=5) or (hldid=2408066910 and persid=1). recode lieup28 to lieup144 (999=2). End if. execute. recode lieup28 to lieup144 (999=0). freq lieup1 to lieup144. sort cases by hldid persid. compute test=0. compute test2=0. compute test3=0. Do repeat a=actpr1 to actpr144 / b=lieup1 to lieup144 /c=eloc1 to eloc144. Do if b=0. compute c=1. Else if b=1. compute c=3. Else if b>2. compute c=8. Else if b=2 and a=531. compute c=7. Else if b=2 and (a=132 or a=412 or a=533 or (a>349 and a<370)). compute c=5. Else if b=2 and (a>250 and a<273). compute c=4. Else if b=2 and a=511. compute c=2. *mark cases of people spending time at other people's homes. compute test3=1. Else if b=2 and (a=143 or a=146). compute c=6. compute test=1. Else if b=2 and (a=213 or (a>800 and a<900)). compute c=8. Else if b=2. compute c=9. End if. *use test2 to attempt to define time at another person's home to distinguish *meals at other homes from meals at cafes & restaurants, including personal care *away from home, cooking and food clean-up away from home. if (a=123 and b=2) or ((a>300 and a<330) and b=2) test2=1. End repeat. freq test test2 test3. cro test by test2 test3. *look into coding more time at other people's homes + separating meals at other *people's homes from meals at restaurants. compute test4=0. if test=1 and (test2=1 or test3=1) test4=1. freq test4. *1070 cases - 6.9% of diaries possibly such cases. sort cases by test4(d). Do if hldid=1101010140 and persid=1. recode eloc76 to eloc111 (6=2) (9=2). Else if hldid=1101005470 and persid=1. recode eloc127 to eloc135 (6=2) (9=2). recode eloc88 (6=2) (9=2). Else if hldid=1101012890 and persid=1. recode eloc142 to eloc144 (6=2) (9=2). Else if hldid=1101011060 and persid=1. recode eloc117 to eloc123 (6=2) (9=2). Else if hldid=1101002130 and persid=1. recode eloc1 to eloc98 (6=2) (9=2). Else if hldid=1101004730 and persid=1. recode eloc1 to eloc58 (6=2) (9=2). recode eloc64 to eloc69 (6=2) (9=2). recode eloc79 to eloc85 (6=2) (9=2). recode eloc100 to eloc102 (6=2) (9=2). Else if hldid=1101004730 and persid=2. recode eloc1 to eloc102 (6=2) (9=2). End if. execute. Do if hldid=1101014490 and persid=1. recode eloc124 to eloc132 (6=2) (9=2). Else if hldid=1101018100 and persid=2. recode eloc79 to eloc84 (6=2) (9=2). Else if hldid=1101018100 and persid=3. recode eloc76 to eloc84 (6=2) (9=2). Else if hldid=1101021380 and persid=1. recode eloc1 to eloc42 (6=2) (9=2). recode eloc61 to eloc91 (6=2) (9=2). recode eloc103 to eloc144 (6=2) (9=2). Else if hldid=1102023650 and persid=1. recode eloc1 to eloc78 (6=2) (9=2). recode eloc84 to eloc87 (6=2) (9=2). recode eloc89 to eloc102 (6=2) (9=2). recode eloc104 to eloc144 (6=2) (9=2). Else if hldid=1102023650 and persid=2. recode eloc1 to eloc66 (6=2) (9=2). recode eloc73 to eloc87 (6=2) (9=2). recode eloc89 to eloc102 (6=2) (9=2). recode eloc104 to eloc144 (6=2) (9=2). Else if hldid=1102026330 and persid=2. recode eloc118 to eloc144 (6=2) (9=2). Else if hldid=1102032890 and persid=1. recode eloc95 to eloc96 (6=2) (9=2). End if. execute. Do if hldid=1102034500 and persid=4. recode eloc107 to eloc120 (6=2) (9=2). Else if hldid=1102035800 and persid=1. recode eloc1 to eloc93 (6=2) (9=2). Else if hldid=1102036290 and persid=2. recode eloc1 to eloc59 (6=2) (9=2). recode eloc73 to eloc84 (6=2) (9=2). recode eloc112 to eloc123 (6=2) (9=2). recode eloc126 to eloc144 (6=2) (9=2). Else if hldid=1102036450 and persid=1. recode eloc105 to eloc123 (6=2) (9=2). Else if hldid=1102037680 and persid=2. recode eloc120 to eloc141 (6=2) (9=2). Else if hldid=1102038270 and persid=2. recode eloc64 to eloc108 (6=2) (9=2). Else if hldid=1102038430 and persid=2. recode eloc74 to eloc98 (6=2) (9=2). Else if hldid=1102039370 and persid=1. recode eloc1 to eloc54 (6=2) (9=2). recode eloc65 to eloc144 (6=2) (9=2). End if. execute. Do if hldid=1102040190 and persid=1. recode eloc94 to eloc96 (6=2) (9=2). recode eloc103 to eloc114 (6=2) (9=2). Else if hldid=1102040420 and persid=2. recode eloc64 to eloc91 (6=2) (9=2). recode eloc102 to eloc135 (6=1) (9=1). Else if hldid=1102040710 and persid=1. recode eloc1 to eloc84 (6=2) (9=2). recode eloc91 to eloc102 (6=2) (9=2). Else if hldid=1103044370 and persid=1. recode eloc1 to eloc66 (6=2) (9=2). recode eloc81 to eloc96 (6=2) (9=2). recode eloc115 to eloc126 (6=2) (9=2). Else if hldid=1103046240 and persid=1. recode eloc112 to eloc135 (6=2) (9=2). Else if hldid=1103047180 and persid=1. recode eloc120 to eloc135 (6=2) (9=2). Else if hldid=1103047180 and persid=2. recode eloc118 to eloc137 (6=2) (9=2). Else if hldid=1103050470 and persid=2. recode eloc118 to eloc144 (6=2) (9=2). End if. execute. Do if hldid=1103052520 and persid=2. recode eloc112 to eloc122 (6=2) (9=2). recode eloc124 to eloc144 (6=2) (9=2). recode eloc1 to eloc65 (6=1) (9=1). Else if hldid=1103055190 and persid=1. recode eloc120 to eloc126 (6=2) (9=2). Else if hldid=1103058980 and persid=2. recode eloc128 to eloc144 (6=2) (9=2). Else if hldid=1103058980 and persid=4. recode eloc132 (6=2) (9=2). recode eloc140 to eloc144 (6=2) (9=2). Else if hldid=1103059990 and (persid=1 or persid=2). recode eloc110 to eloc141 (6=2) (9=2). End if. execute. Do if hldid=1103060710 and persid=2. recode eloc123 to eloc132 (6=2) (9=2). Else if hldid=1103060800 and persid=1. recode eloc73 to eloc81 (6=2) (9=2). Else if hldid=1103061560 and persid=1. recode eloc1 to eloc72 (6=2) (9=2). recode eloc76 to eloc84 (6=2) (9=2). Else if hldid=1104062680 and persid=1. recode eloc1 to eloc54 (6=2) (9=2). recode eloc67 to eloc87 (6=2) (9=2). Else if hldid=1104062910 and persid=1. recode eloc121 to eloc132 (6=2) (9=2). Else if hldid=1104063100 and persid=1. recode eloc10 to eloc84 (6=2) (9=2). recode eloc10 to eloc84 (6=9) (9=9). Else if hldid=1104064820 and persid=2. recode eloc1 to eloc52 (6=2) (9=2). recode eloc115 to eloc144 (6=2) (9=2). Else if hldid=1104066330 and persid=1. recode eloc1 to eloc98 (6=2) (9=2). recode eloc125 to eloc144 (6=2) (9=2). Else if hldid=1104071790 and persid=2. recode eloc75 to eloc90 (6=2) (9=2). Else if hldid=1104071790 and persid=3. recode eloc7 to eloc93 (6=2) (9=2). recode eloc115 to eloc144 (6=1) (9=1). End if. execute. Do if hldid=1104072180 and persid=2. recode eloc1 to eloc72 (6=2) (9=2). Else if hldid=1104075080 and persid=3. recode eloc1 to eloc60 (6=2) (9=2). recode eloc78 to eloc97 (6=2) (9=2). recode eloc111 to eloc144 (6=2) (9=2). Else if hldid=1104075800 and persid=1. recode eloc55 to eloc84 (6=2) (9=2). recode eloc103 to eloc114 (6=2) (9=2). Else if hldid=1105082680 and persid=1. recode eloc1 to eloc66 (6=2) (9=2). recode eloc76 to eloc90 (6=2) (9=2). Else if hldid=1105082680 and persid=2. recode eloc1 to eloc66 (6=2) (9=2). recode eloc76 to eloc90 (6=2) (9=2). Else if hldid=1105083360 and persid=1. recode eloc1 to eloc52 (6=2) (9=2). recode eloc54 to eloc78 (6=2) (9=2). recode eloc83 to eloc92 (6=2) (9=2). Else if hldid=1105084110 and persid=1. recode eloc1 to eloc54 (6=2) (9=2). recode eloc56 to eloc60 (6=2) (9=2). Else if hldid=1105086170 and persid=2. recode eloc58 to eloc60 (6=2) (9=2). Else if hldid=1105086790 and persid=2. recode eloc50 to eloc96 (6=2) (9=2). Else if hldid=1105088770 and persid=2. recode eloc127 to eloc144 (6=2) (9=2). Else if hldid=1105088770 and persid=3. recode eloc113 to eloc120 (6=2) (9=2). End if. execute. Do if hldid=1105090030 and persid=4. recode eloc125 to eloc139 (6=2) (9=2). Else if hldid=1105093040 and persid=1. recode eloc115 to eloc144 (6=2) (9=2). Else if hldid=1105093310 and persid=1. recode eloc68 to eloc81 (6=2) (9=2). Else if hldid=1105093770 and persid=1. recode eloc1 to eloc92 (6=2) (9=2). recode eloc111 to eloc144 (6=2) (9=2). Else if hldid=1105094230 and persid=1. recode eloc120 to eloc126 (6=2) (9=2). Else if hldid=1105097840 and persid=2. recode eloc76 to eloc78 (6=2) (9=2). recode eloc120 to eloc126 (6=2) (9=2). Else if hldid=1105101970 and persid=3. recode eloc76 to eloc85 (6=2) (9=2). Else if hldid=1105102541 and persid=3. recode eloc7 to eloc63 (6=2) (9=2). recode eloc96 to eloc120 (6=2) (9=2). Else if hldid=1105102541 and persid=4. recode eloc73 to eloc84 (6=2) (9=2). recode eloc124 to eloc144 (6=2) (9=2). Else if hldid=1106104630 and persid=1. recode eloc121 to eloc123 (6=2) (9=2). End if. execute. Do if hldid=1106104960 and persid=1. recode eloc82 to eloc110 (6=2) (9=2). Else if hldid=1106105820 and persid=1. recode eloc16 to eloc90 (6=2) (9=2). Else if hldid=1106106760 and persid=2. recode eloc82 to eloc102 (6=2) (9=2). Else if hldid=1106109130 and persid=1. recode eloc94 to eloc96 (6=2) (9=2). recode eloc109 to eloc144 (6=2) (9=2). Else if hldid=1106122100 and persid=1. recode eloc121 to eloc125 (6=2) (9=2). Else if hldid=1106122100 and persid=2. recode eloc126 to eloc132 (6=2) (9=2). Else if hldid=1107124700 and persid=1. recode eloc105 to eloc115 (6=2) (9=2). Else if hldid=1107126470 and persid=1. recode eloc77 to eloc86 (6=2) (9=2). Else if hldid=1107132480 and persid=3. recode eloc90 to eloc132 (6=2) (9=2). Else if hldid=1107135230 and (persid=1 or persid=2). recode eloc113 to eloc126 (6=2) (9=2). Else if hldid=1107137540 and persid=1. recode eloc109 to eloc114 (6=2) (9=2). Else if hldid=1107140230 and persid=1. recode eloc1 to eloc81 (6=2) (9=2). recode eloc112 to eloc144 (6=2) (9=2). Else if hldid=1108150280 and persid=2. recode eloc79 to eloc91 (6=2) (9=2). Else if hldid=1108152220 and persid=1. recode eloc1 to eloc42 (6=2) (9=2). Else if hldid=1108153740 and persid=1. recode eloc1 to eloc54 (6=2) (9=2). recode eloc93 to eloc102 (6=2) (9=2). recode eloc127 to eloc144 (6=2) (9=2). Else if hldid=1108155230 and persid=3. recode eloc1 to eloc100 (6=2) (9=2). End if. execute. vector actpr= actpr1 to actpr144 /eloc= eloc1 to eloc144. Loop i=1 to 143. compute j=i+1. Do if ((eloc(i)=2 and eloc(j)=9) and (actpr(j)=146 or actpr(j)=151 or actpr(j)=310 or actpr(j)=311 or actpr(j)=312 or actpr(j)=313 or actpr(j)=314 or actpr(j)=321 or actpr(j)=330)). compute eloc(j)=2. Else if test4=1 and (actpr(i)=319 or actpr(i)=329) and eloc(i)=9. compute eloc(i)=2. End if. end loop. execute. *double check that location codes coding where desired. cro actpr35 lieup35 by eloc35. cro actpr75 lieup75 by eloc75. cro actpr95 lieup95 by eloc95. sort cases by hldid persid. *cannot create ict or mtrav. do repeat a=actpr1 to actpr144 /b=inout1 to inout144. Do if a=374 or a=424 or a=532 or (a>620 and a<630). compute b=2. Else. compute b=-9. end if. end repeat. cro actpr75 by inout75. vector old(144) /new(144). do repeat a=actpr1 to actpr144 /b=old1 to old144 /c=new1 to new144 /d= butp1 to butp144 /e=eloc1 to eloc144. Do if a=109. compute b=13. compute c=1. Else if a=110. compute b=16. compute c=3. Else if a=111. compute b=16. compute c=2. Else if a=121 or a=122 or a=151. compute b=13. compute c=4. Else if a=123 or a=124. compute b=14. compute c=25. Else if a=131. compute b=14. compute c=4. Else if a=132 or a=133. compute b=14. compute c=25. Else if a=141 or a=144. compute b=15. compute c=6. Else if a=142 or a=145. compute b=1. compute c=5. Else if a=143 or a=146. Do if e=2. compute b=15. compute c=6. Else. compute b=28. compute c=39. End if. Else if a=211 or a=214. compute b=1. compute c=7. Else if a=212. compute b=2. compute c=8. Else if a=213. compute b=1. compute c=11. Else if a=221 or a=223. compute b=3. compute c=9. Else if a=231. compute b=1. compute c=12. Else if a=233. compute b=1. compute c=13. Else if a=232 or a=234. compute b=23. compute c=33. Else if a=241. compute b=3. compute c=14. Else if a=251 or a=252. compute b=1. compute c=7. Else if a=261 or a=263. compute b=4. compute c=15. Else if a=262 or a=264. compute b=33. compute c=16. Else if a=271 or a=272. compute b=4. compute c=17. Else if a=310 or a=311 or a=314 or a=319. compute b=6. compute c=18. Else if a=312 or a=313. compute b=6. compute c=19. Else if a>319 and a<330. compute b=7. compute c=20. Else if (a>329 and a<333) or a=335 or a=339. compute b=7. compute c=21. Else if a=333 or a=334. compute b=39. compute c=54. Else if a=341 or a=372 or a=375. compute b=8. compute c=22. Else if a=340 or (a>341 and a<350). compute b=8. compute c=23. Else if a=350 or a=351 or a=359. compute b=10. compute c=24. Else if a=352 or a=360 or a=361 or a=369. compute b=10. compute c=26. Else if a=376. compute b=8. compute c=27. Else if (a>409 and a<414). compute b=11. compute c=28. Else if a=420 or a=421 or a=429. compute b=11. compute c=29. Else if a=422 or a=423 or a=424. compute b=11. compute c=30. Else if a=414 or a=419. compute b=11. compute c=31. Else if (a>429 and a<440). compute b=8. compute c=32. Else if a=625. compute b=18. compute c=45. Else if a=652. compute b=24. compute c=37. Else if a=610 or a=611 or a=612. compute b=19. compute c=42. Else if a=651. compute b=20. compute c=36. Else if a=621 or a=622. compute b=21. compute c=43. Else if a=624. compute b=21. compute c=46. Else if a=623. compute b=19. compute c=46. Else if a=531 or a=532 or a=533. compute b=22. compute c=34. Else if a=541 or a=542 or a=543. compute b=23. compute c=33. Else if a=653. compute b=24. compute c=37. Else if a=654. compute b=24. compute c=38. Else if a=620. compute b=26. compute c=40. Else if a=511. compute b=29. compute c=48. Else if a=512. compute b=38. compute c=48. Else if a=636. compute b=30. compute c=58. Else if a=634 or a=635. compute b=31. compute c=59. Else if a=637. compute b=32. compute c=57. Else if a=631 or a=632. compute b=34. compute c=56. Else if a=631 or a=632. compute b=34. compute c=56. Else if a=633. compute b=35. compute c=56. Else if a=374. compute b=9. compute c=46. Else if a=370 or a=377 or a=379. compute b=40. compute c=51. Else if a=371 or a=661. compute b=40. compute c=52. Else if a=373. compute b=40. compute c=54. Else if a=668. compute b=40. compute c=51. Else if a=667. compute b=40. compute c=50. Else if a=666. compute b=40. compute c=60. Else if a=665. compute b=40. compute c=52. Else if a=664. compute b=40. compute c=54. Else if a=523. compute b=40. compute c=53. Else if a=641. compute b=36. compute c=55. Else if a=524 or a=529. compute b=38. compute c=50. Else if a=520 or a=521 or a=522. compute b=37. compute c=49. Else if a=513. compute b=25. compute c=35. Else if a=510 or a=662 or a=663. compute b=25. compute c=40. Else if a=810. compute b=12. compute c=67. Else if a=812. compute b=17. compute c=68. Else if a=819. compute b=12. compute c=65. Else if a=813. compute b=12. compute c=66. Else if a=811. compute b=5. compute c=63. Else if a=911. compute b=23. compute c=33. Else. compute residual=a. End if. end repeat. freq residual. *good, residual having no cases means all elements of the diary have been assigned to an MTUS code. val lab new1 to new144 1 imputed personal or household care 2 sleep and naps 3 imputed sleep 4 wash, dress, care for self 5 meals at work or school 6 other meals or snacks 7 'paid work-main job (not at home)' 8 paid work at home 9 second or other job not at home 10 unpaid work to generate household income 11 travel as a part of work 12 work breaks 13 other time at workplace 14 look for work 15 regular schooling, education 16 homework 17 'leisure/other education or training' 18 food preparation, cooking 19 'set table, wash/put away dishes' 20 cleaning 21 laundry, ironing, clothing repair 22 'maintain home/vehicle' 23 other domestic work 24 purchase goods 25 consume personal care services 26 consume other services 27 'pet care (not walk dog)' 28 physical, medical child care 29 teach, help with homework 30 read to, talk or play with child 31 supervise, accompany, other child care 32 adult care 33 voluntary, civic, organisational act 34 worship and religion 35 general out-of-home leisure 36 attend sporting event 37 'cinema, theatre, opera, concert' 38 other public event, venue 39 restaurant, caf�, bar, pub 40 party, social event, gambling 41 imputed time away from home 42 general sport or exercise 43 walking 44 cycling 45 other outside recreation 46 'gardening/pick mushrooms' 47 walk dogs 48 receive or visit friends 49 'conversation (in person, phone)' 50 other in-home social, games 51 general indoor leisure 52 art or music 53 'correspondence (not e-mail)' 54 knit, crafts or hobbies 55 relax, think, do nothing 56 read 57 listen to music etc 58 listen to radio 59 watch TV, video, DVD 60 computer games 61 e-mail, surf internet, computing 62 no act but recorded transport mode 63 'travel to/from work' 64 education travel 65 'voluntary/civic/religious travel' 66 'child/adult care travel' 67 'shop, person/hhld care travel' 68 other travel 69 no recorded activity. *double check that location codes coding where desired. temp. select if new112<5. cro actpr112 lieup112 by new112. temp. select if new85<11. cro actpr85 lieup85 by new85. temp. select if new35>10 and new35<21. cro actpr35 lieup35 by new35. temp. select if new85>20 and new85<31. cro actpr85 lieup85 by new85. temp. select if new35>30 and new35<41. cro actpr35 lieup35 by new35. temp. select if new85>40 and new85<51. cro actpr85 lieup85 by new85. temp. select if new35>50 and new35<61. cro actpr35 lieup35 by new35. temp. select if new85>60. cro actpr85 lieup85 by new85. val lab old1 to old144 1 paid work 2 paid work at home 3 second job 4 'school/classes' 5 'travel to/from work' 6 cook, wash up 7 housework 8 odd jobs 9 gardening 10 shopping 11 childcare 12 domestic travel 13 'dress/personal care' 14 consume services 15 meals, snacks 16 sleep 17 free time travel 18 excursions 19 active sport 20 passive sport 21 walks 22 religious activity 23 civic activity 24 cinema, theatre 25 dances, parties 26 social club 27 pub 28 restaurant 29 visit friends 30 listen to radio 31 TV, video 32 listen to CDs records 33 study 34 read books 35 'read paper/magazine' 36 relax 37 conversation 38 entertain friends 39 knit, sew 40 other leisure 41 missing. temp. select if old85<11. cro actpr85 lieup85 by old85. temp. select if old35>10 and old35<21. cro actpr35 lieup35 by old35. temp. select if old105>20 and old105<31. cro actpr105 lieup105 by old105. temp. select if old95>30. cro actpr95 lieup95 by old95. *are some odd cases of working at home but at workplace. Examine these cases. compute residual=0. val lab residual 0 no work location problem 1 work at home at office 2 work at office at home 3 both problems occur. do repeat a=new1 to new144 /b=eloc1 to eloc144. If a=8 and b=3 residual=1. End repeat. freq residual. do repeat a=new1 to new144 /b=eloc1 to eloc144. Do if residual=1. if (b=1 and (a=5 or a=7 or a=9 or a=11 or a=12 or a=13)) residual=3. Else if residual=0. if (b=1 and (a=5 or a=7 or a=9 or a=11 or a=12 or a=13)) residual=2. End if. End repeat. freq residual. *no location problem in 98.1% of cases. *5 cases where both problems occur. *24 cases where people work at home at the workplace. *265 cases of working at the office at home. sort cases by residual (d). *address 5 cases of both problems. Do if hldid=2408068440 and persid=2. recode new52 (7=8). recode new58 to new81 (8=7). recode new109 to new111 (7=8). Else if hldid=4106028760 and persid=1. recode new1 to new144 (8=7). Else if hldid=5201005550 and persid=1. recode new82 to new83 (7=8). recode new84 to new87 (8=7). recode new98 to new102 (8=7). recode new104 to new107 (7=8). Else if hldid=5208057650 and persid=3. recode new118 (8=7). recode new121 to new122 (7=8). recode eloc91 to eloc105 (3=9). Else if hldid=5208058950 and persid=2. recode new43 to new50 (8=7). End if. *address 25 cases with work in office at home, fix errors identified reading *these diaries. Do if (hldid=1101009160 and persid=2) or (hldid=1102024110 and persid=2) or (hldid=1102035190 and persid=2) or (hldid=1103047410 and persid=1) or (hldid=1103053150 and persid=1) or (hldid=1104070470 and persid=2) or (hldid=1104073310 and persid=2) or (hldid=1105083540 and persid=1) or (hldid=1105092520 and persid=1) or (hldid=1105098810 and persid=2) or (hldid=1106120500 and persid=2). recode new1 to new144 (7=8). Else if hldid=1101012631 and persid=1. recode eloc117 to eloc120 (1=3). Else if hldid=1101020530 and persid=1. recode new78 (7=8). recode new86 (7=8). recode new87 (7=8). recode new122 (7=8). Else if hldid=1102026170 and persid=1. recode new75 to new77 (5=6). Else if hldid=1102032410 and persid=1. recode eloc76 to eloc81 (1=3). Else if hldid=1103046060 and persid=1. recode new44 (7=8). recode new46 to new50 (7=8). recode eloc121 to eloc144 (1=3). Else if hldid=1103046330 and persid=1. recode new121 to new138 (7=8). Else if hldid=1104074050 and persid=1. recode new106 to new107 (7=8). Else if hldid=1104081740 and persid=1. recode eloc60 (1=3). recode eloc64 to eloc69 (1=3). Else if hldid=1105086880 and persid=1. recode new48 to new54 (7=8). recode new121 to new124 (7=8). Else if hldid=1106109460 and persid=2. recode new52 to new54 (7=8). recode eloc85 to eloc108 (1=3). Else if hldid=1106109680 and persid=2. recode new52 to new54 (7=8). recode eloc68 to eloc72 (1=3). Else if hldid=1107128900 and persid=1. recode eloc109 to eloc114 (1=3). End if. do repeat a=new1 to new144 /b=eloc1 to eloc144. If a=8 and b=3 a=7. End repeat. execute. do repeat a=new1 to new144 /b=old1 to old144. If a=8 and b=1 b=2. If (a=7 or a=12 or a=13) and b=2 b=1. End repeat. sort cases by hldid persid. vector sec(144). do repeat a=actse1 to actse144 /b=sec1 to sec144 /c=eloc1 to eloc144. Do if a=109. compute b=1. Else if a=110. compute b=3. Else if a=111. compute b=2. Else if a=121 or a=122 or a=151. compute b=4. Else if a=123 or a=124. compute b=25. Else if a=131. compute b=4. Else if a=132 or a=133. compute b=25. Else if a=141 or a=144. compute b=6. Else if a=142 or a=145. compute b=5. Else if a=143 or a=146. Do if c=2. compute b=6. Else. compute b=39. End if. Else if a=211 or a=214. compute b=7. Else if a=212. compute b=8. Else if a=213. compute b=11. Else if a=221 or a=223. compute b=9. Else if a=231. compute b=12. Else if a=233. compute b=13. Else if a=232 or a=234. compute b=33. Else if a=241. compute b=14. Else if a=251 or a=252. compute b=7. Else if a=261 or a=263. compute b=15. Else if a=262 or a=264. compute b=16. Else if a=271 or a=272. compute b=17. Else if a=310 or a=311 or a=314 or a=319. compute b=18. Else if a=312 or a=313. compute b=19. Else if a>319 and a<330. compute b=20. Else if (a>329 and a<333) or a=335 or a=339. compute b=21. Else if a=333 or a=334. compute b=54. Else if a=341 or a=372 or a=375. compute b=22. Else if a=340 or (a>341 and a<350). compute b=23. Else if a=350 or a=351 or a=359. compute b=24. Else if a=352 or a=360 or a=361 or a=369. compute b=26. Else if a=376. compute b=27. Else if (a>409 and a<414). compute b=28. Else if a=420 or a=421 or a=429. compute b=29. Else if a=422 or a=423 or a=424. compute b=30. Else if a=414 or a=419. compute b=31. Else if (a>429 and a<440). compute b=32. Else if a=625. compute b=45. Else if a=652. compute b=37. Else if a=610 or a=611 or a=612. compute b=42. Else if a=651. compute b=36. Else if a=621 or a=622. compute b=43. Else if a=623 or a=624. compute b=46. Else if a=531 or a=532 or a=533. compute b=34. Else if a=541 or a=542 or a=543. compute b=33. Else if a=653. compute b=37. Else if a=654. compute b=38. Else if a=620. compute b=40. Else if a=511 or a=512. compute b=48. Else if a=636. compute b=58. Else if a=634 or a=635. compute b=59. Else if a=637. compute b=57. Else if a=631 or a=632. compute b=56. Else if a=631 or a=632 or a=633. compute b=56. Else if a=374. compute b=46. Else if a=370 or a=377 or a=379. compute b=51. Else if a=371 or a=661. compute b=52. Else if a=373. compute b=54. Else if a=668. compute b=51. Else if a=667. compute b=50. Else if a=666. compute b=60. Else if a=665. compute b=52. Else if a=664. compute b=54. Else if a=523. compute b=53. Else if a=641. compute b=55. Else if a=524 or a=529. compute b=50. Else if a=520 or a=521 or a=522. compute b=49. Else if a=513. compute b=35. Else if a=510 or a=662 or a=663. compute b=40. Else if a=810. compute b=67. Else if a=812. compute b=68. Else if a=819. compute b=65. Else if a=813. compute b=66. Else if a=811. compute b=63. Else if a=911. compute b=33. Else if a=999. compute b=69. Else. compute residual2=a. End if. end repeat. freq residual2. *good, residual having no cases means all elements of the diary have been assigned to an MTUS code. *now code in the missed travel as a secondary activity. vector new=new1 to new144 /sec=sec1 to sec144 /eloc=eloc1 to eloc144. loop i=1 to 143. Do if sec(i)=69 and eloc(i)~=eloc(j) and ((eloc(i)<6 or eloc(i)=7 or eloc(i)=9) and (eloc(j)<6 or eloc(j)=7 or eloc(j)=9)) and (new(i)<11 or (new(i)>11 and new(i)<63)) and (new(j)<11 or (new(j)>11 and new(j)<63)) and (sec(j)<11 or (sec(j)>11 and sec(j)<63) or sec(j)=69). compute sec(i)=62. Else if sec(j)=69 and eloc(i)~=eloc(j) and ((eloc(i)<6 or eloc(i)=7 or eloc(i)=9) and (eloc(j)<6 or eloc(j)=7 or eloc(j)=9)) and (new(i)<11 or (new(i)>11 and new(i)<63)) and (new(j)<11 or (new(j)>11 and new(j)<63)) and (sec(i)<11 or (sec(i)>11 and sec(i)<63) or sec(i)=69). compute sec(j)=62. End if. end loop. freq sec1 to sec144. *make who else is present variables. freq presp1 to presp144. *not possible to create child or sppart. vector alonea(144) oada(144). Do repeat a=presp1 to presp144 /b=alonea1 to alonea144 /c=oada1 to oada144. Do if a=1. compute b=1. compute c=0. Else if a>1 and a<999. compute b=0. compute c=1. Else. compute b=0. compute c=0. End if. End repeat. cro presp50 by alonea50 oada50. *create badcase. compute miss=0. compute carflag=0. compute eatdrk=0. compute trav=0. compute rst=0. compute pcare=0. do repeat a=new1 to new144 / b=sec1 to sec144 / c=eloc1 to eloc144. If a=69 miss=miss+10. if (a>26 and a<33) or (b>26 and b<33) or carer=1 carflag=1. if a=5 or b=5 or a=6 or b=6 or a=18 or b=18 or a=19 or b=19 or a=39 or b=39 eatdrk=1. if c=8 or a=11 or b=11 or (a>41 and a<48) or (b>41 and b<48) or (a>62 and a<69) or (b>62 and b<69) trav=1. if a=2 or b=2 or a=3 or b=3 or a=12 or b=12 or a=55 or b=55 rst=1. if a=1 or b=1 or a=4 or b=4 or a=25 or b=25 pcare=1. end repeat. cro carflag by carer. freq miss carflag eatdrk trav rst pcare age sex day. *no diaries are missing the age, sex of the diarist; and no diaries *are missing main activity or rest. *2560 diaries are missing travel/exercise; 550 diaries are missing *personal care, 12 diaries are missing eating or drinking. compute misbasic=0. If eatdrk=0 misbasic=misbasic+1. If trav=0 misbasic=misbasic+1. If rst=0 misbasic=misbasic+1. If pcare=0 misbasic=misbasic+1. freq misbasic. *12478 (80.8%) diaries missing no basic information; *2805 (18.2%) missing only 1 basic activity. *99% of diaries not missing basic information; *158 diaries missing 2 or 3 basic activities. vector new=new1 to new144 / sec=sec1 to sec144 / eloc=eloc1 to eloc144. Loop i=1 to 143. Do if misbasic>0 and pcare=0 and ((new(i)>1 and new(i)<7) or (sec(i)>1 and sec(i)<7) or (new(i)>41 and new(i)<48) or (sec(i)>41 and sec(i)<48)) and (new(j)>6 or sec(j)>6). compute misbasic=misbasic-1. compute pcare=1. Else if misbasic>0 and trav=0 and eloc(i)~=eloc(j) and ((eloc(i)<6 or eloc(i)=7 or eloc(i)=9) and (eloc(j)<6 or eloc(j)=7 or eloc(j)=9)) and (new(i)<11 or (new(i)>11 and new(i)<63)) and (new(j)<11 or (new(j)>11 and new(j)<63)) and (sec(j)<11 or (sec(j)>11 and sec(j)<63) or sec(j)=69). compute misbasic=misbasic-1. Else if misbasic>0 and trav=0 and eloc(i)~=eloc(j) and ((eloc(i)<6 or eloc(i)=7 or eloc(i)=9) and (eloc(j)<6 or eloc(j)=7 or eloc(j)=9)) and (new(i)<11 or (new(i)>11 and new(i)<63)) and (new(j)<11 or (new(j)>11 and new(j)<63)) and (sec(j)<11 or (sec(j)>11 and sec(j)<63) or sec(j)=69). compute misbasic=misbasic-1. compute trav=1. End if. End loop. freq misbasic. *14457 (93.6%) diaries missing no basic information; *979 (6.3%) missing only 1 basic activity. *only 5 diaries missing 2 basic activities. cro misbasic by carflag. *these 5 diaries are not the diaries of carers. *make time use variables. vector main(60) /av(60) /seca(60) /eloca(60) /ino(60) /alone(60) /oad(60) /start(60) /end(60) /timetest(60). Do repeat a=main1 to main60 /b=av1 to av60 /c=seca1 to seca60 /d=eloca1 to eloca60 /e=ino1 to ino60 /f=alone1 to alone60 /g=oad1 to oad60 /h=start1 to start60 /i=end1 to end60 /j=timetest1 to timetest60. compute a=0. compute b=0. compute c=0. compute d=0. compute e=0. compute f=0. compute g=0. compute h=0. compute i=0. compute j=0. End repeat. compute main1=new1. compute av1=old1. compute seca1=sec1. compute eloca1=eloc1. compute ino1=inout1. compute alone1=alonea1. compute oad1=oada1. compute end1=10. compute timetest1=10. freq main1 main10 av1 av10 seca1 seca10 eloca1 eloca10 ino1 ino10 alone1 alone10 oad1 oad10 start1 start10 end1 end10. vector new=new1 to new144 /old=old1 to old144 /sec=sec1 to sec144 /eloc=eloc1 to eloc144 /inout=inout1 to inout144 /alonea=alonea1 to alonea144 /oada=oada1 to oada144. Loop i=1 to 143. compute j=i+1. Do if main2=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end1=end1+10. compute timetest1=timetest1+10. Else if main2=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main2=new(i). compute av2=old(i). compute seca2=sec(i). compute eloca2=eloc(i). compute ino2=inout(i). compute alone2=alonea(i). compute oad2=oada(i). compute start2=end1. compute end2=end1+10. compute timetest2=10. Else if main3=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end2=end2+10. compute timetest2=timetest2+10. Else if main3=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main3=new(i). compute av3=old(i). compute seca3=sec(i). compute eloca3=eloc(i). compute ino3=inout(i). compute alone3=alonea(i). compute oad3=oada(i). compute start3=end2. compute end3=end2+10. compute timetest3=10. Else if main4=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end3=end3+10. compute timetest3=timetest3+10. Else if main4=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main4=new(i). compute av4=old(i). compute seca4=sec(i). compute eloca4=eloc(i). compute ino4=inout(i). compute alone4=alonea(i). compute oad4=oada(i). compute start4=end3. compute end4=end3+10. compute timetest4=10. Else if main5=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end4=end4+10. compute timetest4=timetest4+10. Else if main5=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main5=new(i). compute av5=old(i). compute seca5=sec(i). compute eloca5=eloc(i). compute ino5=inout(i). compute alone5=alonea(i). compute oad5=oada(i). compute start5=end4. compute end5=end4+10. compute timetest5=10. Else if main6=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end5=end5+10. compute timetest5=timetest5+10. Else if main6=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main6=new(i). compute av6=old(i). compute seca6=sec(i). compute eloca6=eloc(i). compute ino6=inout(i). compute alone6=alonea(i). compute oad6=oada(i). compute start6=end5. compute end6=end5+10. compute timetest6=10. Else if main7=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end6=end6+10. compute timetest6=timetest6+10. Else if main7=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main7=new(i). compute av7=old(i). compute seca7=sec(i). compute eloca7=eloc(i). compute ino7=inout(i). compute alone7=alonea(i). compute oad7=oada(i). compute start7=end6. compute end7=end6+10. compute timetest7=10. Else if main8=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end7=end7+10. compute timetest7=timetest7+10. Else if main8=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main8=new(i). compute av8=old(i). compute seca8=sec(i). compute eloca8=eloc(i). compute ino8=inout(i). compute alone8=alonea(i). compute oad8=oada(i). compute start8=end7. compute end8=end7+10. compute timetest8=10. Else if main9=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end8=end8+10. compute timetest8=timetest8+10. Else if main9=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main9=new(i). compute av9=old(i). compute seca9=sec(i). compute eloca9=eloc(i). compute ino9=inout(i). compute alone9=alonea(i). compute oad9=oada(i). compute start9=end8. compute end9=end8+10. compute timetest9=10. Else if main10=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end9=end9+10. compute timetest9=timetest9+10. Else if main10=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main10=new(i). compute av10=old(i). compute seca10=sec(i). compute eloca10=eloc(i). compute ino10=inout(i). compute alone10=alonea(i). compute oad10=oada(i). compute start10=end9. compute end10=end9+10. compute timetest10=10. Else if main11=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end10=end10+10. compute timetest10=timetest10+10. Else if main11=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main11=new(i). compute av11=old(i). compute seca11=sec(i). compute eloca11=eloc(i). compute ino11=inout(i). compute alone11=alonea(i). compute oad11=oada(i). compute start11=end10. compute end11=end10+10. compute timetest11=10. Else if main12=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end11=end11+10. compute timetest11=timetest11+10. Else if main12=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main12=new(i). compute av12=old(i). compute seca12=sec(i). compute eloca12=eloc(i). compute ino12=inout(i). compute alone12=alonea(i). compute oad12=oada(i). compute start12=end11. compute end12=end11+10. compute timetest12=10. Else if main13=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end12=end12+10. compute timetest12=timetest12+10. Else if main13=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main13=new(i). compute av13=old(i). compute seca13=sec(i). compute eloca13=eloc(i). compute ino13=inout(i). compute alone13=alonea(i). compute oad13=oada(i). compute start13=end12. compute end13=end12+10. compute timetest13=10. Else if main14=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end13=end13+10. compute timetest13=timetest13+10. Else if main14=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main14=new(i). compute av14=old(i). compute seca14=sec(i). compute eloca14=eloc(i). compute ino14=inout(i). compute alone14=alonea(i). compute oad14=oada(i). compute start14=end13. compute end14=end13+10. compute timetest14=10. Else if main15=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end14=end14+10. compute timetest14=timetest14+10. Else if main15=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main15=new(i). compute av15=old(i). compute seca15=sec(i). compute eloca15=eloc(i). compute ino15=inout(i). compute alone15=alonea(i). compute oad15=oada(i). compute start15=end14. compute end15=end14+10. compute timetest15=10. Else if main16=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end15=end15+10. compute timetest15=timetest15+10. Else if main16=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main16=new(i). compute av16=old(i). compute seca16=sec(i). compute eloca16=eloc(i). compute ino16=inout(i). compute alone16=alonea(i). compute oad16=oada(i). compute start16=end15. compute end16=end15+10. compute timetest16=10. Else if main17=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end16=end16+10. compute timetest16=timetest16+10. Else if main17=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main17=new(i). compute av17=old(i). compute seca17=sec(i). compute eloca17=eloc(i). compute ino17=inout(i). compute alone17=alonea(i). compute oad17=oada(i). compute start17=end16. compute end17=end16+10. compute timetest17=10. Else if main18=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end17=end17+10. compute timetest17=timetest17+10. Else if main18=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main18=new(i). compute av18=old(i). compute seca18=sec(i). compute eloca18=eloc(i). compute ino18=inout(i). compute alone18=alonea(i). compute oad18=oada(i). compute start18=end17. compute end18=end17+10. compute timetest18=10. Else if main19=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end18=end18+10. compute timetest18=timetest18+10. Else if main19=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main19=new(i). compute av19=old(i). compute seca19=sec(i). compute eloca19=eloc(i). compute ino19=inout(i). compute alone19=alonea(i). compute oad19=oada(i). compute start19=end18. compute end19=end18+10. compute timetest19=10. Else if main20=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end19=end19+10. compute timetest19=timetest19+10. Else if main20=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main20=new(i). compute av20=old(i). compute seca20=sec(i). compute eloca20=eloc(i). compute ino20=inout(i). compute alone20=alonea(i). compute oad20=oada(i). compute start20=end19. compute end20=end19+10. compute timetest20=10. Else if main21=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end20=end20+10. compute timetest20=timetest20+10. Else if main21=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main21=new(i). compute av21=old(i). compute seca21=sec(i). compute eloca21=eloc(i). compute ino21=inout(i). compute alone21=alonea(i). compute oad21=oada(i). compute start21=end20. compute end21=end20+10. compute timetest21=10. Else if main22=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end21=end21+10. compute timetest21=timetest21+10. Else if main22=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main22=new(i). compute av22=old(i). compute seca22=sec(i). compute eloca22=eloc(i). compute ino22=inout(i). compute alone22=alonea(i). compute oad22=oada(i). compute start22=end21. compute end22=end21+10. compute timetest22=10. Else if main23=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end22=end22+10. compute timetest22=timetest22+10. Else if main23=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main23=new(i). compute av23=old(i). compute seca23=sec(i). compute eloca23=eloc(i). compute ino23=inout(i). compute alone23=alonea(i). compute oad23=oada(i). compute start23=end22. compute end23=end22+10. compute timetest23=10. Else if main24=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end23=end23+10. compute timetest23=timetest23+10. Else if main24=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main24=new(i). compute av24=old(i). compute seca24=sec(i). compute eloca24=eloc(i). compute ino24=inout(i). compute alone24=alonea(i). compute oad24=oada(i). compute start24=end23. compute end24=end23+10. compute timetest24=10. Else if main25=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end24=end24+10. compute timetest24=timetest24+10. Else if main25=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main25=new(i). compute av25=old(i). compute seca25=sec(i). compute eloca25=eloc(i). compute ino25=inout(i). compute alone25=alonea(i). compute oad25=oada(i). compute start25=end24. compute end25=end24+10. compute timetest25=10. Else if main26=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end25=end25+10. compute timetest25=timetest25+10. Else if main26=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main26=new(i). compute av26=old(i). compute seca26=sec(i). compute eloca26=eloc(i). compute ino26=inout(i). compute alone26=alonea(i). compute oad26=oada(i). compute start26=end25. compute end26=end25+10. compute timetest26=10. Else if main27=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end26=end26+10. compute timetest26=timetest26+10. Else if main27=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main27=new(i). compute av27=old(i). compute seca27=sec(i). compute eloca27=eloc(i). compute ino27=inout(i). compute alone27=alonea(i). compute oad27=oada(i). compute start27=end26. compute end27=end26+10. compute timetest27=10. Else if main28=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end27=end27+10. compute timetest27=timetest27+10. Else if main28=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main28=new(i). compute av28=old(i). compute seca28=sec(i). compute eloca28=eloc(i). compute ino28=inout(i). compute alone28=alonea(i). compute oad28=oada(i). compute start28=end27. compute end28=end27+10. compute timetest28=10. Else if main29=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end28=end28+10. compute timetest28=timetest28+10. Else if main29=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main29=new(i). compute av29=old(i). compute seca29=sec(i). compute eloca29=eloc(i). compute ino29=inout(i). compute alone29=alonea(i). compute oad29=oada(i). compute start29=end28. compute end29=end28+10. compute timetest29=10. Else if main30=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end29=end29+10. compute timetest29=timetest29+10. Else if main30=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main30=new(i). compute av30=old(i). compute seca30=sec(i). compute eloca30=eloc(i). compute ino30=inout(i). compute alone30=alonea(i). compute oad30=oada(i). compute start30=end29. compute end30=end29+10. compute timetest30=10. Else if main31=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end30=end30+10. compute timetest30=timetest30+10. Else if main31=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main31=new(i). compute av31=old(i). compute seca31=sec(i). compute eloca31=eloc(i). compute ino31=inout(i). compute alone31=alonea(i). compute oad31=oada(i). compute start31=end30. compute end31=end30+10. compute timetest31=10. Else if main32=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end31=end31+10. compute timetest31=timetest31+10. Else if main32=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main32=new(i). compute av32=old(i). compute seca32=sec(i). compute eloca32=eloc(i). compute ino32=inout(i). compute alone32=alonea(i). compute oad32=oada(i). compute start32=end31. compute end32=end31+10. compute timetest32=10. Else if main33=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end32=end32+10. compute timetest32=timetest32+10. Else if main33=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main33=new(i). compute av33=old(i). compute seca33=sec(i). compute eloca33=eloc(i). compute ino33=inout(i). compute alone33=alonea(i). compute oad33=oada(i). compute start33=end32. compute end33=end32+10. compute timetest33=10. Else if main34=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end33=end33+10. compute timetest33=timetest33+10. Else if main34=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main34=new(i). compute av34=old(i). compute seca34=sec(i). compute eloca34=eloc(i). compute ino34=inout(i). compute alone34=alonea(i). compute oad34=oada(i). compute start34=end33. compute end34=end33+10. compute timetest34=10. Else if main35=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end34=end34+10. compute timetest34=timetest34+10. Else if main35=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main35=new(i). compute av35=old(i). compute seca35=sec(i). compute eloca35=eloc(i). compute ino35=inout(i). compute alone35=alonea(i). compute oad35=oada(i). compute start35=end34. compute end35=end34+10. compute timetest35=10. Else if main36=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end35=end35+10. compute timetest35=timetest35+10. Else if main36=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main36=new(i). compute av36=old(i). compute seca36=sec(i). compute eloca36=eloc(i). compute ino36=inout(i). compute alone36=alonea(i). compute oad36=oada(i). compute start36=end35. compute end36=end35+10. compute timetest36=10. Else if main37=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end36=end36+10. compute timetest36=timetest36+10. Else if main37=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main37=new(i). compute av37=old(i). compute seca37=sec(i). compute eloca37=eloc(i). compute ino37=inout(i). compute alone37=alonea(i). compute oad37=oada(i). compute start37=end36. compute end37=end36+10. compute timetest37=10. Else if main38=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end37=end37+10. compute timetest37=timetest37+10. Else if main38=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main38=new(i). compute av38=old(i). compute seca38=sec(i). compute eloca38=eloc(i). compute ino38=inout(i). compute alone38=alonea(i). compute oad38=oada(i). compute start38=end37. compute end38=end37+10. compute timetest38=10. Else if main39=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end38=end38+10. compute timetest38=timetest38+10. Else if main39=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main39=new(i). compute av39=old(i). compute seca39=sec(i). compute eloca39=eloc(i). compute ino39=inout(i). compute alone39=alonea(i). compute oad39=oada(i). compute start39=end38. compute end39=end38+10. compute timetest39=10. Else if main40=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end39=end39+10. compute timetest39=timetest39+10. Else if main40=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main40=new(i). compute av40=old(i). compute seca40=sec(i). compute eloca40=eloc(i). compute ino40=inout(i). compute alone40=alonea(i). compute oad40=oada(i). compute start40=end39. compute end40=end39+10. compute timetest40=10. Else if main41=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end40=end40+10. compute timetest40=timetest40+10. Else if main41=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main41=new(i). compute av41=old(i). compute seca41=sec(i). compute eloca41=eloc(i). compute ino41=inout(i). compute alone41=alonea(i). compute oad41=oada(i). compute start41=end40. compute end41=end40+10. compute timetest41=10. Else if main42=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end41=end41+10. compute timetest41=timetest41+10. Else if main42=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main42=new(i). compute av42=old(i). compute seca42=sec(i). compute eloca42=eloc(i). compute ino42=inout(i). compute alone42=alonea(i). compute oad42=oada(i). compute start42=end41. compute end42=end41+10. compute timetest42=10. Else if main43=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end42=end42+10. compute timetest42=timetest42+10. Else if main43=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main43=new(i). compute av43=old(i). compute seca43=sec(i). compute eloca43=eloc(i). compute ino43=inout(i). compute alone43=alonea(i). compute oad43=oada(i). compute start43=end42. compute end43=end42+10. compute timetest43=10. Else if main44=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end43=end43+10. compute timetest43=timetest43+10. Else if main44=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main44=new(i). compute av44=old(i). compute seca44=sec(i). compute eloca44=eloc(i). compute ino44=inout(i). compute alone44=alonea(i). compute oad44=oada(i). compute start44=end43. compute end44=end43+10. compute timetest44=10. Else if main45=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end44=end44+10. compute timetest44=timetest44+10. Else if main45=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main45=new(i). compute av45=old(i). compute seca45=sec(i). compute eloca45=eloc(i). compute ino45=inout(i). compute alone45=alonea(i). compute oad45=oada(i). compute start45=end44. compute end45=end44+10. compute timetest45=10. Else if main46=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end45=end45+10. compute timetest45=timetest45+10. Else if main46=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main46=new(i). compute av46=old(i). compute seca46=sec(i). compute eloca46=eloc(i). compute ino46=inout(i). compute alone46=alonea(i). compute oad46=oada(i). compute start46=end45. compute end46=end45+10. compute timetest46=10. Else if main47=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end46=end46+10. compute timetest46=timetest46+10. Else if main47=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main47=new(i). compute av47=old(i). compute seca47=sec(i). compute eloca47=eloc(i). compute ino47=inout(i). compute alone47=alonea(i). compute oad47=oada(i). compute start47=end46. compute end47=end46+10. compute timetest47=10. Else if main48=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end47=end47+10. compute timetest47=timetest47+10. Else if main48=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main48=new(i). compute av48=old(i). compute seca48=sec(i). compute eloca48=eloc(i). compute ino48=inout(i). compute alone48=alonea(i). compute oad48=oada(i). compute start48=end47. compute end48=end47+10. compute timetest48=10. Else if main49=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end48=end48+10. compute timetest48=timetest48+10. Else if main49=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main49=new(i). compute av49=old(i). compute seca49=sec(i). compute eloca49=eloc(i). compute ino49=inout(i). compute alone49=alonea(i). compute oad49=oada(i). compute start49=end48. compute end49=end48+10. compute timetest49=10. Else if main50=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end49=end49+10. compute timetest49=timetest49+10. Else if main50=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main50=new(i). compute av50=old(i). compute seca50=sec(i). compute eloca50=eloc(i). compute ino50=inout(i). compute alone50=alonea(i). compute oad50=oada(i). compute start50=end49. compute end50=end49+10. compute timetest50=10. Else if main51=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end50=end50+10. compute timetest50=timetest50+10. Else if main51=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main51=new(i). compute av51=old(i). compute seca51=sec(i). compute eloca51=eloc(i). compute ino51=inout(i). compute alone51=alonea(i). compute oad51=oada(i). compute start51=end50. compute end51=end50+10. compute timetest51=10. Else if main52=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end51=end51+10. compute timetest51=timetest51+10. Else if main52=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main52=new(i). compute av52=old(i). compute seca52=sec(i). compute eloca52=eloc(i). compute ino52=inout(i). compute alone52=alonea(i). compute oad52=oada(i). compute start52=end51. compute end52=end51+10. compute timetest52=10. Else if main53=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end52=end52+10. compute timetest52=timetest52+10. Else if main53=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main53=new(i). compute av53=old(i). compute seca53=sec(i). compute eloca53=eloc(i). compute ino53=inout(i). compute alone53=alonea(i). compute oad53=oada(i). compute start53=end52. compute end53=end52+10. compute timetest53=10. Else if main54=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end53=end53+10. compute timetest53=timetest53+10. Else if main54=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main54=new(i). compute av54=old(i). compute seca54=sec(i). compute eloca54=eloc(i). compute ino54=inout(i). compute alone54=alonea(i). compute oad54=oada(i). compute start54=end53. compute end54=end53+10. compute timetest54=10. Else if main55=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end54=end54+10. compute timetest54=timetest54+10. Else if main55=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main55=new(i). compute av55=old(i). compute seca55=sec(i). compute eloca55=eloc(i). compute ino55=inout(i). compute alone55=alonea(i). compute oad55=oada(i). compute start55=end54. compute end55=end54+10. compute timetest55=10. Else if main56=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end55=end55+10. compute timetest55=timetest55+10. Else if main56=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main56=new(i). compute av56=old(i). compute seca56=sec(i). compute eloca56=eloc(i). compute ino56=inout(i). compute alone56=alonea(i). compute oad56=oada(i). compute start56=end55. compute end56=end55+10. compute timetest56=10. Else if main57=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end56=end56+10. compute timetest56=timetest56+10. Else if main57=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main57=new(i). compute av57=old(i). compute seca57=sec(i). compute eloca57=eloc(i). compute ino57=inout(i). compute alone57=alonea(i). compute oad57=oada(i). compute start57=end56. compute end57=end56+10. compute timetest57=10. Else if main58=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end57=end57+10. compute timetest57=timetest57+10. Else if main58=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main58=new(i). compute av58=old(i). compute seca58=sec(i). compute eloca58=eloc(i). compute ino58=inout(i). compute alone58=alonea(i). compute oad58=oada(i). compute start58=end57. compute end58=end57+10. compute timetest58=10. Else if main59=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end58=end58+10. compute timetest58=timetest58+10. Else if main59=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main59=new(i). compute av59=old(i). compute seca59=sec(i). compute eloca59=eloc(i). compute ino59=inout(i). compute alone59=alonea(i). compute oad59=oada(i). compute start59=end58. compute end59=end58+10. compute timetest59=10. Else if main60=0 and new(i)=new(j) and sec(i)=sec(j) and eloc(i)=eloc(j). compute end59=end59+10. compute timetest59=timetest59+10. Else if main60=0 and (new(i)~=new(j) or sec(i)~=sec(j) or eloc(i)~=eloc(j)). compute main60=new(i). compute av60=old(i). compute seca60=sec(i). compute eloca60=eloc(i). compute ino60=inout(i). compute alone60=alonea(i). compute oad60=oada(i). compute start60=end59. compute end60=end59+10. compute timetest60=10. End if. End loop. freq av3 seca4 eloca5 ino6 av7 seca8 eloca9 start40. freq end10 end19 end25 end37 end60. *51.5% have fewer than 20 episodes. *93.4% have fewer than 30 episodes. *99.3% have fewer than 40 episodes. *99.9% have fewer than 50 episodes. *1 case has 60 episodes. vector t(60). do repeat a=start1 to start60 /b=end1 to end60 /c=t1 to t60. compute c=b-a. end repeat. compute test=sum(t1 to t60). compute test1=sum(timetest1 to timetest60). freq test test1. recode miss (0 thru 90=0) (91 thru hi=1). recode ino6 (0=1) (else=0) into nep. recode misbasic (0,1=0) (2,3,4=1). compute baddiary=0. if miss=1 or nep=1 or misbasic=1 baddiary=1. freq baddiary miss nep misbasic. cro miss by nep by misbasic. *15430 (99.9%) of diaries of quality; * 0 diaries bad on two or all three criteria * 11 bad on 1 criteria (6 have 6 or fewer episodes; 5 missing 2+ basic acts). *As no sex or age missing, only the diary quality variables determine bad case. Do If baddiary=0 and sex>-8 and age>-8 and day>-8. compute badcase=0. Else if baddiary=0 and (sex=-8 or age=-8) and day>-8. compute badcase=1. Else if baddiary=0 and sex>-8 and age>-8 and day=-8. compute badcase=2. Else if sex>-8 and age>-8 and day>-8 and nep=0 and miss=1 and misbasic=0. compute badcase=3. Else if sex>-8 and age>-8 and day>-8 and nep=1 and miss=0 and misbasic=0. compute badcase=4. Else if sex>-8 and age>-8 and day>-8 and nep=0 and miss=0 and misbasic=1. compute badcase=5. Else if (sex=-8 or age=-8) and day=-8 and nep=0 and miss=0 and misbasic=0. compute badcase=6. Else if (sex=-8 or age=-8) and day>-8 and nep=0 and miss=1 and misbasic=0. compute badcase=7. Else if (sex=-8 or age=-8) and day>-8 and nep=1 and miss=0 and misbasic=0. compute badcase=8. Else if (sex=-8 or age=-8) and day>-8 and nep=0 and miss=0 and misbasic=1. compute badcase=9. Else if sex>-8 and age>-8 and day=-8 and nep=0 and miss=1 and misbasic=0. compute badcase=10. Else if sex>-8 and age>-8 and day=-8 and nep=1 and miss=0 and misbasic=0. compute badcase=11. Else if sex>-8 and age>-8 and day=-8 and nep=0 and miss=0 and misbasic=1. compute badcase=12. Else if sex>-8 and age>-8 and day>-8 and nep=1 and miss=1 and misbasic=0. compute badcase=13. Else if sex>-8 and age>-8 and day>-8 and nep=0 and miss=1 and misbasic=1. compute badcase=14. Else if sex>-8 and age>-8 and day>-8 and nep=1 and miss=0 and misbasic=1. compute badcase=15. Else if (sex=-8 or age=-8) and day=-8 and nep=0 and miss=1 and misbasic=0. compute badcase=16. Else if (sex=-8 or age=-8) and day=-8 and nep=1 and miss=0 and misbasic=0. compute badcase=17. Else if (sex=-8 or age=-8) and day=-8 and nep=0 and miss=0 and misbasic=1. compute badcase=18. Else if (sex=-8 or age=-8) and day>-8 and nep=1 and miss=1 and misbasic=0. compute badcase=19. Else if (sex=-8 or age=-8) and day>-8 and nep=0 and miss=1 and misbasic=1. compute badcase=20. Else if (sex=-8 or age=-8) and day>-8 and nep=1 and miss=0 and misbasic=1. compute badcase=21. Else if sex>-8 and age>-8 and day=-8 and nep=1 and miss=1 and misbasic=0. compute badcase=22. Else if sex>-8 and age>-8 and day=-8 and nep=0 and miss=1 and misbasic=1. compute badcase=23. Else if sex>-8 and age>-8 and day=-8 and nep=1 and miss=0 and misbasic=1. compute badcase=24. Else if sex>-8 and age>-8 and day>-8 and nep=1 and miss=1 and misbasic=1. compute badcase=25. Else if (sex=-8 or age=-8) and day=-8 and nep=1 and miss=1 and misbasic=0. compute badcase=26. Else if (sex=-8 or age=-8) and day=-8 and nep=0 and miss=1 and misbasic=1. compute badcase=27. Else if (sex=-8 or age=-8) and day=-8 and nep=1 and miss=0 and misbasic=1. compute badcase=28. Else if (sex=-8 or age=-8) and day>-8 and nep=1 and miss=1 and misbasic=1. compute badcase=29. Else if sex>-8 and age>-8 and day=-8 and nep=1 and miss=1 and misbasic=1. compute badcase=30. Else. compute badcase=31. End if. val lab badcase 0 good case 1 miss age or sex only 2 miss day of week only 3 "miss 91+ minutes only" 4 "<7 episodes only" 5 "miss 2+ basic acts only" 6 "miss age/sex + day of week" 7 "miss age/sex + 91+ min" 8 "miss age/sex + <7 episodes" 9 "miss age/sex + 2+ basic acts" 10 "miss day of week + 91+ min" 11 "miss day of week + <7 episodes" 12 "miss day of week + 2+ basic acts" 13 "miss 91+ min + <7 episodes" 14 "miss 91+ min + 2+ basic acts" 15 "<7 ep & miss 2+ basic acts" 16 "miss age/sex + day or week + 91+ min" 17 "miss age/sex + day or week + <7 episodes" 18 "miss age/sex + day or week + 2+ basic acts" 19 "miss age/sex + 91+ min + <7 eps" 20 "miss age/sex + 91+ min + 2+ basic acts" 21 "miss age/sex + 2+ basic acts + <7 eps" 22 "miss day or week + 91+ min + <7 eps" 23 "miss day or week + 91+ min + 2+ basic acts" 24 "miss day or week + 2+ basic acts + <7 eps" 25 "miss 91+ min + 2+ basic acts + <7 eps" 26 "miss age/sex + day or week + 91+ min + <7 episodes" 27 "miss age/sex + day or week + 91+ min + 2+ basic acts" 28 "miss age/sex + day or week + <7 episodes + 2+ basic acts" 29 "miss age/sex + 91+ min + <7 episodes + 2+ basic acts" 30 "day or week + 91+ min + <7 episodes + 2+ basic acts" 31 bad on all five points. *check that all cases have a code. freq badcase. *double check that all correctly coded. cro badcase by sex day nep miss misbasic. recode badcase (0=0) (else=1) into nowght. cro badcase by nowght. *create clockst. vector clock(60). compute clock1=4. formats clock1 to clock60 (f6.2). Do repeat a=start1 to start60 / b= clock1 to clock60. Do if a<60. compute b=4+a/100. Else if a>59 and a<120. compute b=5+(a-60)/100. Else if a>119 and a<180. compute b=6+(a-120)/100. Else if a>179 and a<240. compute b=7+(a-180)/100. Else if a>239 and a<300. compute b=8+(a-240)/100. Else if a>299 and a<360. compute b=9+(a-300)/100. Else if a>359 and a<420. compute b=10+(a-360)/100. Else if a>419 and a<480. compute b=11+(a-420)/100. Else if a>479 and a<540. compute b=12+(a-480)/100. Else if a>539 and a<600. compute b=13+(a-540)/100. Else if a>599 and a<660. compute b=14+(a-600)/100. Else if a>659 and a<720. compute b=15+(a-660)/100. Else if a>719 and a<780. compute b=16+(a-720)/100. Else if a>779 and a<840. compute b=17+(a-780)/100. Else if a>839 and a<900. compute b=18+(a-840)/100. Else if a>899 and a<960. compute b=19+(a-900)/100. Else if a>959 and a<1020. compute b=20+(a-960)/100. Else if a>1019 and a<1080. compute b=21+(a-1020)/100. Else if a>1079 and a<1140. compute b=22+(a-1080)/100. Else if a>1139 and a<1200. compute b=23+(a-1140)/100. Else if a>1119 and a<1260. compute b=(a-1200)/100. Else if a>1259 and a<1320. compute b=1+(a-1260)/100. Else if a>1319 and a<1380. compute b=2+(a-1320)/100. Else if a>1379. compute b=3+(a-1380)/100. End if. End repeat. freq clock1 clock15 clock50 clock60. cro clock10 by start10. vector z(41). Do repeat a=z1 to z41. compute a=0. End repeat. vector x(69). Do repeat a=x1 to x69. compute a=0. End repeat. vector new=new1 to new144 /old=old1 to old144. Loop i=1 to 144. Do if new(i)=1. compute x1=x1+10. Else if new(i)=2. compute x2=x2+10. Else if new(i)=3. compute x3=x3+10. Else if new(i)=4. compute x4=x4+10. Else if new(i)=5. compute x5=x5+10. Else if new(i)=6. compute x6=x6+10. Else if new(i)=7. compute x7=x7+10. Else if new(i)=8. compute x8=x8+10. Else if new(i)=9. compute x9=x9+10. Else if new(i)=10. compute x10=x10+10. Else if new(i)=11. compute x11=x11+10. Else if new(i)=12. compute x12=x12+10. Else if new(i)=13. compute x13=x13+10. Else if new(i)=14. compute x14=x14+10. Else if new(i)=15. compute x15=x15+10. Else if new(i)=16. compute x16=x16+10. Else if new(i)=17. compute x17=x17+10. Else if new(i)=18. compute x18=x18+10. Else if new(i)=19. compute x19=x19+10. Else if new(i)=20. compute x20=x20+10. Else if new(i)=21. compute x21=x21+10. Else if new(i)=22. compute x22=x22+10. Else if new(i)=23. compute x23=x23+10. Else if new(i)=24. compute x24=x24+10. Else if new(i)=25. compute x25=x25+10. Else if new(i)=26. compute x26=x26+10. Else if new(i)=27. compute x27=x27+10. Else if new(i)=28. compute x28=x28+10. Else if new(i)=29. compute x29=x29+10. Else if new(i)=30. compute x30=x30+10. Else if new(i)=31. compute x31=x31+10. Else if new(i)=32. compute x32=x32+10. Else if new(i)=33. compute x33=x33+10. Else if new(i)=34. compute x34=x34+10. Else if new(i)=35. compute x35=x35+10. Else if new(i)=36. compute x36=x36+10. Else if new(i)=37. compute x37=x37+10. Else if new(i)=38. compute x38=x38+10. Else if new(i)=39. compute x39=x39+10. Else if new(i)=40. compute x40=x40+10. Else if new(i)=41. compute x41=x41+10. Else if new(i)=42. compute x42=x42+10. Else if new(i)=43. compute x43=x43+10. Else if new(i)=44. compute x44=x44+10. Else if new(i)=45. compute x45=x45+10. Else if new(i)=46. compute x46=x46+10. Else if new(i)=47. compute x47=x47+10. Else if new(i)=48. compute x48=x48+10. Else if new(i)=49. compute x49=x49+10. Else if new(i)=50. compute x50=x50+10. Else if new(i)=51. compute x51=x51+10. Else if new(i)=52. compute x52=x52+10. Else if new(i)=53. compute x53=x53+10. Else if new(i)=54. compute x54=x54+10. Else if new(i)=55. compute x55=x55+10. Else if new(i)=56. compute x56=x56+10. Else if new(i)=57. compute x57=x57+10. Else if new(i)=58. compute x58=x58+10. Else if new(i)=59. compute x59=x59+10. Else if new(i)=60. compute x60=x60+10. Else if new(i)=61. compute x61=x61+10. Else if new(i)=62. compute x62=x62+10. Else if new(i)=63. compute x63=x63+10. Else if new(i)=64. compute x64=x64+10. Else if new(i)=65. compute x65=x65+10. Else if new(i)=66. compute x66=x66+10. Else if new(i)=67. compute x67=x67+10. Else if new(i)=68. compute x68=x68+10. Else if new(i)=69. compute x69=x69+10. End if. Do if old(i)=1. compute z1=z1+10. Else if old(i)=2. compute z2=z2+10. Else if old(i)=3. compute z3=z3+10. Else if old(i)=4. compute z4=z4+10. Else if old(i)=5. compute z5=z5+10. Else if old(i)=6. compute z6=z6+10. Else if old(i)=7. compute z7=z7+10. Else if old(i)=8. compute z8=z8+10. Else if old(i)=9. compute z9=z9+10. Else if old(i)=10. compute z10=z10+10. Else if old(i)=11. compute z11=z11+10. Else if old(i)=12. compute z12=z12+10. Else if old(i)=13. compute z13=z13+10. Else if old(i)=14. compute z14=z14+10. Else if old(i)=15. compute z15=z15+10. Else if old(i)=16. compute z16=z16+10. Else if old(i)=17. compute z17=z17+10. Else if old(i)=18. compute z18=z18+10. Else if old(i)=19. compute z19=z19+10. Else if old(i)=20. compute z20=z20+10. Else if old(i)=21. compute z21=z21+10. Else if old(i)=22. compute z22=z22+10. Else if old(i)=23. compute z23=z23+10. Else if old(i)=24. compute z24=z24+10. Else if old(i)=25. compute z25=z25+10. Else if old(i)=26. compute z26=z26+10. Else if old(i)=27. compute z27=z27+10. Else if old(i)=28. compute z28=z28+10. Else if old(i)=29. compute z29=z29+10. Else if old(i)=30. compute z30=z30+10. Else if old(i)=31. compute z31=z31+10. Else if old(i)=32. compute z32=z32+10. Else if old(i)=33. compute z33=z33+10. Else if old(i)=34. compute z34=z34+10. Else if old(i)=35. compute z35=z35+10. Else if old(i)=36. compute z36=z36+10. Else if old(i)=37. compute z37=z37+10. Else if old(i)=38. compute z38=z38+10. Else if old(i)=39. compute z39=z39+10. Else if old(i)=40. compute z40=z40+10. Else if old(i)=41. compute z41=z41+10. End if. End loop. desc z1 to z41. desc x1 to x69. compute sppart=-9. sort cases by hldid persid id. ************************ *computation of weights* ************************. *original survey weights. *poicarn weight of subjects with booklet. *poicomp weight for the whole household. desc poicarn. compute ocombwt = poicarn. weight by ocombwt. freq day. weight off. freq day. *the original weight does not balance the distribution of days of the week. *deflate the original weight. temp. select if badcase=0. desc poicarn. compute wt=poicarn/3058.8309. desc wt. freq emp. means age by emp. cro emp by badcase. *COMPUTATION OF THE PROPOSED WEIGHT. *account for age group, sex and employment status. if age<18 and sex=1 agesexgp=0. if age>17 and age<26 and sex=1 and emp=1 agesexgp=1. if age>17 and age<26 and sex=1 and emp<1 agesexgp=2. if age>25 and age<40 and sex=1 and emp=1 agesexgp=3. if age>25 and age<40 and sex=1 and emp<1 agesexgp=4. if age>39 and age<60 and sex=1 and emp=1 agesexgp=5. if age>39 and age<60 and sex=1 and emp<1 agesexgp=6. if age>59 and age<71 and sex=1 and emp=1 agesexgp=7. if age>59 and age<71 and sex=1 and emp<1 agesexgp=8. if age>70 and sex=1 agesexgp=9. if age<18 and sex=2 agesexgp=10. if age>17 and age<26 and sex=2 and emp=1 agesexgp=11. if age>17 and age<26 and sex=2 and emp<1 agesexgp=12. if age>25 and age<40 and sex=2 and emp=1 agesexgp=13. if age>25 and age<40 and sex=2 and emp<1 agesexgp=14. if age>39 and age<60 and sex=2 and emp=1 agesexgp=15. if age>39 and age<60 and sex=2 and emp<1 agesexgp=16. if age>59 and age<71 and sex=2 and emp=1 agesexgp=17. if age>59 and age<71 and sex=2 and emp<1 agesexgp=18. if age>70 and sex=2 and emp=1 agesexgp=19. if age>70 and sex=2 and emp<1 agesexgp=20. cro agesexgp by sex emp. *allow for 0-weighting of the bad diary cases. if badcase>0 agesexgp=99. freq agesexgp badcase. if agesexgp=99 wt=0. sort cases by agesexgp day. aggregate out='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\group.sav' /break=agesexgp /grouptot=sum(wt)/ groupn=nu. execute. aggregate out='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\day.sav' /break= agesexgp day /daytot=sum(wt) /dayn=nu. execute. match files file=* table='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\group.sav' /by agesexgp. execute. match files file=* table='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\day.sav' /by agesexgp day. execute. compute exptot=(grouptot/7). Do if badcase>0. compute propwt=0. Else if badcase=0. compute propwt=(exptot/daytot)/(dayn/daytot). End if. weight off. desc propwt ocombwt. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=country /wtsum1 = SUM(wt) /wtsum = SUM(propwt). freq wtsum wtsum1. *inflate the propwt to the number of diaries from the survey. *compute the total number of diaries divided by the sum of the weight. compute propwt=propwt*(15441/15427.63). AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=country /wtsum2 = SUM(propwt). freq wtsum2. desc propwt ocombwt. weight by propwt. cro day by sex /cel=col. freq agesexgp day. weight off. *final fixes in household where parent ids and employment status of the spouse have not been assigned correctly. Do if hldid=1101004280 and persid>2. compute parntid1=1. compute parntid2=2. End if. if hldid=1101004280 and persid=3 empsp=3. if hldid=2603017080 and persid=2 empsp=3. if hldid=3107057550 and persid=2 empsp=3. if hldid=4207030250 and persid=1 empsp=3. if hldid=5203012591 empsp=3. if hldid=5301014630 empsp=3. if hldid=7405012352 and persid=1 empsp=3. if hldid=8201013200 and persid=1 empsp=3. if hldid=8204047320 and persid=1 empsp=3. execute. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\FR1998haf.sav' /keep country survey swave msamp hldid persid id parntid1 parntid2 partid day month year diary nowght hhtype hhldsize nchild agekidx agekid2 incorig income ownhome urban computer vehicle sex age famstat cphome singpar relrefp civstat cohab citizen empstat emp unemp student retired empsp workhrs empinclm occupo isco1 sector educa edcat rushed health carer disab z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 z14 z15 z16 z17 z18 z19 z20 z21 z22 z23 z24 z25 z26 z27 z28 z29 z30 z31 z32 z33 z34 z35 z36 z37 z38 z39 z40 z41 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 x61 x62 x63 x64 x65 x66 x67 x68 x69 sppart ocombwt propwt. vector main=main1 to main60 /av=av1 to av60 /seca=seca1 to seca60 /eloca=eloca1 to eloca60 /ino=ino1 to ino60 /alone=alone1 to alone60 /oad=oad1 to oad60 /t=t1 to t60 /clock=clock1 to clock60 /start=start1 to start60 /end=end1 to end60. loop i=1 to 60. compute country=country. compute survey=survey. compute swave=swave. compute msamp=msamp. compute hldid=hldid. compute persid=persid. compute id=id. compute day=day. compute cday=cday. compute month=month. compute year=year. compute diary=diary. compute nowght=nowght. compute sex=sex. compute age=age. compute time=t(i). compute clockst=clock(i). compute start=start(i). compute end=end(i). compute epnum=i. compute main=main(i). compute sec=seca(i). compute av=av(i). compute inout=ino(i). compute eloc=eloca(i). compute ict=-9. compute mtrav=-9. compute alone=alone(i). compute child=-9. compute sppart=-9. compute oad=oad(i). xsave outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\FR1998hef.sav' /keep = country survey swave msamp hldid persid id day cday month year diary nowght sex age time clockst start end epnum main sec av inout eloc ict mtrav alone child sppart oad. end loop. execute. *final tidy of aggregate version. get file='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\FR1998haf.sav'. sort cases by hldid persid. rename variables (x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 x61 x62 x63 x64 x65 x66 x67 x68 x69 z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 z14 z15 z16 z17 z18 z19 z20 z21 z22 z23 z24 z25 z26 z27 z28 z29 z30 z31 z32 z33 z34 z35 z36 z37 z38 z39 z40 z41 = main1 main2 main3 main4 main5 main6 main7 main8 main9 main10 main11 main12 main13 main14 main15 main16 main17 main18 main19 main20 main21 main22 main23 main24 main25 main26 main27 main28 main29 main30 main31 main32 main33 main34 main35 main36 main37 main38 main39 main40 main41 main42 main43 main44 main45 main46 main47 main48 main49 main50 main51 main52 main53 main54 main55 main56 main57 main58 main59 main60 main61 main62 main63 main64 main65 main66 main67 main68 main69 av1 av2 av3 av4 av5 av6 av7 av8 av9 av10 av11 av12 av13 av14 av15 av16 av17 av18 av19 av20 av21 av22 av23 av24 av25 av26 av27 av28 av29 av30 av31 av32 av33 av34 av35 av36 av37 av38 av39 av40 av41). apply dictionary from 'C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\MTUS database\schema&etc\MTUSHAFschema.sav'. compute sleep =main2 + main3. compute eatdrink =main5 + main6. compute selfcare =main1 + main4. compute paidwork =main7 + main8 + main9 + main10 + main11 + main12+ main13 + main14. compute educatn =main15 + main16 + main17. compute foodprep =main18 + main19. compute cleanetc =main20 + main21 + main23. compute maintain =main22. compute shopserv =main24 + main25 + main26. compute garden =main46. compute petcare =main27 + main47. compute eldcare =main32. compute pkidcare =main28 + main31. compute ikidcare =main29 + main30. compute religion =main34. compute volorgwk =main33. compute commute =main63 + main64. compute travel =main62 + main65 + main66 + main67 + main68. compute sportex =main42 + main43 + main44. compute tvradio =main57 + main58 + main59. compute read =main56. compute compint =main60 + main61. compute goout =main35 + main36 + main37 + main38 + main39 + main40 + main41 + main45. compute leisure =main48 + main49 + main50 + main51 + main52 + main53 + main54 + main55. compute missing =main69. *recode time use variables that could not be created to -9. recode av27 main10 main41 main44 main47 main61 main62 main64 (0=-9). desc main1 to main69 sppart. desc hldid persid id incorig age workhrs empinclm av1 av2 av3 av4 av5 av6 av7 av8 av9 av10 av11 av12 av13 av14 av15 av16 av17 av18 av19 av20 av21 av22 av23 av24 av25 av26 av27 av28 av29 av30 av31 av32 av33 av34 av35 av36 av37 av38 av39 av40 av41 ocombwt propwt. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=country /wtsum = SUM(propwt). freq wtsum. *check all variables have variable and value labels. Quality of other variables *already checked in the review of the W53 version. compute tot1=sum(av1 to av26) + sum(av28 to av41). compute tot2=sum(main1 to main9) + sum(main11 to main40) + main42 + main43 + main45 + main46 + sum(main48 to main60) + main63 + sum(main65 to main69). compute tot3= sum(sleep to missing). freq tot1 tot2 tot3. *time adds up correctly - good. freq country survey swave msamp persid parntid1 parntid2 partid day month year diary nowght hhtype hhldsize nchild agekidx agekid2 income ownhome urban computer vehicle sex age famstat singpar relrefp civstat cohab citizen empstat emp unemp student retired empsp workhrs occupo isco1 sector educa edcat rushed health carer disab. cro empsp by civstat. means age hhldsize nchild by famstat /cells min max. means age hhldsize by nchild retired /cells min max median. cro famstat by nchild civstat hhtype agekidx. cro agekidx by nchild. cro empstat by emp unemp retired student disab. cro empsp by civstat relrefp partid. cro civstat by hhtype relrefp partid cohab. *note no relrefp=2 should appear if civstat=2. cro hhtype by hhldsize. compute test=0. if parntid1>0 and parntid1=parntid2 test=1. freq test. *7 errors, manually checked & fixed. if hldid=1107130440 and persid=3 parntid2=2. if hldid=1107130440 and persid=4 parntid1=1. if hldid=5305052650 and persid=3 parntid2=2. if hldid=7208054790 and persid=3 parntid2=2. if hldid=7208054790 and persid=4 parntid1=1. if hldid=7303015480 and persid=3 parntid2=2. if hldid=7303015480 and persid=4 parntid2=2. cro parntid1 by parntid2. weight by propwt. freq day. cro day by sex /cells= count column. weight off. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\FR1998haf.sav' /keep country survey swave msamp hldid persid id parntid1 parntid2 partid day month year diary nowght hhtype hhldsize nchild agekidx agekid2 incorig income ownhome urban computer vehicle sex age famstat singpar relrefp civstat cohab citizen empstat emp unemp student retired empsp workhrs empinclm occupo isco1 sector educa edcat rushed health carer disab av1 av2 av3 av4 av5 av6 av7 av8 av9 av10 av11 av12 av13 av14 av15 av16 av17 av18 av19 av20 av21 av22 av23 av24 av25 av26 av27 av28 av29 av30 av31 av32 av33 av34 av35 av36 av37 av38 av39 av40 av41 main1 main2 main3 main4 main5 main6 main7 main8 main9 main10 main11 main12 main13 main14 main15 main16 main17 main18 main19 main20 main21 main22 main23 main24 main25 main26 main27 main28 main29 main30 main31 main32 main33 main34 main35 main36 main37 main38 main39 main40 main41 main42 main43 main44 main45 main46 main47 main48 main49 main50 main51 main52 main53 main54 main55 main56 main57 main58 main59 main60 main61 main62 main63 main64 main65 main66 main67 main68 main69 sppart ocombwt propwt. apply dictionary from 'C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\MTUS database\schema&etc\MTUSHCFschema.sav'. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\FR1998hcf.sav' /keep country survey hldid persid id day month year hhldsize nchild agekidx sex age civstat empstat workhrs edcat sleep eatdrink selfcare paidwork educatn foodprep cleanetc maintain shopserv garden petcare eldcare pkidcare ikidcare religion volorgwk commute travel sportex tvradio read compint goout leisure missing main1 main2 main3 main4 main5 main6 main7 main8 main9 main10 main11 main12 main13 main14 main15 main16 main17 main18 main19 main20 main21 main22 main23 main24 main25 main26 main27 main28 main29 main30 main31 main32 main33 main34 main35 main36 main37 main38 main39 main40 main41 main42 main43 main44 main45 main46 main47 main48 main49 main50 main51 main52 main53 main54 main55 main56 main57 main58 main59 main60 main61 main62 main63 main64 main65 main66 main67 main68 main69 propwt /COMPRESSED. *tidy final episode files. get file='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\FR1998hef.sav'. apply dictionary from 'C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\MTUS database\schema&etc\MTUSHEFschema.sav'. *at the moment there are 66 episode rows for all diaries. *Reduce to one row per real episode. freq main. select if main>0. freq main. *check labels and distrubutions. freq country survey swave msamp persid day cday month year diary nowght sex age clockst epnum main sec av inout eloc ict mtrav alone child sppart oad. cro mtrav by inout. desc hldid id age epnum time start end. sort cases by hldid persid epnum. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\FR1998hef.sav'. *create region variable. get file='D:\MTUS-archive\France\1998\sourcefiles\edtmen98\edtmen98.sav' /keep ident rg. string country (A2). compute country = 'FR'. freq country. compute survey=1998. compute swave=0. compute msamp=0. compute ethnic=-9. execute. rename variables (ident rg=hldid region). sort cases by hldid. *MANNUAL - set strings to numbers. formats region (F8.0). var lab region region. val lab region 11 Ile De France 21 Champagne-Ardennes 22 Picardie 23 Haute-Normandie 24 Centre 25 Basse-Normandie 26 Bourgogne 31 Nord-Pas-De-Calais 41 Lorraine 42 Alsace 43 Franche-Comt� 52 Pays de la Loire 53 Bretagne 54 Poitou-Charente 72 Aquitaine 73 Midi-Pyr�n�es 74 Limousin 82 Rh�ne-Alpes 83 Auvergne 91 Languedoc-Roussillon 93 "Provence-Alpes-C�te d'Azur" 94 Corse -9 not included in survey. freq region. sort cases by hldid. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\Region-Race-Fra1998.sav'. match files files='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\FR1998hcf.sav' table=* /by hldid. execute. var lab ethnic ethnicity. val lab ethnic -9 not included in survey. freq region ethnic. sort cases by hldid persid. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\Region-Race-Fra1998.sav' /keep country survey swave msamp hldid persid region ethnic. new file. Get file='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\Region-Race-Fra1998.sav'. SAVE TRANSLATE OUTFILE='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\France\1998\Region-Race-Fra1998.csv' /TYPE=CSV /MAP /REPLACE /FIELDNAMES /CELLS=VALUES.