------------------------------------------------------------------------------- log: /disk/nber10/SCCS/morg/sources/match2002.log log type: text opened on: 6 Oct 2004, 13:47:22 . *by Jean Roth, 2003-01-30, jroth@nber.org . set mem 750m (768000k) . set more 1 . ! rm -f /tmp/match.raw match.dct matchhead . ! echo >matchhead dictionary using /tmp/match.raw . program define match2 1. if `1' < 1994 { 2. !zcat /home/data/morg/raw/morg`2'.Z |tr "\-A" " " >/tmp/match.raw 3. } 4. if `1' >= 1994 { 5. !zcat /home/data/morg/raw/morg`2'.Z >/tmp/match.raw 6. } 7. *if `1' >= 1994 {!zcat /homes/nber/jroth/morg/morg`2'.Z >/tmp/match.raw} . ! cat /home/data/morg/sources/matchhead /home/data/morg/sources/match`3'.dbd > >./match.dct 8. quietly infile using match if mage>15&mage!=. 9. #delimit cr delimiter now cr . . * Miscellaneous (record keeping) variables . gen id = _n 10. if `1' == 1994 { 11. replace hhid = hhid94 12. drop hhid94 13. } 14. if `1'== 1995 { 15. replace hhid = hhid94 if intmonth<9 16. drop hhid94 17. } 18. if `1' > 1995 & `1' <= 1997 { 19. drop hhid94 20. } 21. . * Person Match . unab vlist: _all 22. sort `vlist' 23. generate int mym = `1' * 10 + mminsamp 24. label var mym "Match year and month-in-sample" 25. display "Sort vars" 26. local sortnf ="mym intmonth state hhid hhnum lineno " 27. local sortf ="mym intmonth state hhid hhnum famnum lineno " 28. local sort94 ="mym intmonth state hhid hhnum famnum lineno serial " 29. if ( `1' < 1984 ) { 30. display "sort `sortnf' id" 31. sort `sortnf' id 32. by `sortnf' : gen dup = _n 33. } 34. if ( `1' >= 1984 & `1' < 1994 ) { 35. display "sort `sortf' id" 36. sort `sortf' id 37. by `sortf' : gen dup = _n 38. } 39. if (`1' >= 1994 ) { 40. display "sort `sort94' id" 41. sort `sort94' id 42. by `sort94' : gen dup = _n 43. } 44. display "Removing duplicates to avoid creating extra observations" 45. display "WARNING: If merge variable duplicates aren't eliminated from the > master database too, then extra observations will be created" 46. display "re: http://www.stata.com/support/faqs/data/merge.html" 47. tab dup 48. drop if dup>1 49. drop dup 50. saveold /home/data/morg/match/match`1'4.dta, replace 51. drop if mminsamp==4 52. drop mminsamp 53. if ( `1' == 1984 ) { 54. sort `sortnf' 55. } 56. if ( `1' == 1994 ) { 57. sort `sortf' 58. } 59. saveold /home/data/morg/match/match`1'8.dta,replace 60. clear 61. use /home/data/morg/match/match`1'4.dta 62. drop if mminsamp==8 63. drop mminsamp 64. saveold /home/data/morg/match/match`1'4.dta,replace 65. clear 66. ! rm -f match.dct /tmp/match.raw 67. 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. . . match2 1979 79 79_83 Sort vars sort mym intmonth state hhid hhnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 327,550 99.74 99.74 2 | 851 0.26 100.00 3 | 5 0.00 100.00 ------------+----------------------------------- Total | 328,406 100.00 (856 observations deleted) (note: file /home/data/morg/match/match19794.dta not found) file /home/data/morg/match/match19794.dta saved (164199 observations deleted) (note: file /home/data/morg/match/match19798.dta not found) file /home/data/morg/match/match19798.dta saved (163351 observations deleted) file /home/data/morg/match/match19794.dta saved . match2 1980 80 79_83 Sort vars sort mym intmonth state hhid hhnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 385,116 99.79 99.79 2 | 823 0.21 100.00 3 | 2 0.00 100.00 ------------+----------------------------------- Total | 385,941 100.00 (825 observations deleted) (note: file /home/data/morg/match/match19804.dta not found) file /home/data/morg/match/match19804.dta saved (193104 observations deleted) (note: file /home/data/morg/match/match19808.dta not found) file /home/data/morg/match/match19808.dta saved (192012 observations deleted) file /home/data/morg/match/match19804.dta saved . match2 1981 81 79_83 Sort vars sort mym intmonth state hhid hhnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 363,182 99.78 99.78 2 | 801 0.22 100.00 3 | 1 0.00 100.00 ------------+----------------------------------- Total | 363,984 100.00 (802 observations deleted) (note: file /home/data/morg/match/match19814.dta not found) file /home/data/morg/match/match19814.dta saved (181087 observations deleted) (note: file /home/data/morg/match/match19818.dta not found) file /home/data/morg/match/match19818.dta saved (182095 observations deleted) file /home/data/morg/match/match19814.dta saved . match2 1982 82 79_83 Sort vars sort mym intmonth state hhid hhnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 350,175 99.76 99.76 2 | 844 0.24 100.00 3 | 4 0.00 100.00 ------------+----------------------------------- Total | 351,023 100.00 (848 observations deleted) (note: file /home/data/morg/match/match19824.dta not found) file /home/data/morg/match/match19824.dta saved (174486 observations deleted) (note: file /home/data/morg/match/match19828.dta not found) file /home/data/morg/match/match19828.dta saved (175689 observations deleted) file /home/data/morg/match/match19824.dta saved . match2 1983 83 79_83 Sort vars sort mym intmonth state hhid hhnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 347,782 99.79 99.79 2 | 738 0.21 100.00 3 | 1 0.00 100.00 ------------+----------------------------------- Total | 348,521 100.00 (739 observations deleted) (note: file /home/data/morg/match/match19834.dta not found) file /home/data/morg/match/match19834.dta saved (174088 observations deleted) (note: file /home/data/morg/match/match19838.dta not found) file /home/data/morg/match/match19838.dta saved (173694 observations deleted) file /home/data/morg/match/match19834.dta saved . match2 1984 84 84_88 Sort vars sort mym intmonth state hhid hhnum famnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 343,065 99.83 99.83 2 | 598 0.17 100.00 3 | 2 0.00 100.00 ------------+----------------------------------- Total | 343,665 100.00 (600 observations deleted) (note: file /home/data/morg/match/match19844.dta not found) file /home/data/morg/match/match19844.dta saved (169921 observations deleted) (note: file /home/data/morg/match/match19848.dta not found) file /home/data/morg/match/match19848.dta saved (173144 observations deleted) file /home/data/morg/match/match19844.dta saved . match2 1985 85 84_88 Sort vars sort mym intmonth state hhid hhnum famnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 342,966 99.82 99.82 2 | 624 0.18 100.00 3 | 1 0.00 100.00 ------------+----------------------------------- Total | 343,591 100.00 (625 observations deleted) (note: file /home/data/morg/match/match19854.dta not found) file /home/data/morg/match/match19854.dta saved (170873 observations deleted) (note: file /home/data/morg/match/match19858.dta not found) file /home/data/morg/match/match19858.dta saved (172093 observations deleted) file /home/data/morg/match/match19854.dta saved . match2 1986 86 84_88 Sort vars sort mym intmonth state hhid hhnum famnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 337,424 99.81 99.81 2 | 626 0.19 100.00 3 | 1 0.00 100.00 ------------+----------------------------------- Total | 338,051 100.00 (627 observations deleted) (note: file /home/data/morg/match/match19864.dta not found) file /home/data/morg/match/match19864.dta saved (168888 observations deleted) (note: file /home/data/morg/match/match19868.dta not found) file /home/data/morg/match/match19868.dta saved (168536 observations deleted) file /home/data/morg/match/match19864.dta saved . match2 1987 87 84_88 Sort vars sort mym intmonth state hhid hhnum famnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 336,351 99.81 99.81 2 | 649 0.19 100.00 ------------+----------------------------------- Total | 337,000 100.00 (649 observations deleted) (note: file /home/data/morg/match/match19874.dta not found) file /home/data/morg/match/match19874.dta saved (168755 observations deleted) (note: file /home/data/morg/match/match19878.dta not found) file /home/data/morg/match/match19878.dta saved (167596 observations deleted) file /home/data/morg/match/match19874.dta saved . match2 1988 88 84_88 Sort vars sort mym intmonth state hhid hhnum famnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 320,225 99.81 99.81 2 | 596 0.19 100.00 ------------+----------------------------------- Total | 320,821 100.00 (596 observations deleted) (note: file /home/data/morg/match/match19884.dta not found) file /home/data/morg/match/match19884.dta saved (160765 observations deleted) (note: file /home/data/morg/match/match19888.dta not found) file /home/data/morg/match/match19888.dta saved (159460 observations deleted) file /home/data/morg/match/match19884.dta saved . match2 1989 89 89_93 Sort vars sort mym intmonth state hhid hhnum famnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 324,711 100.00 100.00 ------------+----------------------------------- Total | 324,711 100.00 (0 observations deleted) (note: file /home/data/morg/match/match19894.dta not found) file /home/data/morg/match/match19894.dta saved (164056 observations deleted) (note: file /home/data/morg/match/match19898.dta not found) file /home/data/morg/match/match19898.dta saved (160655 observations deleted) file /home/data/morg/match/match19894.dta saved . match2 1990 90 89_93 Sort vars sort mym intmonth state hhid hhnum famnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 341,162 100.00 100.00 ------------+----------------------------------- Total | 341,162 100.00 (0 observations deleted) (note: file /home/data/morg/match/match19904.dta not found) file /home/data/morg/match/match19904.dta saved (170206 observations deleted) (note: file /home/data/morg/match/match19908.dta not found) file /home/data/morg/match/match19908.dta saved (170956 observations deleted) file /home/data/morg/match/match19904.dta saved . match2 1991 91 89_93 Sort vars sort mym intmonth state hhid hhnum famnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 337,649 100.00 100.00 ------------+----------------------------------- Total | 337,649 100.00 (0 observations deleted) (note: file /home/data/morg/match/match19914.dta not found) file /home/data/morg/match/match19914.dta saved (167000 observations deleted) (note: file /home/data/morg/match/match19918.dta not found) file /home/data/morg/match/match19918.dta saved (170649 observations deleted) file /home/data/morg/match/match19914.dta saved . match2 1992 92 89_93 Sort vars sort mym intmonth state hhid hhnum famnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 332,184 100.00 100.00 ------------+----------------------------------- Total | 332,184 100.00 (0 observations deleted) (note: file /home/data/morg/match/match19924.dta not found) file /home/data/morg/match/match19924.dta saved (164942 observations deleted) (note: file /home/data/morg/match/match19928.dta not found) file /home/data/morg/match/match19928.dta saved (167242 observations deleted) file /home/data/morg/match/match19924.dta saved . match2 1993 93 89_93 Sort vars sort mym intmonth state hhid hhnum famnum lineno id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 328,085 100.00 100.00 ------------+----------------------------------- Total | 328,085 100.00 (0 observations deleted) (note: file /home/data/morg/match/match19934.dta not found) file /home/data/morg/match/match19934.dta saved (163478 observations deleted) (note: file /home/data/morg/match/match19938.dta not found) file /home/data/morg/match/match19938.dta saved (164607 observations deleted) file /home/data/morg/match/match19934.dta saved . match2 1994 94 94_97 (319234 real changes made) Sort vars sort mym intmonth state hhid hhnum famnum lineno serial id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 319,133 99.97 99.97 2 | 71 0.02 99.99 3 | 16 0.01 100.00 4 | 6 0.00 100.00 5 | 3 0.00 100.00 6 | 3 0.00 100.00 7 | 1 0.00 100.00 8 | 1 0.00 100.00 ------------+----------------------------------- Total | 319,234 100.00 (101 observations deleted) (note: file /home/data/morg/match/match19944.dta not found) file /home/data/morg/match/match19944.dta saved (158108 observations deleted) (note: file /home/data/morg/match/match19948.dta not found) file /home/data/morg/match/match19948.dta saved (161025 observations deleted) file /home/data/morg/match/match19944.dta saved . match2 1995 95 94_97 (211516 real changes made) Sort vars sort mym intmonth state hhid hhnum famnum lineno serial id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 314,300 99.98 99.98 2 | 34 0.01 99.99 3 | 11 0.00 100.00 4 | 4 0.00 100.00 5 | 2 0.00 100.00 ------------+----------------------------------- Total | 314,351 100.00 (51 observations deleted) (note: file /home/data/morg/match/match19954.dta not found) file /home/data/morg/match/match19954.dta saved (158278 observations deleted) (note: file /home/data/morg/match/match19958.dta not found) file /home/data/morg/match/match19958.dta saved (156022 observations deleted) file /home/data/morg/match/match19954.dta saved . match2 1996 96 94_97 Sort vars sort mym intmonth state hhid hhnum famnum lineno serial id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 277,854 100.00 100.00 2 | 2 0.00 100.00 ------------+----------------------------------- Total | 277,856 100.00 (2 observations deleted) (note: file /home/data/morg/match/match19964.dta not found) file /home/data/morg/match/match19964.dta saved (139473 observations deleted) (note: file /home/data/morg/match/match19968.dta not found) file /home/data/morg/match/match19968.dta saved (138381 observations deleted) file /home/data/morg/match/match19964.dta saved . match2 1997 97 94_97 Sort vars sort mym intmonth state hhid hhnum famnum lineno serial id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 280,654 100.00 100.00 2 | 1 0.00 100.00 ------------+----------------------------------- Total | 280,655 100.00 (1 observation deleted) (note: file /home/data/morg/match/match19974.dta not found) file /home/data/morg/match/match19974.dta saved (140702 observations deleted) (note: file /home/data/morg/match/match19978.dta not found) file /home/data/morg/match/match19978.dta saved (139952 observations deleted) file /home/data/morg/match/match19974.dta saved . match2 1998 98 98 Sort vars sort mym intmonth state hhid hhnum famnum lineno serial id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 280,391 100.00 100.00 2 | 1 0.00 100.00 ------------+----------------------------------- Total | 280,392 100.00 (1 observation deleted) (note: file /home/data/morg/match/match19984.dta not found) file /home/data/morg/match/match19984.dta saved (141002 observations deleted) (note: file /home/data/morg/match/match19988.dta not found) file /home/data/morg/match/match19988.dta saved (139389 observations deleted) file /home/data/morg/match/match19984.dta saved . match2 1999 99 98 Sort vars sort mym intmonth state hhid hhnum famnum lineno serial id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 282,714 100.00 100.00 2 | 2 0.00 100.00 ------------+----------------------------------- Total | 282,716 100.00 (2 observations deleted) (note: file /home/data/morg/match/match19994.dta not found) file /home/data/morg/match/match19994.dta saved (142069 observations deleted) (note: file /home/data/morg/match/match19998.dta not found) file /home/data/morg/match/match19998.dta saved (140645 observations deleted) file /home/data/morg/match/match19994.dta saved . match2 2000 00 98 Sort vars sort mym intmonth state hhid hhnum famnum lineno serial id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 283,226 100.00 100.00 2 | 7 0.00 100.00 3 | 2 0.00 100.00 4 | 1 0.00 100.00 ------------+----------------------------------- Total | 283,236 100.00 (10 observations deleted) file /home/data/morg/match/match20004.dta saved (139293 observations deleted) file /home/data/morg/match/match20008.dta saved (143933 observations deleted) file /home/data/morg/match/match20004.dta saved . match2 2001 01 98 Sort vars sort mym intmonth state hhid hhnum famnum lineno serial id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 303,031 100.00 100.00 2 | 5 0.00 100.00 ------------+----------------------------------- Total | 303,036 100.00 (5 observations deleted) (note: file /home/data/morg/match/match20014.dta not found) file /home/data/morg/match/match20014.dta saved (150543 observations deleted) (note: file /home/data/morg/match/match20018.dta not found) file /home/data/morg/match/match20018.dta saved (152488 observations deleted) file /home/data/morg/match/match20014.dta saved . match2 2002 02 98 Sort vars sort mym intmonth state hhid hhnum famnum lineno serial id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 329,961 100.00 100.00 2 | 9 0.00 100.00 3 | 1 0.00 100.00 4 | 1 0.00 100.00 ------------+----------------------------------- Total | 329,972 100.00 (11 observations deleted) (note: file /home/data/morg/match/match20024.dta not found) file /home/data/morg/match/match20024.dta saved (165544 observations deleted) (note: file /home/data/morg/match/match20028.dta not found) file /home/data/morg/match/match20028.dta saved (164417 observations deleted) file /home/data/morg/match/match20024.dta saved . match2 2003 02 98 Sort vars sort mym intmonth state hhid hhnum famnum lineno serial id Removing duplicates to avoid creating extra observations WARNING: If merge variable duplicates aren't eliminated from the master databa > se too, then extra observations will be created re: http://www.stata.com/support/faqs/data/merge.html dup | Freq. Percent Cum. ------------+----------------------------------- 1 | 329,961 100.00 100.00 2 | 9 0.00 100.00 3 | 1 0.00 100.00 4 | 1 0.00 100.00 ------------+----------------------------------- Total | 329,972 100.00 (11 observations deleted) (note: file /home/data/morg/match/match20034.dta not found) file /home/data/morg/match/match20034.dta saved (165544 observations deleted) (note: file /home/data/morg/match/match20038.dta not found) file /home/data/morg/match/match20038.dta saved (164417 observations deleted) file /home/data/morg/match/match20034.dta saved . . . . . end of do-file . exit,clear