*final check of UK 1983-84 files and final corrections. *note the need to run the World 6 section first to make the fixbadcase.sav file *before running this start of the section. get SAS data='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\uk1983w58old.sas7bdat'. sort cases by hldid persid id. AGGREGATE outfile='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\intwt.sav' /break hldid persid id /wgt=MAX(wgt). *version 5.3. get SAS data='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\uk1983w553.sas7bdat'. sort cases by hldid persid id. rename variables (countreg badcase propwt=countrya bad prop). match files files=* table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\fixbadcase.sav' table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\intwt.sav' /BY hldid persid id. execute. cro badcase by bad. apply dictionary from 'C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\MTUS database\schema&etc\MTUSW553schema.sav'. *fix outstanding problems. val lab educa -8 missing 1 "no qualification" 2 "CSE 2-5" 3 "CSE 1/GCE O" 4 ONC 5 HNC 6 "City & Guilds" 7 Full appenticeship 8 GCE A 9 Teacher training 10 Nursing qualification 11 "Other professional qualification/diploma" 12 Degree. compute empinclm=-9. compute nd=0. if diary=1 nd=1. compute p1emp=-11. if relrefp=1 and civstat=1 p1emp=empstat. aggregate outfile=* mode=addvariables /break hldid /ndiarists=SUM(nd) /p1empsp=MAX(p1emp) /hmin=MIN(hhtype) /hmax=MAX(hhtype). compute test=0. if famstat=4 and civstat=2 and cphome=0 test=1. temp. select if test=1. freq age relrefp ndiarists. Do if test=1 and ndiarists=1. compute cphome=1. compute parntid1=1. compute parntid2=2. Else if hldid=674 or hldid=1262. compute cphome=1. compute parntid1=1. compute parntid2=2. Else if hldid=1341. compute cphome=1. compute parntid1=1. End if. temp. select if parntid1>-7. means parntid1 parntid2 by relrefp /cells min max. compute test=0. if relrefp=2 and empsp=-7 test=1. freq test. if test=1 empsp=p1empsp. recode empsp (-11=-8). cro empsp by relrefp. if civstat=2 and cohab=0 cohab=-7. cro cohab by civstat. Do if (hldid=357 and persid=4) or (hldid=489 and persid=3) or (hldid=655 and persid=3) or (hldid=1151 and persid=3) or (hldid=1412 and persid=3). compute parntid1=1. compute parntid2=2. End if. cro hmin by hmax. compute test=0. if hmin~=hmax test=1. freq test. Do if (hldid=10 or hldid=28 or hldid=61 or hldid=83 or hldid=206 or hldid=339 or hldid=355 or hldid=629 or hldid=850 or hldid=859 or hldid=881 or hldid=955 or hldid=1187 or hldid=1214 or hldid=1227 or hldid=1239 or hldid=1343 or hldid=1375 or hldid=1473 or hldid=1587 or hldid=1759 or hldid=1808 or hldid=1816 or hldid=1830 or hldid=1853 or hldid=2114 or hldid=2178 or hldid=2195 or hldid=2255 or hldid=2281 or hldid=2303 or hldid=2310) and persid=1. compute singpar=0. compute partid=2. compute hhtype=3. Else if hldid=357 and persid=2. compute partid=1. compute hhtype=3. Else if (hldid=10 or hldid=28 or hldid=61 or hldid=83 or hldid=206 or hldid=339 or hldid=355 or hldid=357 or hldid=629 or hldid=850 or hldid=859 or hldid=881 or hldid=955 or hldid=1187 or hldid=1214 or hldid=1227 or hldid=1239 or hldid=1343 or hldid=1375 or hldid=1473 or hldid=1587 or hldid=1759 or hldid=1808 or hldid=1816 or hldid=1830 or hldid=1853 or hldid=2114 or hldid=2178 or hldid=2195 or hldid=2255 or hldid=2281 or hldid=2303 or hldid=2310) and persid>2. compute parntid2=2. compute hhtype=3. ELse if hldid=655 and persid=2. compute singpar=0. compute partid=1. compute hhtype=3. Else if hldid=655 and persid=3. compute parntid1=1. compute parntid2=2. compute hhtype=3. Else if hldid=302 or hldid=1396 or hldid=1412 or hldid=1689. compute hhtype=3. End if. Do if hldid=1412 and persid=2. compute partid=1. End if. execute. Do if hldid=1689 and persid=3. compute partid=2. End if. execute. Do if (hldid=377 or hldid=489 or hldid=1151) and persid=2. compute partid=1. compute hhtype=3. Else if (hldid=377 or hldid=489 or hldid=1151) and persid>2. compute hhtype=3. End if. execute. Do if hldid=542 and persid=1. compute hhtype=3. compute parntid2=2. Else if hldid=542 and persid=3. compute singpar=0. compute partid=2. compute hhtype=3. End if. execute. Do if hldid=1317 and persid=1. compute hhtype=3. Else if hldid=1317 and persid=2. compute partid=3. Else if hldid=1317 and persid=3. compute partid=2. End if. execute. Do if hldid=2103. compute hhtype=3. Do if persid=1. compute partid=2. Else if persid=6. compute partid=5. Else if persid=7. compute parntid1=5. compute parntid2=6. End if. End if. execute. Do if hldid=2290. compute hhtype=3. Do if persid=1 or persid=4. compute parntid1=2. compute parntid2=3. Else if persid=6. compute partid=2. compute singpar=0. End if. End if. execute. compute test=0. if singpar=1 and civstat=1 test=1. freq test. do if hldid=368. compute parntid1=-7. compute parntid2=-7. Do if persid=1. compute singpar=0. Else if persid=2. compute partid=1. compute relrefp=2. End if. End if. Do if hldid=2290 and persid=1. compute partid=-7. Else if hldid=2290 and persid=3. compute partid=2. compute singpar=0. End if. execute. Do if hldid=2292 and persid=1. compute parntid1=-7. compute parntid2=-7. compute singpar=0. Else if hldid=2292 and persid=2. compute parntid2=2. compute partid=-7. compute cphome=1. compute civstat=2. End if. execute. compute test=0. if (relrefp=4 or relrefp=7) and partid<0 test=1. freq test. Do if (hldid=371 or hldid=377) and persid=1. compute parntid1=3. compute parntid2=-7. End if. Do if (hldid=412 or hldid=590) and persid=1. compute parntid2=-7. compute partid=-7. End if. Do if hldid=658 and persid=1. compute parntid1=3. compute parntid2=-7. Else if hldid=658 and persid=4. compute parntid1=1. compute parntid2=2. End if. Do if (hldid=1396 or hldid=1777) and persid=1. compute parntid1=5. compute parntid2=-7. End if. execute. temp. select if singpar=1. freq agekidx. Do if hldid=1317. compute parntid1=-7. compute parntid2=-7. End if. if civstat=2 and partid=2 partid=-7. execute. compute test=0. if partid=persid test=1. freq test. compute test=0. if parntid1=persid or parntid2=persid test=1. freq test. Do if hldid=1222 or hldid=1709 or hldid=1869. compute parntid2=3. End if. execute. compute test=0. if partid>-7 and (parntid1=partid or parntid2=partid) test=1. freq test. temp. select if partid=-8. freq ndiarists hhldsize. if partid=-8 and hhldsize=1 partid=-7. compute test=0. if ndiarists>1 and partid=-8 test=1. freq test. Do if (hldid=302 or hldid=368 or hldid=377 or hldid=1396) and persid=1. compute partid=2. Else if hldid=494 and persid=5. compute partid=4. Else if (hldid=1416 and persid=4) or hldid=1874. compute partid=-7. End if. Do if hldid=2292 and persid=1. compute partid=2. Else if hldid=2292 and persid=3. compute parntid2=2. compute partid=-7. compute cphome=1. compute civstat=2. End if. execute. compute test=0. if partid=-8 and relrefp=3 test=1. freq test. temp. select if test=1. cro persid by relrefp. Do if partid=-8 and persid=1. compute partid=2. Else if partid=-8 and persid=2. compute partid=1. Else if partid=-8. compute partid=3. End if. freq partid. compute test=0. if age<16 and agekid2=16 test=1. freq test. Do if hldid=28 or hldid=83 or hldid=142 or hldid=357 or hldid=674 or hldid=730 or hldid=1074 or hldid=1193 or hldid=1271 or hldid=1363 or hldid=2186 or hldid=2416. compute agekid2=15. End if. compute test=0. if age=14 and agekid2=12 test=1. freq test. means agekid2 by agekidx /cells = min max. aggregate outfile=* mode=addvariables /break hldid /age14=MAX(test). cro age14 by agekid2. if age14=1 agekid2=14. freq agekid2. temp. select if age=17. freq agekidx agekid2 nchild. compute test=0. if age=17 test=1. aggregate outfile=* mode=addvariables /break hldid /age17=MAX(test). cro age17 by agekid2. if agekid2=16 and age17=1 and nchild=1 agekid2=17. freq agekid2. temp. select if age=16 and nchild=1. freq agekid2. compute test=0. if relrefp=3 or relrefp=4 or relrefp=6 or relrefp=7 test=1. aggregate outfile=* mode=addvariables /break hldid /kidinhh=MAX(test). cro kidinhh by agekidx. if kidinhh=0 and agekidx=4 agekidx=-7. freq agekidx. if agekidx=-7 agekid2=-7. means agekid2 by agekidx /cells=min max mean. if famstat=5 and cphome=1 famstat=4. cro famstat by cphome. temp. select if age<18. freq parntid1. temp. select if age<18 and parntid1=-7. freq hhtype famstat. compute test=0. if age<18 and parntid1=-7 test=1. freq test. Do if hldid=759 and persid>2. compute parntid1=1. compute parntid2=2. compute cphome=1. compute famstat=4. compute relrefp=3. End if. if hldid=2103 and persid=7 famstat=4. if hldid=2103 and persid=7 cphome=1. execute. Do if parntid1=3 and parntid2=2. compute parntid1=2. compute parntid2=3. End if. if civstat=2 and cohab=0 cohab=-7. execute. compute test=0. if civstat=1 and partid=-7 test=1. freq test. if hldid=1874 hhtype=4. execute. compute test=0. if relrefp=2 and empsp=-7 test=1. freq test. if hldid=368 and persid=1 empsp=1. if hldid=368 and persid=2 empsp=4. execute. compute test=0. if civstat=1 and empsp=-7 test=1. freq test. temp. select if test=1. freq ndiarists. if civstat=1 and empsp=-7 and ndiarists=1 empsp=-8. if hldid=1317 and persid=2 empsp=1. if hldid=1317 and persid=3 empsp=4. execute. if civstat=1 and empsp=-7 empsp=-8. cro civstat by empsp. compute p1emp=-11. compute p2emp=-11. compute p3emp=-11. compute p4emp=-11. compute p5emp=-11. if persid=1 p1emp=empstat. if persid=2 p2emp=empstat. if persid=3 p3emp=empstat. if persid=4 p4emp=empstat. if persid=5 p5emp=empstat. aggregate outfile=* mode=addvariables /break=hldid /p1empstat=MAX(p1emp) /p2empstat=MAX(p2emp) /p3empstat=MAX(p3emp) /p4empstat=MAX(p4emp) /p5empstat=MAX(p5emp). temp. select if partid=2. cro empsp by p2empstat. if partid=2 and empsp=3 and p2empstat=4 empsp=4. temp. select if partid=2. cro empsp by p2empstat. temp. select if partid=1. cro empsp by p1empstat. if partid=1 and empsp=3 and p1empstat=4 empsp=4. temp. select if partid=1. cro empsp by p1empstat. temp. select if partid=3. cro empsp by p3empstat. temp. select if partid=4. cro empsp by p4empstat. if partid=4 and empsp=3 and p4empstat=4 empsp=4. temp. select if partid=4. cro empsp by p4empstat. temp. select if partid=5. cro empsp by p5empstat. if emp=1 and workhrs=-7 workhrs=-8. compute test=0. if workhrs>0 and emp=0 test=1. freq test. *people aged <18 not asked employment status question *who report work hours and monthly salary. Do If hldid=1598 and persid=4. compute emp=1. compute empstat=2. Else if hldid=1937 and persid=1. compute emp=1. compute empstat=1. Else if hldid=1937 and persid=2. compute empsp=1. Else if test=1. compute emp=1. compute empstat=1. End if. execute. compute test=0. if civstat=1 and hhtype=4 test=1. freq test. cro income by incorig. rename variables (incorig=aoinco). recode aoinco (5=1) (11=3) (6=4) (10=5) (8=6) (1=7) (9=8) (4=9) (7=10) (12=11)(3=12) (else=copy) into incorig. temp. select if incorig>-8. cro educa occup by incorig aoinco /cells=row count. temp. select if incorig>-8. cro educa by incorig aoinco /cells=col count. temp. select if incorig>-1 and occup>-1. cro occup by incorig aoinco /cells=col count. temp. select if incorig>-8. freq incorig. *income ok apart from miscode of missing cases, incorig *rearranged in problematic fashion - now fixed. cro income by incorig. if incorig=-8 income=-8. cro income by incorig. Do if hldid=418 or hldid=723 or hldid=871 or hldid=1214 or hldid=1217 or hldid=1303 or hldid=1965 or hldid=1979 or hldid=2094 or hldid=2096 or hldid=2188 or hldid=2192 or hldid=2195 or hldid=2285 or hldid=2311 or hldid=2382 or hldid=2393. compute incorig=99. Else if hldid=1 or hldid=12 or hldid=45 or hldid=50 or hldid=52 or hldid=59 or hldid=139 or hldid=226 or hldid=233 or hldid=340 or hldid=353 or hldid=377 or hldid=430 or hldid=455 or hldid=498 or hldid=609 or hldid=654 or hldid=706 or hldid=715 or hldid=786 or hldid=808 or hldid=984 or hldid=999 or hldid=1013 or hldid=1027 or hldid=1029 or hldid=1045 or hldid=1074 or hldid=1105 or hldid=1115 or hldid=1239 or hldid=1240 or hldid=1374 or hldid=1412 or hldid=1423 or hldid=1651 or hldid=1657 or hldid=1765 or hldid=1797 or hldid=1829 or hldid=1837 or hldid=1880 or hldid=1958 or hldid=1978 or hldid=2097 or hldid=2186 or hldid=2194 or hldid=2257 or hldid=2313 or hldid=2321. compute incorig=97. Else if incorig=-8. compute incorig=98. End if. freq income incorig. if age>60 and sex=2 and empstat=4 and retired=0 retired=1. temp. select if incorig>90. cro educa empstat workhrs by incorig by retired /cells=col count. Do if hldid=1681. compute sex=1. Else if sex=-8. compute sex=2. End if. execute. temp. select if incorig>90. cro sex civstat hhtype by incorig /cells=col count. compute intwt=ocombwt*wgt. if badcase>0 intwt=0. if age<16 and sex=1 agesexgp=0. if age>15 and age<26 and sex=1 agesexgp=1. if age>15 and age<26 and sex=1 agesexgp=2. if age>25 and age<40 and sex=1 agesexgp=3. if age>25 and age<40 and sex=1 agesexgp=4. if age>39 and age<60 and sex=1 agesexgp=5. if age>39 and age<60 and sex=1 agesexgp=6. if age>59 and age<71 and sex=1 agesexgp=7. if age>59 and age<71 and sex=1 agesexgp=8. if age>70 and sex=1 agesexgp=9. if age<16 and sex=2 agesexgp=10. if age>15 and age<26 and sex=2 agesexgp=11. if age>15 and age<26 and sex=2 agesexgp=12. if age>25 and age<40 and sex=2 agesexgp=13. if age>25 and age<40 and sex=2 agesexgp=14. if age>39 and age<60 and sex=2 agesexgp=15. if age>39 and age<60 and sex=2 agesexgp=16. if age>59 and age<71 and sex=2 agesexgp=17. if age>59 and age<71 and sex=2 agesexgp=18. if age>70 and sex=2 agesexgp=19. freq agesexgp. sort cases by agesexgp day. aggregate out='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\group.sav' /break=agesexgp /grouptot=sum(intwt)/ groupn=nu. execute. aggregate out='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\day.sav' /break= agesexgp day /daytot=sum(intwt) /dayn=nu. execute. match files file=* table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\group.sav' /by agesexgp. execute. match files file=* table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\day.sav' /by agesexgp day. execute. compute exptot=(grouptot/7). Do if badcase=0. compute propwt=exptot/daytot. * compute propwt=(exptot/daytot)/(dayn/daytot). Else if badcase>0. compute propwt=0. End if. desc propwt ocombwt. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=countrya /wsum = SUM(propwt). freq wsum. compute propwt=propwt*10360/9369.95. desc propwt. compute msamp=0. sort cases by hldid persid id. apply dictionary from 'C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\MTUS database\schema&etc\MTUSW553schema.sav'. *end corrections. desc hldid persid 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=countrya /wtsum = SUM(propwt). freq wtsum. compute tottime=sum(av1 to av41). freq tottime. freq countrya survey swave msamp id parntid1 parntid2 partid day month year diary badcase hhtype hhldsize nchild agekidx agekid2 income ownhome urban computer vehicle sex age famstat cphome singpar relrefp civstat cohab citizen empstat emp unemp student retired empsp workhrs occup sector educa edtry rushed health carer disab. 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 cphome. cro agekidx by nchild. cro empstat by emp unemp retired student disab sector occup. cro empsp by civstat relrefp. cro civstat by hhtype relrefp partid cohab cphome. *note no relrefp=2 should appear if civstat=2. cro hhtype by hhldsize. cro parntid1 by parntid2. cro workhrs by emp. weight by propwt. freq day badcase. cro day by sex /cells= count column. weight off. freq badcase. temp. select if propwt=0. freq badcase. compute msamp=0. SAVE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\UK1983w553.sav' /keep countrya survey swave msamp hldid persid id parntid1 parntid2 partid day month year diary badcase 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 occup sector educa edtry 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 ocombwt propwt. aggregate /outfile='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\aggr.sav' /break=hldid /urbanmin = min(urban) /urbanmax = max(urban) /incmin = min(income) /incmax = max(income) /akidmin = min(agekidx) /akidmax = max(agekidx) /akid2min = min(agekid2) /akid2max = max(agekid2) /nchimin = min(nchild) /nchimax = max(nchild) /hsizemin = min(hhldsize) /hsizemax = max(hhldsize) /htypmin = min(hhtype) /htypmax = max(hhtype) /ownhomin = min(ownhome) /ownhomax = max(ownhome) /compmin = min(computer) /compmax = max(computer) /vehicmin = min(vehicle) /vehicmax = max(vehicle). get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\aggr.sav'. cro urbanmin by urbanmax. cro incmin by incmax. cro akidmin by akidmax. cro akid2min by akid2max. cro nchimin by nchimax. cro hsizemin by hsizemax. cro htypmin by htypmax. cro ownhomin by ownhomax. cro compmin by compmax. cro vehicmin by vehicmax. compute test=0. if htypmin~=htypmax test=1. freq test. *version 5.8. get SAS data='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\uk1983w58.sas7bdat'. sort cases by hldid persid id. rename variables (countreg badcase propwt=countrya bad prop). match files files=* table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\fixbadcase.sav' table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\intwt.sav' /BY hldid persid id. execute. cro badcase by bad. apply dictionary from 'C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\MTUS database\schema&etc\MTUSW553schema.sav'. *fix outstanding problems. val lab educa -8 missing 1 "no qualification" 2 "CSE 2-5" 3 "CSE 1/GCE O" 4 ONC 5 HNC 6 "City & Guilds" 7 Full appenticeship 8 GCE A 9 Teacher training 10 Nursing qualification 11 "Other professional qualification/diploma" 12 Degree. compute empinclm=-9. compute nd=0. if diary=1 nd=1. compute p1emp=-11. if relrefp=1 and civstat=1 p1emp=empstat. aggregate outfile=* mode=addvariables /break hldid /ndiarists=SUM(nd) /p1empsp=MAX(p1emp) /hmin=MIN(hhtype) /hmax=MAX(hhtype). compute test=0. if famstat=4 and civstat=2 and cphome=0 test=1. temp. select if test=1. freq age relrefp ndiarists. Do if test=1 and ndiarists=1. compute cphome=1. compute parntid1=1. compute parntid2=2. Else if hldid=674 or hldid=1262. compute cphome=1. compute parntid1=1. compute parntid2=2. Else if hldid=1341. compute cphome=1. compute parntid1=1. End if. temp. select if parntid1>-7. means parntid1 parntid2 by relrefp /cells min max. compute test=0. if relrefp=2 and empsp=-7 test=1. freq test. if test=1 empsp=p1empsp. recode empsp (-11=-8). cro empsp by relrefp. if civstat=2 and cohab=0 cohab=-7. cro cohab by civstat. Do if (hldid=357 and persid=4) or (hldid=489 and persid=3) or (hldid=655 and persid=3) or (hldid=1151 and persid=3) or (hldid=1412 and persid=3). compute parntid1=1. compute parntid2=2. End if. cro hmin by hmax. compute test=0. if hmin~=hmax test=1. freq test. Do if (hldid=10 or hldid=28 or hldid=61 or hldid=83 or hldid=206 or hldid=339 or hldid=355 or hldid=629 or hldid=850 or hldid=859 or hldid=881 or hldid=955 or hldid=1187 or hldid=1214 or hldid=1227 or hldid=1239 or hldid=1343 or hldid=1375 or hldid=1473 or hldid=1587 or hldid=1759 or hldid=1808 or hldid=1816 or hldid=1830 or hldid=1853 or hldid=2114 or hldid=2178 or hldid=2195 or hldid=2255 or hldid=2281 or hldid=2303 or hldid=2310) and persid=1. compute singpar=0. compute partid=2. compute hhtype=3. Else if hldid=357 and persid=2. compute partid=1. compute hhtype=3. Else if (hldid=10 or hldid=28 or hldid=61 or hldid=83 or hldid=206 or hldid=339 or hldid=355 or hldid=357 or hldid=629 or hldid=850 or hldid=859 or hldid=881 or hldid=955 or hldid=1187 or hldid=1214 or hldid=1227 or hldid=1239 or hldid=1343 or hldid=1375 or hldid=1473 or hldid=1587 or hldid=1759 or hldid=1808 or hldid=1816 or hldid=1830 or hldid=1853 or hldid=2114 or hldid=2178 or hldid=2195 or hldid=2255 or hldid=2281 or hldid=2303 or hldid=2310) and persid>2. compute parntid2=2. compute hhtype=3. ELse if hldid=655 and persid=2. compute singpar=0. compute partid=1. compute hhtype=3. Else if hldid=655 and persid=3. compute parntid1=1. compute parntid2=2. compute hhtype=3. Else if hldid=302 or hldid=1396 or hldid=1412 or hldid=1689. compute hhtype=3. End if. Do if hldid=1412 and persid=2. compute partid=1. End if. execute. Do if hldid=1689 and persid=3. compute partid=2. End if. execute. Do if (hldid=377 or hldid=489 or hldid=1151) and persid=2. compute partid=1. compute hhtype=3. Else if (hldid=377 or hldid=489 or hldid=1151) and persid>2. compute hhtype=3. End if. execute. Do if hldid=542 and persid=1. compute hhtype=3. compute parntid2=2. Else if hldid=542 and persid=3. compute singpar=0. compute partid=2. compute hhtype=3. End if. execute. Do if hldid=1317 and persid=1. compute hhtype=3. Else if hldid=1317 and persid=2. compute partid=3. Else if hldid=1317 and persid=3. compute partid=2. End if. execute. Do if hldid=2103. compute hhtype=3. Do if persid=1. compute partid=2. Else if persid=6. compute partid=5. Else if persid=7. compute parntid1=5. compute parntid2=6. End if. End if. execute. Do if hldid=2290. compute hhtype=3. Do if persid=1 or persid=4. compute parntid1=2. compute parntid2=3. Else if persid=6. compute partid=2. compute singpar=0. End if. End if. execute. compute test=0. if singpar=1 and civstat=1 test=1. freq test. do if hldid=368. compute parntid1=-7. compute parntid2=-7. Do if persid=1. compute singpar=0. Else if persid=2. compute partid=1. compute relrefp=2. End if. End if. Do if hldid=2290 and persid=1. compute partid=-7. Else if hldid=2290 and persid=3. compute partid=2. compute singpar=0. End if. execute. Do if hldid=2292 and persid=1. compute parntid1=-7. compute parntid2=-7. compute singpar=0. Else if hldid=2292 and persid=2. compute parntid2=2. compute partid=-7. compute cphome=1. compute civstat=2. End if. execute. compute test=0. if (relrefp=4 or relrefp=7) and partid<0 test=1. freq test. Do if (hldid=371 or hldid=377) and persid=1. compute parntid1=3. compute parntid2=-7. End if. Do if (hldid=412 or hldid=590) and persid=1. compute parntid2=-7. compute partid=-7. End if. Do if hldid=658 and persid=1. compute parntid1=3. compute parntid2=-7. Else if hldid=658 and persid=4. compute parntid1=1. compute parntid2=2. End if. Do if (hldid=1396 or hldid=1777) and persid=1. compute parntid1=5. compute parntid2=-7. End if. execute. temp. select if singpar=1. freq agekidx. Do if hldid=1317. compute parntid1=-7. compute parntid2=-7. End if. if civstat=2 and partid=2 partid=-7. execute. compute test=0. if partid=persid test=1. freq test. compute test=0. if parntid1=persid or parntid2=persid test=1. freq test. Do if hldid=1222 or hldid=1709 or hldid=1869. compute parntid2=3. End if. execute. compute test=0. if partid>-7 and (parntid1=partid or parntid2=partid) test=1. freq test. temp. select if partid=-8. freq ndiarists hhldsize. if partid=-8 and hhldsize=1 partid=-7. compute test=0. if ndiarists>1 and partid=-8 test=1. freq test. Do if (hldid=302 or hldid=368 or hldid=377 or hldid=1396) and persid=1. compute partid=2. Else if hldid=494 and persid=5. compute partid=4. Else if (hldid=1416 and persid=4) or hldid=1874. compute partid=-7. End if. Do if hldid=2292 and persid=1. compute partid=2. Else if hldid=2292 and persid=3. compute parntid2=2. compute partid=-7. compute cphome=1. compute civstat=2. End if. execute. compute test=0. if partid=-8 and relrefp=3 test=1. freq test. temp. select if test=1. cro persid by relrefp. Do if partid=-8 and persid=1. compute partid=2. Else if partid=-8 and persid=2. compute partid=1. Else if partid=-8. compute partid=3. End if. freq partid. compute test=0. if age<16 and agekid2=16 test=1. freq test. Do if hldid=28 or hldid=83 or hldid=142 or hldid=357 or hldid=674 or hldid=730 or hldid=1074 or hldid=1193 or hldid=1271 or hldid=1363 or hldid=2186 or hldid=2416. compute agekid2=15. End if. compute test=0. if age=14 and agekid2=12 test=1. freq test. means agekid2 by agekidx /cells = min max. aggregate outfile=* mode=addvariables /break hldid /age14=MAX(test). cro age14 by agekid2. if age14=1 agekid2=14. freq agekid2. temp. select if age=17. freq agekidx agekid2 nchild. compute test=0. if age=17 test=1. aggregate outfile=* mode=addvariables /break hldid /age17=MAX(test). cro age17 by agekid2. if agekid2=16 and age17=1 and nchild=1 agekid2=17. freq agekid2. temp. select if age=16 and nchild=1. freq agekid2. compute test=0. if relrefp=3 or relrefp=4 or relrefp=6 or relrefp=7 test=1. aggregate outfile=* mode=addvariables /break hldid /kidinhh=MAX(test). cro kidinhh by agekidx. if kidinhh=0 and agekidx=4 agekidx=-7. freq agekidx. if agekidx=-7 agekid2=-7. means agekid2 by agekidx /cells=min max mean. if famstat=5 and cphome=1 famstat=4. cro famstat by cphome. temp. select if age<18. freq parntid1. temp. select if age<18 and parntid1=-7. freq hhtype famstat. compute test=0. if age<18 and parntid1=-7 test=1. freq test. Do if hldid=759 and persid>2. compute parntid1=1. compute parntid2=2. compute cphome=1. compute famstat=4. compute relrefp=3. End if. if hldid=2103 and persid=7 famstat=4. if hldid=2103 and persid=7 cphome=1. execute. Do if parntid1=3 and parntid2=2. compute parntid1=2. compute parntid2=3. End if. if civstat=2 and cohab=0 cohab=-7. execute. compute test=0. if civstat=1 and partid=-7 test=1. freq test. if hldid=1874 hhtype=4. execute. compute test=0. if relrefp=2 and empsp=-7 test=1. freq test. if hldid=368 and persid=1 empsp=1. if hldid=368 and persid=2 empsp=4. execute. compute test=0. if civstat=1 and empsp=-7 test=1. freq test. temp. select if test=1. freq ndiarists. if civstat=1 and empsp=-7 and ndiarists=1 empsp=-8. if hldid=1317 and persid=2 empsp=1. if hldid=1317 and persid=3 empsp=4. execute. if civstat=1 and empsp=-7 empsp=-8. cro civstat by empsp. compute p1emp=-11. compute p2emp=-11. compute p3emp=-11. compute p4emp=-11. compute p5emp=-11. if persid=1 p1emp=empstat. if persid=2 p2emp=empstat. if persid=3 p3emp=empstat. if persid=4 p4emp=empstat. if persid=5 p5emp=empstat. aggregate outfile=* mode=addvariables /break=hldid /p1empstat=MAX(p1emp) /p2empstat=MAX(p2emp) /p3empstat=MAX(p3emp) /p4empstat=MAX(p4emp) /p5empstat=MAX(p5emp). temp. select if partid=2. cro empsp by p2empstat. if partid=2 and empsp=3 and p2empstat=4 empsp=4. temp. select if partid=2. cro empsp by p2empstat. temp. select if partid=1. cro empsp by p1empstat. if partid=1 and empsp=3 and p1empstat=4 empsp=4. temp. select if partid=1. cro empsp by p1empstat. temp. select if partid=3. cro empsp by p3empstat. temp. select if partid=4. cro empsp by p4empstat. if partid=4 and empsp=3 and p4empstat=4 empsp=4. temp. select if partid=4. cro empsp by p4empstat. temp. select if partid=5. cro empsp by p5empstat. if emp=1 and workhrs=-7 workhrs=-8. compute test=0. if workhrs>0 and emp=0 test=1. freq test. *people aged <18 not asked employment status question *who report work hours and monthly salary. Do If hldid=1598 and persid=4. compute emp=1. compute empstat=2. Else if hldid=1937 and persid=1. compute emp=1. compute empstat=1. Else if hldid=1937 and persid=2. compute empsp=1. Else if test=1. compute emp=1. compute empstat=1. End if. execute. compute test=0. if civstat=1 and hhtype=4 test=1. freq test. cro income by incorig. rename variables (incorig=aoinco). recode aoinco (5=1) (11=3) (6=4) (10=5) (8=6) (1=7) (9=8) (4=9) (7=10) (12=11)(3=12) (else=copy) into incorig. temp. select if incorig>-8. cro educa occup by incorig aoinco /cells=row count. temp. select if incorig>-8. cro educa by incorig aoinco /cells=col count. temp. select if incorig>-1 and occup>-1. cro occup by incorig aoinco /cells=col count. temp. select if incorig>-8. freq incorig. *income ok apart from miscode of missing cases, incorig *rearranged in problematic fashion - now fixed. cro income by incorig. if incorig=-8 income=-8. cro income by incorig. Do if hldid=418 or hldid=723 or hldid=871 or hldid=1214 or hldid=1217 or hldid=1303 or hldid=1965 or hldid=1979 or hldid=2094 or hldid=2096 or hldid=2188 or hldid=2192 or hldid=2195 or hldid=2285 or hldid=2311 or hldid=2382 or hldid=2393. compute incorig=99. Else if hldid=1 or hldid=12 or hldid=45 or hldid=50 or hldid=52 or hldid=59 or hldid=139 or hldid=226 or hldid=233 or hldid=340 or hldid=353 or hldid=377 or hldid=430 or hldid=455 or hldid=498 or hldid=609 or hldid=654 or hldid=706 or hldid=715 or hldid=786 or hldid=808 or hldid=984 or hldid=999 or hldid=1013 or hldid=1027 or hldid=1029 or hldid=1045 or hldid=1074 or hldid=1105 or hldid=1115 or hldid=1239 or hldid=1240 or hldid=1374 or hldid=1412 or hldid=1423 or hldid=1651 or hldid=1657 or hldid=1765 or hldid=1797 or hldid=1829 or hldid=1837 or hldid=1880 or hldid=1958 or hldid=1978 or hldid=2097 or hldid=2186 or hldid=2194 or hldid=2257 or hldid=2313 or hldid=2321. compute incorig=97. Else if incorig=-8. compute incorig=98. End if. freq income incorig. if age>60 and sex=2 and empstat=4 and retired=0 retired=1. temp. select if incorig>90. cro educa empstat workhrs by incorig by retired /cells=col count. Do if hldid=1681. compute sex=1. Else if sex=-8. compute sex=2. End if. execute. temp. select if incorig>90. cro sex civstat hhtype by incorig /cells=col count. compute intwt=ocombwt*wgt. if badcase>0 intwt=0. if age<16 and sex=1 agesexgp=0. if age>15 and age<26 and sex=1 agesexgp=1. if age>15 and age<26 and sex=1 agesexgp=2. if age>25 and age<40 and sex=1 agesexgp=3. if age>25 and age<40 and sex=1 agesexgp=4. if age>39 and age<60 and sex=1 agesexgp=5. if age>39 and age<60 and sex=1 agesexgp=6. if age>59 and age<71 and sex=1 agesexgp=7. if age>59 and age<71 and sex=1 agesexgp=8. if age>70 and sex=1 agesexgp=9. if age<16 and sex=2 agesexgp=10. if age>15 and age<26 and sex=2 agesexgp=11. if age>15 and age<26 and sex=2 agesexgp=12. if age>25 and age<40 and sex=2 agesexgp=13. if age>25 and age<40 and sex=2 agesexgp=14. if age>39 and age<60 and sex=2 agesexgp=15. if age>39 and age<60 and sex=2 agesexgp=16. if age>59 and age<71 and sex=2 agesexgp=17. if age>59 and age<71 and sex=2 agesexgp=18. if age>70 and sex=2 agesexgp=19. freq agesexgp. sort cases by agesexgp day. aggregate out='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\group.sav' /break=agesexgp /grouptot=sum(intwt)/ groupn=nu. execute. aggregate out='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\day.sav' /break= agesexgp day /daytot=sum(intwt) /dayn=nu. execute. match files file=* table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\group.sav' /by agesexgp. execute. match files file=* table='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\day.sav' /by agesexgp day. execute. compute exptot=(grouptot/7). Do if badcase=0. compute propwt=exptot/daytot. * compute propwt=(exptot/daytot)/(dayn/daytot). Else if badcase>0. compute propwt=0. End if. desc propwt ocombwt. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=countrya /wsum = SUM(propwt). freq wsum. compute propwt=propwt*10360/9369.95. desc propwt. sort cases by hldid persid id. apply dictionary from 'C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\MTUS database\schema&etc\MTUSW553schema.sav'. if civstat=1 and sppart=-7 sppart=0. compute msamp=0. *end corrections. compute tottime=sum(main1 to main69). freq tottime badcase. recode main1 main10 main11 main13 main62 (0=-9). desc main1 to main69 sppart age. cro sppart by civstat. SAVE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\UK1983w58kid.sav' /drop tottime. select if age>17. freq badcase. means age by sex /cells=min max. SAVE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\UK1983w58.sav' /keep countrya survey swave msamp hldid persid id parntid1 parntid2 partid day month year diary badcase 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 occup sector educa edtry rushed health carer disab 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 sppart ocombwt propwt. get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\UK1983w58kid.sav'. select if age<18. freq badcase. means age by sex /cells=min max. compute msamp=0. SAVE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\UK1983w58kid.sav' /keep countrya survey swave msamp hldid persid id parntid1 parntid2 partid day month year diary badcase 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 occup sector educa edtry rushed health carer disab 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 sppart ocombwt propwt. *world 6 files. get SAS data='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\uk1983w60.sas7bdat'. rename variables (countreg=countrya). compute msamp=0. apply dictionary from 'C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\MTUS database\schema&etc\MTUSW60schema.sav'. recode sppart (15 thru high=1) (0=0). rename variables (badcase=aobad). sort cases by hldid persid id epnum. temp. select if inout=3 and mtrav=-8. freq main. if inout=3 and mtrav=-8 mtrav=5. execute. temp. select if sec=41. freq main. recode sec (41=69) (else=copy). freq sec. temp. select if inout=-8. freq main sec time eloc aobad. Do if (hldid=759 and persid=2 and ((id=6 and epnum=8) or (id=7 and epnum=1))) or (hldid=830 and persid=1 and ((id=4 and epnum=9) or (id=5 and epnum=1))) or (hldid=984 and persid=1 and ((id=1 and epnum=1) or (id=7 and epnum=6))) or (hldid=1107 and persid=1 and id=2 and epnum=1) or (hldid=1576 and persid=1 and ((id=5 and epnum=1) or (id=6 and epnum=1))) or (hldid=1598 and persid=4 and ((id=3 and epnum=1) or (id=4 and epnum=1) or (id=5 and epnum=1))) or (hldid=1782 and persid=2 and ((id=4 and epnum=9) or (id=5 and epnum=1))). compute main=69. End if. Execute. Do if hldid=1681. compute sex=1. Else if sex=-8. compute sex=2. End if. execute. compute mt=0. if main=69 or (main=41 and time>90) mt=time. compute e=0. compute s=0. compute pc=0. compute te=0. if main=5 or main=6 or main=18 or main=19 or main=39 or sec=5 or sec=6 or sec=18 or sec=19 or sec=39 or eloc=6 e=1. if main=2 or main=3 or main=12 or main=55 or sec=2 or sec=3 or sec=12 or sec=55 s=1. if main=1 or main=4 or main=25 or sec=1 or sec=4 or sec=25 pc=1. if main=11 or (main>41 and main<48) or (main>61 and main<69) or sec=11 or (sec>41 and sec<48) or (sec>61 and sec<69) te=1. compute cr=0. if (main>26 and main<33) or main=66 or (sec>26 and sec<33) or sec=66 cr=1. compute ah=0. if eloc=1 or eloc=2 ah=time. execute. aggregate outfile=* mode=addvariables /break hldid persid id /maxep 'total # of episodes'=MAX(epnum) /miss=SUM(mt) /eat=MAX(e) /sleep=MAX(s) /pcare=MAX(pc) /extrav=MAX(te) /carer=MAX(cr) /athome=SUM(ah). freq sex age day. recode eat sleep pcare extrav (1=0) (0=1). compute misbas=eat+sleep+pcare+extrav. freq misbas. Recode misbas (0,1=0) (2,3,4=1) into misbasic. cro misbasic by carer. if carer=1 and misbasic=1 misbasic=0. cro maxep by misbasic. Do if miss<91 and misbasic=1 and maxep>14. compute misbasic=0. Else if miss<91 and athome<1000 and misbasic=1 and maxep>10. compute misbasic=0. End if. freq misbasic. compute badcase=0. Do If miss>90 and maxep<7 and misbasic=1. compute badcase=25. Else if miss<91 and maxep<7 and misbasic=1. compute badcase=15. Else if miss>90 and maxep>6 and misbasic=1. compute badcase=14. Else if miss>90 and maxep<7 and misbasic=0. compute badcase=13. Else if miss<91 and maxep>6 and misbasic=1. compute badcase=5. Else if miss<91 and maxep<7 and misbasic=0. compute badcase=4. Else if miss>90 and maxep<7 and misbasic=0. compute badcase=3. End if. apply dictionary from 'C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\MTUS database\schema&etc\MTUSW60schema.sav'. cro badcase by aobad. *check labels and distrubutions. freq countrya survey swave msamp id day cday month year diary badcase sex age clockst main sec av inout eloc ict mtrav alone child sppart oad. cro mtrav by inout. desc hldid persid age time start end epnum. SAVE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\UK1983w6kid.sav' /keep countrya survey swave msamp hldid persid id day cday month year diary badcase sex age time clockst start end epnum main sec av inout eloc ict mtrav alone child sppart oad. AGGREGATE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\fixbadcase.sav' /break hldid persid id /badcase=MAX(badcase). select if age>17. means age by sex /cells=min max. SAVE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\UK1983w6.sav' /keep countrya survey swave msamp hldid persid id day cday month year diary badcase sex age time clockst start end epnum main sec av inout eloc ict mtrav alone child sppart oad. get file='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\UK1983w6kid.sav'. select if age<18. means age by sex /cells=min max. SAVE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\UK1983w6kid.sav'. *final fixes for the supplementary file. get SAS data='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\supplement.sas7bdat'. rename variables (incolab=aoinco). recode aoinco (5=1) (11=3) (6=4) (10=5) (8=6) (1=7) (9=8) (4=9) (7=10) (12=11)(3=12) (else=copy) into incolab. Do if hldid=1681. compute sexd=1. Else if sexd=-8. compute sexd=2. End if. execute. var lab hldid 'Household identifier'. val lab hldid 0 '1 person sampled per household'. var lab persid 'Person/diarist identifier'. var lab id 'Diary identifier'. val lab sexd 1 Man 2 Woman -8 missing. val lab aged 80 80 or older -7 not asked -8 missing. var lab aglftsch 'age left formal schooling'. val lab aglftsch -8 missing 0 still in school 15 15 or less 21 21 or older. var lab region country and English region. val lab region -8 missing 1 North of England 2 English Midlands 3 East of England 4 London and South East 5 South & West of England 6 Wales 7 Scotland 8 Northern Ireland. var lab ethnic 'ethnicity'. val lab ethnic -9 not possible to create -8 missing 1 white 2 black 3 "Indian/Pakistani/Bangladeshi" 4 other and mixed race. val lab educalab -8 missing 1 "no qualification" 2 "CSE 2-5" 3 "CSE 1/GCE O" 4 ONC 5 HNC 6 "City & Guilds" 7 Full appenticeship 8 GCE A 9 Teacher training 10 Nursing qualification 11 "Other professional qualification/diploma" 12 Degree. recode animal (-7=0). val lab incolab 1 Less than 2000 2 2000 – 2999 3 3000 – 3999 4 4000 – 4999 5 5000 – 5999 6 6000 – 6999 7 7000 – 7999 8 8000 – 9999 9 10000 – 11999 10 12000 – 14999 11 15000 – 19999 12 20000 or more 97 missing 98 missing 99 missing. recode empinlab (83 thru 84=83) (208 thru 209=208) (291 thru 292=292) (458 thru 459=458) (541 thru 542=542) (708 thru 709=708) (791 thru 792=792) (958 thru 959=958) (else=copy). compute empinlab=-9. formats empinlab (f4.0). val lab empinlab -9 not available in survey. freq survey id sexd aged incolab educalab empinlab aglftsch ethnic region. desc hldid persid animal. sort cases by hldid persid id. save outfile='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\UK1983extravar.sav' /keep survey hldid persid id sexd aged incolab educalab empinlab aglftsch ethnic region animal. *additional variables. get file='C:\Documents and Settings\All Users\Documents\time-use-library\UK\1984_esrc\qnnaireplus.SAV' /keep dem1 dem52. freq dem52. get file='C:\Documents and Settings\All Users\Documents\time-use-library\UK\1984_esrc\BIGDAT.SAV'. compute test10=0. compute test11=0. compute horse=0. do repeat a= moa1 to sud96. if a=302 test10=test10+1. if a=505 test11=test11+1. if a=1913 horse=horse+1. End repeat. freq test10 test11 horse. *no instances of main10 or main11. temp. select if horse>0. freq dem1 dem2. *horse riders in household ids: *392 1812 1933 2009. *additional variables. get file='C:\Documents and Settings\All Users\Documents\time-use-library\UK\1984_esrc\qnnaireplus.SAV' /keep dem1 dem2 dem6 dem7 dem47 hh1 hh21 hh22 hh2 hh3 hh4 hh5 hh6 hh7 hh8 hh9 hh10 hh11 hh12 hh13 hh14 hh15 hh71 dem77 dem168 dem169 dem172 dem173 dem174 dem175 hh70 dem179 hh62 dem94 dem98 dem101 dem133 dem134 dem135 dem149 dem118 dem176 dem111 hh16 hh17 hh18 hh19 dem104. compute driver=0. *if person drivers car or motorcycle, count as driver. if dem133=1 or dem134=1 driver=1. compute horse=0. *these 4 households are the households where people report riding a horse. if dem1=392 or dem1=1812 or dem1=1933 or dem1=2009 horse=1. compute motor=0. cro hh62 by dem135. Do if dem179>2 or dem94=2 or dem98=2 or dem101=2 or dem149=2. compute motor=3. Else if dem135=1. compute motor=2. End if. aggregate outfile=* mode=addvariables /break=dem1 /ndrivers=SUM(driver) /vehicle=MAX(motor). cro vehicle by horse ndrivers. *horse riders all in car households. if vehicle=3 and ndrivers>1 vehicle=4. if vehicle<3 and ndrivers>0 vehicle=3. freq vehicle. compute region=-8. Do if dem7=12 or dem7=81 or dem7=101 or dem7=102 or dem7=112 or dem7=141 or dem7=142 or dem7=151 or dem7=152 or dem7=191 or dem7=192 or dem7=202 or dem7=211 or dem7=212 or dem7=221 or dem7=222. compute region=1. Else if dem7=32 or dem7=52 or dem7=111 or dem7=121 or dem7=132 or dem7=161 or dem7=162 or dem7=201 or dem7=231 or dem7=282. compute region=2. Else if dem7=21 or dem7=22 or dem7=31 or dem7=41 or dem7=42 or dem7=82 or dem7=91 or dem7=122 or dem7=131 or dem7=271 or dem7=272 or dem7=281 or dem7=291 or dem7=292 or dem7=301 or dem7=302. compute region=4. Else if dem7=61 or dem7=62 or dem7=92. compute region=5. Else if dem7=51 or dem7=171 or dem7=172 or dem7=181 or dem7=182. compute region=6. Else if dem7=11 or dem7=71 or dem7=72 or dem7=241 or dem7=242 or dem7=251 or dem7=252 or dem7=261 or dem7=262. compute region=7. End if. freq region. compute urban=1. if dem7>50 and dem7<90 urban=2. cro dem7 by urban. missing values dem176 dem118 (). recode dem176 (0,1=0) (2 thru 5=1) (6 thru 8=2) (9,10=3) (99=-8) into health. freq health. recode dem118 (6=0) (1=15) (2=16) (3=17) (4=18) (5=19) (0,8,9=-8) into aglftsch. if dem111<20 and aglftsch=-8 aglftsch=0. var lab aglftsch age left formal education. val lab aglftsch -8 missing 0 still in school 15 15 or less 21 21 or older. freq aglftsch. compute disab=0. if dem168=4 or dem169=4 or dem175=1 disab=1. freq disab. cro disab by dem168 dem169 dem175 hh70. Do if dem7<20. compute ocombwt=0.619. Else if dem7<30. compute ocombwt=0.984. Else if dem7<40. compute ocombwt=1.550. Else if dem7<50. compute ocombwt=1.426. Else if dem7<60. compute ocombwt=1.683. Else if dem7<70. compute ocombwt=1.820. Else if dem7<80. compute ocombwt=0.544. Else if dem7<90. compute ocombwt=1.649. Else if dem7<100. compute ocombwt=1.700. Else if dem7<110. compute ocombwt=1.688. Else if dem7<120. compute ocombwt=1.925. Else if dem7<130. compute ocombwt=0.829. Else if dem7<140. compute ocombwt=1.065. Else if dem7<150. compute ocombwt=0.901. Else if dem7<160. compute ocombwt=0.861. Else if dem7<170. compute ocombwt=0.530. Else if dem7<180. compute ocombwt=1.046. Else if dem7<190. compute ocombwt=0.270. Else if dem7<200. compute ocombwt=0.837. Else if dem7<210. compute ocombwt=1.093. Else if dem7<220. compute ocombwt=1.609. Else if dem7<230. compute ocombwt=0.493. Else if dem7<240. compute ocombwt=0.829. Else if dem7<250. compute ocombwt=0.742. Else if dem7<260. compute ocombwt=0.439. Else if dem7<270. compute ocombwt=0.249. Else if dem7<280. compute ocombwt=2.375. Else if dem7<290. compute ocombwt=0.665. Else if dem7<300. compute ocombwt=0.287. Else. compute ocombwt=0.855. End if. means ocombwt by dem7. freq dem104. weight by ocombwt. freq dem104. weight off. save outfile='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1983\short-qnnaireplus.SAV' /drop driver horse motor ndrivers dem104.