. set memory 40m (40960k) . set more 1 . ! /bin/rm -f /tmp/aef.raw aef.dct dcthead . * Obtain raw data from Chung Underwood at BLS 202-606-7786 . ! echo >dcthead dictionary using /tmp/aef.raw . program define aef2 1. * '-A' are missing value indicators in the earlier files. . if `1' < 94 {!zcat ../raw/morg`1'.Z |tr "\-A" " " >/tmp/aef.raw} 2. if `1' >= 94 {!zcat ../raw/morg`1'.Z >/tmp/aef.raw} 3. ! cat dcthead aef`2'.dbd >aef.dct 4. quietly infile using aef if age>15&age!=. 5. . * Geography . generate byte year = `1' 6. replace smsastat = . if smsastat==3 | smsastat<0 7. if `1' >= 95 { replace smsastat = smsa995 if intmonth>=9 } 8. if `1' <= 94 { drop smsa995 } 9. replace centcity = . if centcity==4 10. if `1' >= 86 { replace pmsarank = . if pmsarank<=0} 11. if `1' > 84 { replace cmsarank = . if cmsarank<=0} 12. if `1' >= 89 { replace msafips = . if msafips <=0 13. replace cmsacode = . if cmsacode<=0} 14. replace docc80 = . if docc80<=0 15. if `1' < 83 { drop docc80 } 16. if `1' == 85 { replace smsarank = . if intmonth > 9} 17. if `1' == 84 | `1'==85 { drop icntcity pmsarank cmsarank } 18. if `1' == 94 { replace cmsarank = . if intmon>3 } 19. if `1' > 94 { drop cmsarank } 20. replace smsasize=. if smsasize<=0 21. if `1' < 85 { generate byte smsa70 = smsasize } 22. if `1' > 85 { generate byte smsa80 = smsasize } 23. if `1' == 85 { generate byte smsa70 = smsasize if intmonth<10 } 24. if `1' == 85 { generate byte smsa80 = smsasize if intmonth>9 } 25. drop smsasize 26. if `1' > 85 & `1' < 89 { drop smsarank } 27. if `1' < 83 { drop unioncov unionmme occ80 ind80 } 28. . * Demography . if `1' < 89 { replace gradeat = gradeat - 1 29. replace marital = 7 if marital==5 } 30. if `1' > 91 { generate grade92=gradeat 31. drop gradecp gradeat} 32. if `1' >= 95 { replace relref94 = 11 if relref94 >12 33. replace relref94 = . if relref94 < 0 } 34. if `1' >= 94 { replace veteran = . if veteran < 0 35. replace peinusyr = . if peinusyr < 0 } 36. . . * Employment . if `1' <= 93 & `1'>=89{replace classer1=. if classer1==8|classer1<0} 37. if `1' <= 93 { replace class = . if class==8 } 38. if `1' >= 94 { replace dind94 = . if dind94<=0 39. replace lfsr94 = . if lfsr94 <0 40. replace occ80 = . if occ80 <0 41. replace ind80 = . if ind80 <0 42. replace class94 = . if class94<0 } 43. . * Wages (If earnings are 0, then wage rate is missing, not zero). . replace paidhr = . if paidhr <=0 44. replace paidhre = . if paidhre <=0 45. replace earnhr = . if earnhr <=0 46. replace earnhre = . if earnhre <=0 47. replace earnwke = . if earnwke < 0 48. if `1' < 89 {replace eligible = 2 if eligible==.} 49. if `1' >= 89 {replace eligible = 2 if eligible==0} 50. if `1' < 89 {replace I25a = 0 if I25a ==. 51. replace I25b = 0 if I25b ==. 52. replace I25c = 0 if I25c ==. 53. replace I25d = 0 if I25d ==.} 54. if `1' >= 94 {replace eligible = 0 if eligible ==. 55. replace I25a = 0 if I25a <= 3 56. replace I25b = 0 if I25b <= 3 57. replace earnhre = . if earnhre ==1 58. replace uhourse = . if pemlr >2 | pemlr <1 59. replace pemlr = . if pemlr < 0 } 60. . * Hours, Unions . if `1' >= 94 { 61. replace reason94 = . if reason94< 0 62. replace absent94 = . if absent94< 0 63. replace studftpt = . if studftpt< 0 64. replace ftpt94 = . if ftpt94 < 0 65. replace hourslw = . if hourslw < 0 66. replace uhourse = . if uhourse < 0 67. replace why3594 = . if why3594 < 0 68. replace unionmme = . if unionmme< 0 69. replace unioncov = . if unioncov< 0 } 70. . * Save and exit . ! /bin/rm -f ../annual/morg`1'.dta 71. compress 72. save ../annual/morg`1',old 73. summarize 74. clear 75. ! /bin/rm -f aef.dct /tmp/aef.raw 76. end . . * Each block of commands does one year of the data. The data must be . * decompressed, and possibly have dashes converted to blanks. . * Then a dictionary for the particular year is prepared by . * concatenating a one line header (with the file name) to a generic . * dictionary body that covers several years of data that used the . * same format. . * Lastly, the data is read, modified, summarized and saved. . . * aef2 79 79_83 . * aef2 80 79_83 . * aef2 81 79_83 . * aef2 82 79_83 . * aef2 83 79_83 . * aef2 84 84_88 . * aef2 85 84_88 . * aef2 86 84_88 . * aef2 87 84_88 . * aef2 88 84_88 . * aef2 89 89_93 . * aef2 90 89_93 . * aef2 91 89_93 . * aef2 92 89_93 . * aef2 93 89_93 . aef2 94 94 (0 real changes made) (0 real changes made) (292194 real changes made, 292194 to missing) (263993 real changes made, 263993 to missing) (103879 real changes made, 103879 to missing) (291371 real changes made, 291371 to missing) (93092 real changes made, 93092 to missing) (0 real changes made) (263993 real changes made, 263993 to missing) (263993 missing values generated) (1518 real changes made, 1518 to missing) (284596 real changes made, 284596 to missing) (93092 real changes made, 93092 to missing) (1518 real changes made, 1518 to missing) (93092 real changes made, 93092 to missing) (93092 real changes made, 93092 to missing) (93092 real changes made, 93092 to missing) (139174 real changes made, 139174 to missing) (0 real changes made) (205216 real changes made, 205216 to missing) (0 real changes made) (0 real changes made) (139174 real changes made) (9256 real changes made) (121454 real changes made) (146913 real changes made) (0 real changes made) (122969 real changes made, 122969 to missing) (1518 real changes made, 1518 to missing) (303165 real changes made, 303165 to missing) (309905 real changes made, 309905 to missing) (289860 real changes made, 289860 to missing) (1518 real changes made, 1518 to missing) (132298 real changes made, 132298 to missing) (14588 real changes made, 14588 to missing) (258636 real changes made, 258636 to missing) (139174 real changes made, 139174 to missing) (165856 real changes made, 165856 to missing) uhourse was int now byte grade92 was float now byte file ../annual/morg94.dta saved Variable | Obs Mean Std. Dev. Min Max ---------+----------------------------------------------------- hurespli | 319234 1.59088 .7972991 0 14 intmonth | 319234 6.48794 3.454723 1 12 minsamp | 319234 6.01778 1.999924 4 8 state | 319234 51.01258 26.05296 11 95 centcity | 0 smsa93 | 0 centcitx | 0 msafips | 215355 4441.511 2546.685 80 9340 pmsarank | 27040 1.774519 1.527274 1 12 cmsarank | 55241 42.91276 54.06513 1 252 cmsacode | 27863 51.30176 25.19262 7 91 smsastat | 0 icntcity | 0 icntcit2 | 146 1 0 1 1 hhid | 0 sex | 319234 1.530752 .4990542 1 2 veteran | 317716 5.564038 1.238336 1 6 why3594 | 60598 12.69341 7.98549 1 23 class94 | 220259 4.134051 1.226125 1 8 unioncov | 145168 1.969491 .171985 1 2 studftpt | 21989 1.106599 .3086094 1 2 relref94 | 319234 2.752692 2.258558 1 12 age | 319234 44.118 18.26458 16 90 marital | 319234 3.141326 2.588014 1 7 race | 319234 1.260026 .7328593 1 5 hourslw | 186925 38.98526 14.31728 1 126 reason94 | 16069 5.533201 2.983082 1 13 absent94 | 9329 6.086504 3.321231 4 14 ind80 | 220332 575.5286 278.015 0 991 occ80 | 216886 371.1543 247.5946 3 905 uhourse | 181677 38.95988 12.07523 0 99 paidhre | 170865 1.385591 .486736 1 2 unionmme | 170804 1.843786 .3630593 1 2 ethnic | 319234 7.697914 1.247565 1 13 lfsr94 | 317716 2.82767 2.365349 1 7 ftpt94 | 317716 2.776775 2.564107 1 12 dind94 | 216886 31.53476 13.62572 1 52 docc80 | 216886 22.82801 12.60155 1 46 eligible | 319234 1.406968 .547115 0 2 earnhre | 114018 897.1795 667.861 10 9999 earnwke | 180060 459.0454 364.6597 0 1923 weight | 319234 1849.563 1039.374 0 20892.63 earnwt | 319234 7406.083 4162.328 0 77523.12 I25a | 317714 .1512933 2.292265 0 43 I25b | 317713 1.482464 7.73911 0 42 penatvty | 319234 82.05852 85.39633 -1 555 pemntvty | 319234 94.3358 102.6947 -1 555 pefntvty | 319234 95.77028 105.1506 -1 555 prcitshp | 319234 1.36935 1.099142 -1 5 prcitflg | 319234 .4461336 4.084665 -1 40 peinusyr | 34638 6.858797 3.748605 1 13 pemlr | 317716 2.82767 2.365349 1 7 year | 319234 94 0 94 94 smsa80 | 55241 5.223005 1.907405 2 8 grade92 | 319234 39.45939 2.851063 31 46 . aef2 95 94 (10077 real changes made, 10077 to missing) (92636 real changes made) (10056 real changes made, 10056 to missing) (240562 real changes made, 240562 to missing) (273856 real changes made, 273856 to missing) (149656 real changes made, 149656 to missing) (276489 real changes made, 276489 to missing) (97330 real changes made, 97330 to missing) (211516 real changes made, 211516 to missing) (211516 missing values generated) (9152 real changes made) (0 real changes made) (1512 real changes made, 1512 to missing) (0 real changes made) (97330 real changes made, 97330 to missing) (1512 real changes made, 1512 to missing) (97330 real changes made, 97330 to missing) (97330 real changes made, 97330 to missing) (97330 real changes made, 97330 to missing) (144044 real changes made, 144044 to missing) (0 real changes made) (209451 real changes made, 209451 to missing) (0 real changes made) (0 real changes made) (144044 real changes made) (0 real changes made) (119594 real changes made) (144044 real changes made) (1 real change made, 1 to missing) (119594 real changes made, 119594 to missing) (1512 real changes made, 1512 to missing) (298941 real changes made, 298941 to missing) (305346 real changes made, 305346 to missing) (292738 real changes made, 292738 to missing) (1512 real changes made, 1512 to missing) (128599 real changes made, 128599 to missing) (15016 real changes made, 15016 to missing) (264977 real changes made, 264977 to missing) (144044 real changes made, 144044 to missing) (169589 real changes made, 169589 to missing) uhourse was int now byte grade92 was float now byte file ../annual/morg95.dta saved Variable | Obs Mean Std. Dev. Min Max ---------+----------------------------------------------------- hurespli | 314351 1.599626 .8273512 0 16 intmonth | 314351 6.459327 3.446737 1 12 minsamp | 314351 5.985589 1.999951 4 8 state | 314351 51.10553 26.00006 11 95 centcity | 92779 3.795622 2.925915 0 7 smsa93 | 102835 3.815608 2.779838 0 7 centcitx | 102835 2.296018 .9885762 1 4 msafips | 164695 4432.164 2544.958 80 9360 pmsarank | 73789 5.815027 4.232164 2 45 cmsacode | 37862 52.55478 27.24881 7 97 smsastat | 102835 1.247591 .4371889 1 3 smsa995 | 314351 1.080995 .2757166 1 3 icntcity | 11669 1.158883 .6032019 0 9 icntcit2 | 102835 .0761025 .3147949 0 4 hhid | 0 sex | 314351 1.529873 .4991076 1 2 veteran | 312839 5.576891 1.221982 1 6 why3594 | 49374 14.73792 6.933514 1 23 class94 | 217021 4.128255 1.210992 1 8 unioncov | 144762 1.978413 .1453317 1 2 studftpt | 21613 1.100264 .3003583 1 2 relref94 | 314351 2.750263 2.250112 1 12 age | 314351 44.11763 18.15374 16 90 marital | 314351 3.147179 2.590233 1 7 race | 314351 1.289177 .7960335 1 5 hourslw | 185739 39.13648 14.24132 1 125 reason94 | 15410 5.200584 2.893293 1 13 absent94 | 9005 6.03176 3.335539 4 14 ind80 | 217021 580.0291 276.9189 10 991 occ80 | 217021 368.2459 249.0915 3 905 uhourse | 179741 39.09786 11.93249 0 99 paidhre | 170307 1.383578 .4862585 1 2 unionmme | 170307 1.850006 .3570664 1 2 ethnic | 314351 7.688441 1.259143 1 10 lfsr94 | 312839 2.802365 2.354497 1 7 ftpt94 | 312839 2.736996 2.51753 1 12 dind94 | 217021 31.59119 13.61135 1 52 docc80 | 217021 22.63339 12.67543 1 46 eligible | 314351 1.458227 .4982527 1 2 earnhre | 104899 991.3914 601.0681 20 9900 earnwke | 170307 498.6546 365.7329 0 1923 weight | 314351 1895.181 1043.936 0 14211.12 earnwt | 314351 7614.107 4169.327 134.0936 56722.81 I25a | 314351 .1899183 2.563101 0 43 I25b | 314351 2.198215 9.344298 0 42 penatvty | 314351 80.86875 78.57915 57 555 pemntvty | 314351 91.04422 91.46981 57 555 pefntvty | 314351 91.89685 92.77311 57 555 prcitshp | 314351 1.38381 1.112335 1 5 prcitflg | 314351 .2822418 3.003631 0 41 peinusyr | 314351 .7975511 2.57967 0 13 pemlr | 312839 2.802365 2.354497 1 7 year | 314351 95 0 95 95 smsa80 | 102835 24.20777 10.07484 11 43 grade92 | 314351 39.50774 2.859428 31 46 . aef2 96 94 (27526 real changes made, 27526 to missing) (84603 real changes made) (28800 real changes made, 28800 to missing) (77890 real changes made, 77890 to missing) (167660 real changes made, 167660 to missing) (77890 real changes made, 77890 to missing) (180515 real changes made, 180515 to missing) (85414 real changes made, 85414 to missing) (0 real changes made) (10208 real changes made) (0 real changes made) (1246 real changes made, 1246 to missing) (0 real changes made) (85414 real changes made, 85414 to missing) (1246 real changes made, 1246 to missing) (85414 real changes made, 85414 to missing) (85414 real changes made, 85414 to missing) (85414 real changes made, 85414 to missing) (125666 real changes made, 125666 to missing) (0 real changes made) (183931 real changes made, 183931 to missing) (0 real changes made) (0 real changes made) (125667 real changes made) (0 real changes made) (104435 real changes made) (125666 real changes made) (0 real changes made) (104435 real changes made, 104435 to missing) (1246 real changes made, 1246 to missing) (263578 real changes made, 263578 to missing) (269658 real changes made, 269658 to missing) (258235 real changes made, 258235 to missing) (1246 real changes made, 1246 to missing) (112633 real changes made, 112633 to missing) (14986 real changes made, 14986 to missing) (233851 real changes made, 233851 to missing) (125666 real changes made, 125666 to missing) (147736 real changes made, 147736 to missing) uhourse was int now byte grade92 was float now byte file ../annual/morg96.dta saved Variable | Obs Mean Std. Dev. Min Max ---------+----------------------------------------------------- hurespli | 277856 1.604759 .8477666 0 16 intmonth | 277856 6.536602 3.458798 1 12 minsamp | 277856 5.99214 1.999988 4 8 state | 277856 53.27262 26.07671 11 95 centcity | 249056 3.723448 2.888992 0 7 smsa93 | 277856 3.752113 2.736472 0 7 centcitx | 277856 2.308142 .9936333 1 4 msafips | 199966 4507.596 2519.146 80 9360 pmsarank | 199966 5.770506 4.345136 2 45 cmsacode | 97341 53.51734 26.82367 7 97 smsastat | 259511 3.417647 2.902478 0 9 smsa995 | 277856 1.243083 .435796 1 3 icntcity | 66935 1.345036 .9241111 0 9 icntcit2 | 277856 .0777561 .3246712 0 4 hhid | 0 sex | 277856 1.52967 .4991198 1 2 veteran | 276610 5.586711 1.209324 1 6 why3594 | 44005 14.70644 6.872433 1 23 class94 | 192442 4.129343 1.197261 1 8 unioncov | 130120 1.979427 .1419514 1 2 studftpt | 19621 1.092605 .2898853 1 2 relref94 | 277856 2.766235 2.281933 1 12 age | 277856 44.18312 18.13822 16 90 marital | 277856 3.161123 2.593398 1 7 race | 277856 1.231033 .6462387 1 4 hourslw | 165211 39.16288 14.26625 1 126 reason94 | 14278 5.582785 3.12791 1 13 absent94 | 8198 6.129178 3.387722 4 14 ind80 | 192442 580.1935 276.8235 10 991 occ80 | 192442 366.6342 248.9975 4 905 uhourse | 158435 39.1856 11.88232 0 99 paidhre | 152190 1.382436 .4859839 1 2 unionmme | 152190 1.854984 .3521182 1 2 ethnic | 277856 7.66375 1.312874 1 10 lfsr94 | 276610 2.779516 2.343772 1 7 ftpt94 | 276610 2.737265 2.50568 1 12 dind94 | 192442 31.55454 13.64951 1 52 docc80 | 192442 22.55873 12.71378 1 46 eligible | 277856 1.452274 .4977179 1 2 earnhre | 93925 1006.895 588.2619 10 9975 earnwke | 152190 508.9036 371.295 0 1923 weight | 277856 2165.769 1046.214 0 12347.75 earnwt | 277856 8697.715 4174.887 246.4069 49442.13 I25a | 277856 .1833108 2.523838 0 43 I25b | 277856 2.322491 9.589426 0 42 penatvty | 277856 79.63104 72.25778 57 555 pemntvty | 277856 87.7158 80.41492 57 555 pefntvty | 277856 88.02839 80.40359 57 555 prcitshp | 277856 1.385102 1.109077 1 5 prcitflg | 277856 .1667842 2.1367 0 41 peinusyr | 277856 .8424112 2.705196 0 14 pemlr | 276610 2.779516 2.343772 1 7 year | 277856 96 0 96 96 smsa80 | 277856 24.3245 10.11942 11 43 grade92 | 277856 39.52208 2.855723 31 46 . end of do-file . exit