* Encoding: UTF-8. *final check of Netherlands 1995 files. ****************************************************************************************** *final preparation of Netherlands 1995 files for deposit in the IPUMS Time Use extract system *Kimberly Fisher, Centre for Time Use Research, University of Oxford, 12 November 2016 ******************************************************************************************. get STATA file='E:\MTUS-archive\Netherlands\75-95\Netherlands_1995.dta'. rename variables (resp=persid). sort cases by persid. var lab v105 employment sector. recode V105 (sysmis=-5). val lab v105 -5 nvt 1 self-employed 2 works unpaid on family farm 3 in public service 4 in paid employment 5 other. freq v105. freq V421. *main breadwinner V164; spouse main breadwinner v437. recode V550 (sysmis=7). var lab V550 health status. val lab V550 1 very good 2 good 3 fair 4 mixed good to poor 5 poor 7 no response. freq V550. freq V200 V202 V418. cro V200 by V201 V202. freq v164. freq v258. recode v258 (sysmis=99997). cro v258 by inkomen. temp. select if v258<99990. freq v258. missing values v258 (). recode v258 (1 thru 2360=1) (99997=-8) (4485 thru 99990=3) (else=2) into income. cro income by inkomen. freq income. Aggregate outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\adddem.sav' /break persid /vsector=MAX(v105) /vocc=max(V421) /vhealth=max(V550) /vcarer=max(V418) /vcarer2=max(V201) /incorig=max(v258). *aggregate file fixes. new file. get STATA file= 'C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\Net1995W58.dta'. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\nl1995haf.sav' /compressed. get STATA file= 'C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\Net1995W58kid.dta'. add files files=* files='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\nl1995haf.sav'. sort cases by hldid persid id. string country (A2). compute country = 'NL'. freq country. rename variables (occup edtry incorig=occupo edcat inco). compute isco1=-9. recode badcase (0=0) (1 thru hi=1) into nowght. If (persid=64 and id=7) or (persid=130 and id=5) or (persid=559 and (id=2 or id=3)) or (persid=661 and id=4) or (persid=888 and id=7) or (persid=977 and id=1) or (persid=1325 and id=7) or (persid=1333 and id=3) or (persid=1725 and id=6) or (persid=2004 and id=4) or (persid=2211 and id>4) or (persid=2218 and id=6) or (persid=2384 and id=2) or (persid=2671 and id=3) or (persid=2739 and id=7) or (persid=2912 and id=1) or (persid=10389 and id=7) nowght=0. cro badcase by nowght. match files file=* /in=agg table='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\adddem.sav' /in=dem /by persid. execute. cro agg by dem. recode incorig (1 thru 2360=1) (99997=-8) (4485 thru 99990=3) (else=2) into income. means incorig by income /cells min max mean. freq income. cro empstat age by vsector. Do if vsector=-5 and empstat=4. compute sector=-7. Else if vsector=-5. compute sector=-8. Else if vsector=3. compute sector=1. Else. compute sector=2. End if. cro sector by vsector. freq sector. if vhealth=7 health=-8. if vhealth=1 health=3. if vhealth=2 health=2. if vhealth=3 health=1. if vhealth=4 or vhealth=5 health=0. freq health. cro vhealth by health. compute occupo=vocc. freq occupo. compute carer=0. if vcarer>0 or vcarer2=1 carer=1. freq carer. cro carer by vcarer vcarer2 sex age. *adjust create weight following correction of some no weight cases. desc ocombwt. Do if age<17 and sex=1. compute agesexgp=1. Else if age<17 and sex=2. compute agesexgp=11. Else if age<25 and sex=1. compute agesexgp=2. Else if age<25 and sex=2. compute agesexgp=12. Else if age<38 and sex=1. compute agesexgp=3. Else if age<38 and sex=2. compute agesexgp=13. Else if age<50 and sex=1. compute agesexgp=4. Else if age<50 and sex=2. compute agesexgp=14. Else if age<66 and sex=1. compute agesexgp=5. Else if age<66 and sex=2. compute agesexgp=15. Else if age>65 and sex=1. compute agesexgp=6. Else if age>65 and sex=2. compute agesexgp=16. End if. freq agesexgp. cro agesexgp by sex emp. *allow for 0-weighting of the bad diary cases. compute wt=ocombwt. if nowght=1 agesexgp=99. freq agesexgp nowght. if agesexgp=99 wt=0. sort cases by agesexgp day. aggregate out='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\group.sav' /break=agesexgp /grouptot=sum(wt)/ groupn=nu. execute. aggregate out='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\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\Netherlands\1995\group.sav' /by agesexgp. execute. match files file=* table='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\day.sav' /by agesexgp day. execute. compute exptot=(grouptot/7). Do if nowght=1. compute propwt=0. Else if nowght=0. compute propwt=(exptot/daytot)/(dayn/daytot). End if. weight off. desc propwt ocombwt. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=country /wtsum = SUM(propwt). freq wtsum. *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*(22589/22488.89). AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=country /wtsum2 = SUM(propwt). freq wtsum2. recode workhrs (sysmis=-8). cro workhrs by emp. temp. select if unemp=1 or retired=1 or student=1. freq main7 main8 main9 main10 main11 main12 main13. temp. select if workhrs=-8. freq main7 main8 main9 main10 main11 main12 main13. recode main10 (-9=0). compute aw=0. if (((unemp=1 or retired=1 or student=1) and empstat=4) or workhrs=-8) and (main7>0 or main8>0 or main9>0 or main10>0 or main11>0 or main12>0 or main13>0) aw=sum (main7 to main12). aggregate outfile=* mode=addvariables /break hldid persid /anywork=sum(aw). freq anywork. cro anywork by student retired unemp. Do if (((unemp=1 or retired=1 or student=1) and empstat=4) or workhrs=-8) and (anywork>0 and anywork<1000). compute empstat=3. compute emp=1. do if anywork>0 and anywork<90. compute workhrs=1. Else if anywork>89 and anywork<150. compute workhrs=2. Else if anywork>149 and anywork<210. compute workhrs=3. Else if anywork>209 and anywork<270. compute workhrs=4. Else if anywork>269 and anywork<330. compute workhrs=5. Else if anywork>329 and anywork<390. compute workhrs=6. Else if anywork>389 and anywork<450. compute workhrs=7. Else if anywork>449 and anywork<510. compute workhrs=8. Else if anywork>509 and anywork<570. compute workhrs=9. Else if anywork>569 and anywork<630. compute workhrs=10. Else if anywork>529 and anywork<690. compute workhrs=11. Else if anywork>689 and anywork<750. compute workhrs=12. Else if anywork>749 and anywork<810. compute workhrs=13. Else if anywork>809 and anywork<870. compute workhrs=14. Else if anywork>869 and anywork<930. compute workhrs=15. Else if anywork>929 and anywork<990. compute workhrs=16. Else if anywork>989 and anywork<1050. compute workhrs=17. End if. Else if (((unemp=1 or retired=1 or student=1) and empstat=4) or workhrs=-8) and anywork>999. compute empstat=2. compute emp=1. Do if anywork>989 and anywork<1050. compute workhrs=17. Else if anywork>1049 and anywork<1110. compute workhrs=18. Else if anywork>1109 and anywork<1170. compute workhrs=19. Else if anywork>1169 and anywork<1230. compute workhrs=20. Else if anywork>1229 and anywork<1290. compute workhrs=21. Else if anywork>1289 and anywork<1350. compute workhrs=22. Else if anywork>1349 and anywork<1410. compute workhrs=23. Else if anywork>1409 and anywork<1470. compute workhrs=24. Else if anywork>1469 and anywork<1530. compute workhrs=25. Else if anywork>1429 and anywork<1590. compute workhrs=26. Else if anywork>1589 and anywork<1650. compute workhrs=27. Else if anywork>1649 and anywork<1710. compute workhrs=28. Else if anywork>1709 and anywork<1770. compute workhrs=29. Else if anywork>1769 and anywork<1830. compute workhrs=30. Else if anywork>1829 and anywork<1890. compute workhrs=31. Else if anywork>1889 and anywork<1950. compute workhrs=32. Else if anywork>1949 and anywork<2010. compute workhrs=33. Else if anywork>2009 and anywork<2070. compute workhrs=34. Else if anywork>2069. compute workhrs=35. End if. End if. freq workhrs. compute survey=1995. compute year=1995. recode computer (-8=0). if civstat=-8 cohab=-8. if civstat=2 cohab=-7. Do if persid=1779. compute famstat=2. compute agekidx=3. End if. if age<18 and nchild=0 nchild=1. if nchild=hhldsize and hhldsize>1 hhldsize=hhldsize+1. execute. cro incorig by income. freq income apply dictionary from 'C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\MTUS database\schema&etc\MTUSHAFschema.sav'. desc propwt ocombwt. weight by propwt. cro day by sex /cel=col. freq agesexgp day. weight off. sort cases by persid id. SAVE OUTFILE='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\nl1995haf.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 /compressed. recode main1 to main69 (-9=0). 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. sort cases by persid. 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\Netherlands\1995\nl1995hcf.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. new file. get file='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\nl1995haf.sav'. *episode files. get STATA FILE= 'C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\Net1995W6.dta'. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\nl1995hef.sav' /compressed. get STATA file= 'C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\Net1995W6kid.dta'. add files files=* files='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\nl1995hef.sav'. sort cases by hldid persid id epnum. string country (A2). compute country = 'NL'. freq country. compute survey=1995. compute year=1995. recode badcase (0=0) (1 thru hi=1) into nowght. If (persid=64 and id=7) or (persid=130 and id=5) or (persid=559 and (id=2 or id=3)) or (persid=661 and id=4) or (persid=888 and id=7) or (persid=977 and id=1) or (persid=1325 and id=7) or (persid=1333 and id=3) or (persid=1725 and id=6) or (persid=2004 and id=4) or (persid=2211 and id>4) or (persid=2218 and id=6) or (persid=2384 and id=2) or (persid=2671 and id=3) or (persid=2739 and id=7) or (persid=2912 and id=1) or (persid=10389 and id=7) nowght=0. cro badcase by nowght. do if clockst>0. compute clockst=clockst-.01. end if. freq clockst. if eloc=-8 and (main=38 or main=45) eloc=9. if persid=696 and id=6 and (epnum>7 and epnum<13) eloc=1. if persid=2333 and id=4 and (epnum>7 and epnum<14) eloc=1. if inout=-8 and (main=3 or main=5 or main=8 or main=15 or main=25 or main=26 or main=37 or main=61) inout=1. execute. compute test=0. if main=5 and lag(eloc)=4 test=1. freq test. if test=1 eloc=4. execute. compute ict=0. if main=61 ict=1. freq ict. apply dictionary from 'C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\MTUS database\schema&etc\MTUSHEFschema.sav'. save outfile='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\nl1995hef.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 /compressed. new file. get file='C:\Users\Kimberly Fisher\Desktop\Kimberly\time\mtus\mtus data\countries\Netherlands\1995\nl1995hef.sav'.