*final check of UK 1995 files. *updated 6 September 2013. *aggrgate version. GET SAS DATA='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995w58.sas7bdat'. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995haf.sav'. GET SAS DATA='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995w58kid.sas7bdat'. add files files=* files='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995haf.sav'. execute. sort cases by persid. rename variables (countreg edtry=countrya edcat). compute id=1. apply dictionary from 'C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\MTUS database\schema&etc\MTUShafschema.sav'. compute propwt=propwt*(2005/1994.3). 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=countrya /wtsum = SUM(propwt). freq wtsum. compute tottime=av1 + av2 + sum(av4 to av11) + av13 + sum(av15 to av19) + av23 + av24 + av28 + av29 + av31 + av33 + sum(av35 to av37) + sum(av40 to av41). freq tottime. freq countrya survey swave msamp 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 occup 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 cphome. cro agekidx by nchild. if empstat=3 emp=1. cro empstat by emp unemp retired student disab. cro empsp by civstat relrefp. cro civstat by hhtype relrefp partid cohab cphome. *note no relrefp=2 should appear if civstat=2. compute tottime=sum(main1 to main4) + sum(main6 to main8) + main12 + main15 + main16 + main18 + sum(main20 to main22) + main24 + main28 + main32 + main33 + main35 + main37 + main39 + main42 + main46 + main48 + main49 + main51 + sum(main54 to main56) + main59 + main62 + main63 + main69. freq tottime. weight by propwt. freq day. cro day by sex /cells= count column. weight off. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995haf.sav' /drop wtsum tottime. *episode files. GET SAS DATA='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995w60.sas7bdat'. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995hef.sav'. GET SAS DATA='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995w60kid.sas7bdat'. add files files=* files='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995hef.sav'. execute. sort cases by persid. rename variables (countreg=countrya). compute id=1. apply dictionary from 'C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\MTUS database\schema&etc\MTUShefschema.sav'. *check labels and distrubutions. freq countrya survey swave msamp day cday month year diary badcase sex age clockst epnum main sec av inout eloc ict mtrav alone child sppart oad. cro mtrav main by inout. desc hldid persid id age time start end epnum. compute inout=-9. freq inout. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995hef.sav'. *final tidy extra UK variables. GET SAS DATA='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\uk1995extravar.sas7bdat'. 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'. compute id=1. val lab sexd 1 Man 2 Woman -8 missing. val lab aged 80 80 or older -7 not asked -8 missing. 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. var lab empinlab 'income from employment labelled'. val lab empinlab -9 not possible to create. var lab aglftsch age left formal education. val lab aglftsch -8 missing 0 still in school 15 15 or less 21 21 or older. val lab educalab -8 missing in original data 1 "up to 14" 2 15-18 3 19-25 4 over 25 5 still in education 6 no education. val lab incolab -8 missing in original data 1 less than 1000 2 1000 - 1999 3 2000 - 2999 4 3000 - 3999 5 4000 - 4999 6 5000 - 5999 7 6000 - 6999 8 7000 - 7999 9 8000 - 8999 10 9000 - 9999 11 10000 - 10999 12 11000 - 11999 13 12000 - 12999 14 13000 - 13999 15 14000 - 14999 16 15000 - 17499 17 17500 - 19999 18 20000 - 24999 19 25000 - 29999 20 30000 - 39999 21 40000 or more 98 no source of income 99 refused. freq survey hldid sexd aged incolab educalab empinlab aglftsch ethnic region. desc persid id. cro educalab by aglftsch. save outfile='C:\Documents and Settings\Kimberly Fisher\My Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\MTUS-UK1995extravar.sav'. SAVE TRANSLATE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\MTUS-UK1995extravar.dta' /TYPE=STATA /VERSION=8 /EDITION=INTERCOOLED /MAP /REPLACE. SAVE TRANSLATE OUTFILE='C:\Users\Kimberly Fisher\Documents\Kimberly\time\mtus\mtus data\W553\UK\1995\MTUS-UK1995extravar.csv' /TYPE=CSV /MAP /REPLACE /FIELDNAMES /CELLS=VALUES.