------------------------------------------------------------------------------- log: /disk/nber10/SCCS/morg/sources/annual2003.log log type: text opened on: 10 Feb 2005, 10:08:49 . set memory 2000m (2048000k) . set more 1 . *primary family and child variables added 2000-04-20 by Jean Roth, jroth@nber > .org . *Y2K compliance by Jean Roth, jroth@nber.org, 2001-01-15 . *Imputed highest grade completed, ihigrdc, added by Jean Roth, jroth@nber.org > , 2003-01-20 . *Stata 8 compliance by Jean Roth, jroth@nber.org, 2003-02-28 . *matching variables added by Jean Roth, jroth@nber.org, 2003-02-12 . *rm /tmp/aef.raw aef.dct . *rm aef.dct . *rm dcthead . ! rm -f /tmp/aef.raw aef.dct dcthead . *! /bin/rm -f /tmp/aef.raw aef.dct dcthead . * run with stata6 -p0 do annual2002 to get Stata 5 format . * run with nohup stata -b do annual2002 & to run in batch mode . ! echo >dcthead dictionary using /tmp/aef.raw . program define aef2 1. * '-A' are missing value indicators in the earlier files. . if `1' <= 1993 { 2. !zcat /home/data/morg/raw/morg`2'.Z |tr "\-A" " " >/tmp/aef.raw 3. } 4. if `1' >= 1994 { 5. !zcat /home/data/morg/raw/morg`2'.Z >/tmp/aef.raw 6. } 7. ! cat /home/data/morg/sources/dcthead /home/data/morg/sources/aef`3'.dbd > > ./aef.dct 8. quietly infile using aef if age>15&age!=. 9. #delimit cr delimiter now cr . generate int year = `1' 10. quietly describe 11. display "obs " r(N) 12. ** Revised Census 2000-based Weights. Impact employment and union variabl > es . if inlist( `1', 2000 , 2001 , 2002 ) { 13. gen id = _n 14. local rwlist qstnum intmonth year occurnum 15. sort `rwlist' 16. quietly describe 17. display "total obs pre-revise `1' " r(N) 18. saveold /homes/data/morg/annual/rw/annual, replace 19. clear 20. rw `2' jan 1 21. rw `2' feb 2 22. rw `2' mar 3 23. rw `2' apr 4 24. rw `2' may 5 25. rw `2' jun 6 26. rw `2' jul 7 27. rw `2' aug 8 28. rw `2' sep 9 29. rw `2' oct 10 30. rw `2' nov 11 31. rw `2' dec 12 32. local monlist feb mar apr may jun jul aug sep oct nov dec 33. clear 34. display "using jan" 35. use /homes/data/morg/annual/rw/jan 36. foreach mon in `monlist' { 37. append using /home/data/morg/annual/rw/`mon' 38. } 39. quietly describe 40. display "total obs post-revise" r(N) 41. display "start renaming" 42. rename neio1icd ind02 43. rename ntio1ocd occ00 44. replace occ00 = . if occ00 < 0 45. rename class94 class94p 46. replace class94p = . if class94p<0 47. . rename neio1cow class94 48. rename earnwt earnwtp 49. rename nworwgt earnwt 50. rename weight weightp 51. rename nwsswgt weight 52. display "done renaming" 53. display "drop 2000" 54. if `1' == 2000 { 55. drop neerncov neernlab 56. } 57. display "rename 2001-2002" 58. if inlist( `1' , 2001 , 2002 ) { 59. rename unioncov unioncop 60. replace unioncop = . if unioncop < 0 61. rename neerncov unioncov 62. rename unionmme unionmep 63. replace unionmep = . if unionmep < 0 64. rename neernlab unionmme 65. } 66. sort id 67. drop id _merge 68. } 69. . * Miscellaneous (record keeping) variables . if `1' == 1994 { 70. replace hhid = hhid94 71. drop hhid94 72. } 73. if `1'== 1995 { 74. replace hhid = hhid94 if intmonth<9 75. drop hhid94 76. } 77. if inlist( `1', 1996 , 1997 ) { 78. drop hhid94 79. } 80. * Geography . display "Geography" 81. if ( `1' > 2004 ) | (`1'==2004 & intmonth >= 5 ) { 82. replace serial = serial04 83. replace hhnum = hhnum04 84. drop serial04 hhnum04 cmsacode msafips smsa93 85. replace smsa04 = . if smsa04<2 86. } 87. if `1' == 2003 | ( `1'==2004 & intmonth<=4 ) { 88. drop cbsafips smsa04 serial04 hhnum04 89. } 90. if `1' >= 1996 & `1' <= 2003 | ( `1'==2004 & intmonth<=4 ) { 91. replace smsa93 = . if smsa93<2 92. } 93. display "smsasize = . if smsasize <=0" 94. capture replace smsasize = . if smsasize <=0 95. if `1' == 1995 { 96. replace smsastat = smsa995 if intmonth>8 97. replace icntcity = icntct94 if intmonth<9 98. replace centcity = centcitx if intmonth<9 99. replace smsa93 = . if intmonth>=9 & smsa93<2 100. replace smsa93 = . if intmonth<9 101. drop pmsarank 102. generate smsa80 = smsasize if intmonth < 10 103. drop county if intmonth<9 104. } 105. display "inlisting 96 97" 106. if inlist( `1', 1996 , 1997 ) { 107. replace smsastat = smsa995 108. } 109. display "replace smsastat = . if smsastat==3 | smsastat<0" 110. replace smsastat = . if smsastat==3 | smsastat<0 111. if `1' == 1994 { 112. drop smsa93 113. replace centcity = centcitx 114. replace icntcity = icntct94 115. replace pmsarank = . if intmonth > 3 116. replace pmsarank = . if pmsarank <= 0 117. replace cmsarank = . if intmonth > 3 118. } 119. if inlist( `1', 1996 , 1997 ) { 120. drop pmsarank 121. } 122. if `1' >= 1994 & `1' <= 1997 { 123. drop centcitx icntct94 smsa995 124. } 125. if `1' >= 1994 { 126. replace hurespli =. if hurespli <0 127. replace peinusyr = . if peinusyr < 0 128. } 129. display "replace centcity = . if centcity==4 | centcity<=0" 130. replace centcity = . if centcity==4 | centcity<=0 131. if `1' >= 1986 & `1' < 1994 { 132. replace pmsarank = . if pmsarank<=0 133. } 134. if `1' >= 1995 & `1' <= 1997 { 135. drop cmsarank 136. } 137. if `1' >= 1986 { 138. replace icntcity = . if icntcity<=0 139. } 140. if `1' > 1984 & `1' < 1995 { 141. replace cmsarank = . if cmsarank<=0 142. } 143. if `1' >= 1989 { 144. replace msafips = . if msafips <=0 145. replace cmsacode = . if cmsacode<=0 146. } 147. if `1' == 1983 { 148. drop docc70 occ70 149. } 150. if `1' == 1985 { 151. replace smsarank = . if intmonth > 9 152. } 153. if `1' == 1984 { 154. display "drop icntcity pmsarank cmsarank" 155. drop icntcity pmsarank cmsarank 156. } 157. if `1' == 1985 & intmonth < 10 { 158. drop icntcity pmsarank cmsarank 159. } 160. if `1' == 1994 { 161. replace cmsarank = . if intmonth>3 162. } 163. display "replace smsasize=. if smsasize<=0" 164. **should line below be commented out??? . capture replace smsasize=. if smsasize<=0 165. if `1' < 1985 { 166. display "generate byte smsa70 = smsasize" 167. generate byte smsa70 = smsasize 168. } 169. if `1' > 1985 & `1' < 1995 { 170. generate byte smsa80 = smsasize 171. } 172. if `1' == 1985 { 173. generate byte smsa70 = smsasize if intmonth<10 174. } 175. if `1' == 1985 { 176. generate byte smsa80 = smsasize if intmonth>9 177. } 178. display "drop smsasize" 179. capture drop smsasize 180. if `1' > 1985 & `1' < 1989 { 181. drop smsarank 182. } 183. if `1' < 1983 { 184. display "drop unioncov unionmme occ80 ind80" 185. drop unioncov unionmme occ80 ind80 186. } 187. . * Demography . display "Demography" 188. if `1' > 1983 & `1' < 1994 { 189. replace ownchild = . if ownchild ==0 190. replace ownchild = ownchild - 1 191. generate int ch613=chldpres 192. generate int ch1417=chldpres 193. } 194. display "if `1' > 1983 & `1' < 1989 {" 195. if `1' > 1983 & `1' < 1989 { 196. generate int ch05= chldpres 197. recode ch05 (4 6/8 = 1) (0/3 5 = 0) 198. recode ch613 (3 5 7/8 = 1) (0/2 4 6 = 0) 199. recode ch1417 (2 5/6 8 =1) (0/1 3/4 7 = 0) 200. } 201. if `1' > 1988 & `1' < 1994 { 202. display "if `1' > 1988 & `1' < 1994 {" 203. generate int ch02 = chldpres 204. generate int ch35 = chldpres 205. recode ch02 (2 6/8 12/14 16 = 1) (0/1 3/5 9/11 15 = 0) 206. recode ch35 (3 6 9/10 12/13 15/16 = 1) (0/2 4/5 7/8 11 14 = 0) 207. recode ch613 (4 7 9 11/12 14/16 = 1) (0/3 5/6 8 10 13 = 0) 208. recode ch1417 (5 8 10/11 13/16 = 1) (0/4 6/7 9 12 = 0 ) 209. generate int ch05 = ch02 210. replace ch05 = ch35 if ch35 == 1 211. label variable ch02 "Children 0-2" 212. label variable ch35 "Children 3-5" 213. } 214. if `1' > 1983 & `1' < 1994 { 215. display "if `1' > 1983 & `1' < 1994 {" 216. label variable ch05 "Children 0-5" 217. label variable ch613 "Children 6-13" 218. label variable ch1417 "Children 6-17" 219. } 220. if `1' == 1998 { 221. drop ownchild chldpres 222. } 223. if `1' >= 1999 { 224. replace ownchild = . if ownchild < 0 225. replace chldpres = . if chldpres < 0 226. generate int ch02 = chldpres 227. generate int ch35 = chldpres 228. generate int ch613 = chldpres 229. generate int ch1417 = chldpres 230. recode ch02 (1 5/7 11/13 15 = 1) (0 2/4 8/10 14 = 0) 231. recode ch35 (2 5 8/9 11/12 14/15 = 1) (0/1 3/4 6/7 10 13 =0) 232. recode ch613 (3 6 8 10/11 13/15 = 1) (0/2 4/5 7 9 12 = 0) 233. recode ch1417 (4 7 9/10 12/15 = 1) (0/3 5/6 8 11 = 0) 234. generate int ch05 = ch02 235. replace ch05 = ch35 if ch35 == 1 236. } 237. . if `1' == 1999 { 238. replace ownchild = . if intmonth < 10 239. replace chldpres = . if intmonth < 10 240. replace ch613 = . if intmonth < 10 241. replace ch1417 = . if intmonth < 10 242. replace ch05 = . if intmonth < 10 243. replace ch02 = . if intmonth < 10 244. replace ch35 = . if intmonth < 10 245. } 246. if `1' > 1988 & `1' < 1992 { 247. drop grade92 248. } 249. if `1' < 1989 { 250. replace gradeat = gradeat - 1 251. replace marital = 7 if marital==5 252. } 253. if `1' > 1991 { 254. replace grade92 = . if grade92 < 0 255. } 256. if `1' >= 1998 { 257. replace ged = . if ged < 0 258. replace gedhigr = . if gedhigr < 0 259. replace yrcoll = . if yrcoll < 0 260. replace grprof = . if grprof < 0 261. replace gr6cor = . if gr6cor < 0 262. replace ms123 = . if ms123 < 0 263. generate double ihigrdc = . 264. label var ihigrdc "Imputed highest grade completed" 265. replace ihigrdc = 0 if grade92==31 266. replace ihigrdc = 2.5 if grade92==32 267. replace ihigrdc = 5.5 if grade92==33 268. replace ihigrdc = 7.5 if grade92==34 269. replace ihigrdc = 9 if grade92==35 270. replace ihigrdc =10 if grade92==36 271. replace ihigrdc =11 if grade92==37 272. replace ihigrdc =12 if grade92==38 273. replace ihigrdc = 0 if grade92==39 & ged==2 & gedhigr==1 274. replace ihigrdc = 2.5 if grade92==39 & ged==2 & gedhigr==2 275. replace ihigrdc = 5.5 if grade92==39 & ged==2 & gedhigr==3 276. replace ihigrdc = 7.5 if grade92==39 & ged==2 & gedhigr==4 277. replace ihigrdc = 9 if grade92==39 & ged==2 & gedhigr==5 278. replace ihigrdc = 10 if grade92==39 & ged==2 & gedhigr==6 279. replace ihigrdc = 11 if grade92==39 & ged==2 & gedhigr==7 280. replace ihigrdc = 12 if grade92==39 & ged==2 & gedhigr==8 281. replace ihigrdc = 12 if ged==1 282. replace ihigrdc = 12 if grade92>=40 & grade92<=42 & yrcoll==1 283. replace ihigrdc = 13 if grade92>=40 & grade92<=42 & yrcoll==2 284. replace ihigrdc = 14 if grade92>=40 & grade92<=42 & yrcoll==3 285. replace ihigrdc = 15 if grade92>=40 & grade92<=42 & yrcoll==4 286. replace ihigrdc = 16 if grade92>=40 & grade92<=42 & yrcoll==5 287. replace ihigrdc = 16 if grade92==43 & grprof==2 288. replace ihigrdc = 17 if grade92==43 & gr6cor==2 289. replace ihigrdc = 18 if grade92==43 & gr6cor==1 290. replace ihigrdc = 17 if grade92==44 & ms123==1 291. replace ihigrdc = 18 if grade92==44 & ms123>=2 & ms123<. 292. replace ihigrdc = 18 if grade92==45 | grade92==46 293. } 294. if inlist( `1', 1992 , 1993 ) { 295. drop gradecp gradeat 296. } 297. if `1' == 1995 { 298. replace relref94 = . if intmonth > 2 299. replace relref95 = . if intmonth < 3 300. } 301. if inlist( `1', 1996 , 1997 ) { 302. drop relref94 303. } 304. if `1' == 1994 { 305. drop relref95 306. } 307. if `1' >= 1994 { 308. replace veteran = . if veteran < 0 309. replace penatvty = . if penatvty < 0 310. replace pemntvty = . if pemntvty < 0 311. replace pefntvty = . if pefntvty < 0 312. replace prcitshp = . if prcitshp < 0 313. replace prcitflg = . if prcitflg < 0 314. } 315. if `1' > 1989 { 316. replace ethnic = . if ethnic < 0 317. replace ethnic = . if ethnic >= 10 318. } 319. . * Employment . display "Employment" 320. if `1' >= 1994 & `1' <= 2002 { 321. replace occ80 = . if occ80 <0 322. replace ind80 = . if ind80 < 10 323. replace class94 = . if class94<0 324. } 325. if `1' >= 2000 { 326. replace occ00 = . if occ00 <0 327. replace ind02 = . if ind02 < 10 328. replace class94 = . if class94<0 329. } 330. #delimit ; delimiter now ; . ; . display "docc80" ; 331. if `1' >= 1983 & `1' <= 2002 { > display "generate int docc80=occ80;"; 332. generate int docc80=occ80; 333. display "recode docc80"; 334. recode docc80 (1/6=1) (7/22=2) (23/37=3) (44/59=4) (64/68=5) (69/83=6 > ) (84/89=7) > (95/106=8) (113/154=9) (155/159=10) (178/179=11) (43 63 163/177 183/199=1 > 2) > (203/208=13) (213/225=14) (226/235=15) (243=16) (253/257=17) (258/259=18) > (263/278=19) (283/285=20) (303/307=21) (308/309=22) (313/315=23) (337/344 > =24) > (354/357=25) (316/336 345/353 359/389=26) (403/407=27) (413/427=28) > (433/444=29) (445/447=30) (448/455=31) (456/469=32) (503/549=33) (553/599 > =34) > (613/699=35) (703/779=36) (783/799=37) (803/814=38) (823/859=39) (869=40) > (875/883=41) (863/868 873 874 885/889=42) (473/476=43) (477/489=44) (494/ > 499=45) > (905=46); 335. } ; 336. display "** The renaming is part of the Census reweighting ; " ; 337. if inlist( `1', 2000 , 2001 , 2002 ) { > *display "renaming docc80 docc80p " ; 338. *rename docc80 docc80p ; . } ; 339. display "docc00" ; 340. if `1' >= 2000 { > display "generate int docc00=occ00;"; 341. generate int docc00=occ00; 342. display "recode docc00"; 343. recode docc00 (10/430=1) (500/950=2) (1000/1240=3) (1300/1560=4) (160 > 0/1960=5) > (2000/2060=6) (2100/2150=7) (2200/2550=8) (2600/2960=9) (3000/3540=10) (3 > 600/3650=11) > (3700/3950=12) (4000/4160=13) (4200/4250=14) (4300/4650=15) (4700/4960=16 > ) > (5000/5930=17) (6000/6130=18) (6200/6940=19) (7000/7620=20) (7700/8960=21 > ) > (9000/9750=22) (9840=23); 344. } ; 345. display "dind"; 346. if `1'<= 1982 { > display "`1' <= 1982: creating dind from ind70"; 347. gen dind=ind70 ; 348. recode dind (18/19=1) (17=2) (47/57=3) (67/77=4) (107/109=5) (118=6) ( > 119/138=7) > (139/149=8) (157/168 258=9) (169=10) (177/198=11) (199/209=12) (219 =13) > (227=14) (228/238=15) (239/257=16) (259=18) (268/298=19) (299=20) > (307/318=21) (319/327=22) (328/337=23) (338/339=24) (347/369=25) > (377/378=26) (379/387=27) (388/398=28) (407/429=29) (447/449=30) (467/479 > =31) > (507/588=32) (607/698=33) (707/709=34) (717/718=35) > (769=36) (727/748=37) (749/759=38) (777/798=39) (807/809=40) (838=41) > (828/837 839/848=42) (877/879=44) (857/868=43) (849 869 887/897= 45) > (027 028 = 46) (907/937=52) ; 349. } ; 350. if `1' <=1991 & `1' >=1983 { > display "replacing dind for `1': `1' <=1991 & `1' >=1983"; 351. gen dind=ind80; 352. recode > dind (12/29=1) (10/11=2) (40/50=3) (60=4) (230/241=5) (242=6) (250/262=7) > (270/280=8) (281/300=9) (301=10) (310/332=11) (340/350=12) > (351=13) (352=14) (360/370=15) (371/382=16) (390=17) (391/392=18) > (100/122=19) (130=20) (132/150=21) (151/152=22) (160/162=23) (171/172=24) > (180/192=25) (200/201=26) (210/212=27) (220/222=28) > (400/432=29) (440/442=30) (450/472=31) (500/571=32) (580/691=33) (700/710 > =34) > (711/712=35) (761=36) (721/750=37) (751/760=38) (762/791=39) (800/810=40) > (831=41) (812/830 832/840=42) (842/860=43) (861/871=44) (841 872/893=45) > (30/32=46) (900/932=52) (991=51); 353. } ; 354. if `1' >= 1992 & `1' <= 2002 { > display "replacing dind for `1': `1' >= 1992 & `1' <= 2002 "; 355. gen dind=ind80; 356. recode > dind (12/30=1) (10/11=2) (40/50=3) (60=4) (230/241=5) (242=6) (250/262=7) > (270/280=8) (281/300=9) (301=10) (310/332=11) (340/350=12) > (351=13) (352=14) (360/370=15) (371/382=16) (390=17) (391/392=18) > (100/122=19) (130=20) (132/150=21) (151/152=22) (160/162=23) (171/172=24) > (180/192=25) (200/201=26) (210/212=27) (220/222=28) > (400/432=29) (440/442=30) (450/472=31) (500/571=32) (580/691=33) > (700/710=34) (711/712=35) (761=36) (721/750=37) (751/760=38) (762/791=39) > (800/810=40) (831=41) (812/830 832/840=42) (842/860=43) > (861/871=44) (841 872/893 =45) > (032 031 =46) > (910 922 932 900 901 921 930 931 =52) > (991=51) ; 357. }; 358. if `1' >= 2000 { > display "replacing dind for `1' >= 2000 " ; 359. gen dind02 = ind02; 360. recode > dind02 (170/180 290=1) (190/280=2) (370/490=3) (770=4) (2470/2590=5) > (2670/2990=6) (3070/3290=7) (3360/3390=8) (3470 3490=9) (3570/3690=10) > (3770/3870=11) (3890=12) (3960/3990=13) (1070/1290=14) (1370 1390=15) > (1470/1790=16) (1870/1990=17) (2070 2090=18) (2170/2290=19) (2370/2390=20 > ) > (4070/4590=21) (4670/5790=22) (6070/6390=23) (570/690=24) (6470/6490=25) > (6570 6590=26) (6670=27) (6675=28) (6680 6690=29) (6692 6695=30) > (6770 6780=31) (6870/6970=32) (6990=33) (7070=34) (7080/7190=35) > (7270/7490=36) (7570=37) (7580/7780=38) (7790=39) (7860/7890=40) > (8190=41) (7970/8180 8270 8290=42) (8370/8470=43) (8560/8590=44) (8660 86 > 70=45) > (8680 8690=46) (8770/8890=47) (8970/9090=48) (9160/9190=49) (9290=50) > (9370/9590=51) (9890=52) ; 361. } ; 362. #delimit cr delimiter now cr . **Wages (If earnings are 0, then wage rate is missing, not zero). . display "Wages" 363. replace paidhr = . if paidhr <=0 364. replace paidhre = . if paidhre <=0 365. replace earnhr = . if earnhr <=0 366. replace earnhre = . if earnhre <=0 367. replace earnwke = . if earnwke < 0 368. if `1' < 1989 { 369. replace eligible = 2 if eligible == . 370. } 371. if `1' >= 1989 { 372. replace eligible = 2 if eligible <= 0 373. } 374. if `1' < 1989 { 375. replace I25a = 0 if I25a ==. 376. replace I25b = 0 if I25b ==. 377. replace I25c = 0 if I25c ==. 378. replace I25d = 0 if I25d ==. 379. } 380. if `1' >= 1994 { 381. replace I25a = 0 if I25a <= 3 382. replace I25b = 0 if I25b <= 3 383. *replace I25a = . if I25a < 0 . *replace I25b = . if I25b < 0 . replace earnhre = . if earnhre ==1 384. replace uhourse = . if lfsr94 >2 | lfsr94 <1 385. replace lfsr94 = . if lfsr94 < 0 386. } 387. if `1' >= 1996 { 388. replace I25c = . if I25c < 0 389. replace I25d = . if I25d < 0 390. } 391. if `1' == 1995 { 392. replace I25c = . if I25c < 0 393. replace I25d = . if I25d < 0 394. replace I25c = . if intmonth < 9 395. replace I25d = . if intmonth < 9 396. } 397. if `1' == 1994 { 398. drop I25c I25d 399. } 400. ** Hours, Unions . display "Hours, Unions" 401. if `1' >= 1994 { 402. replace reason94 = . if reason94< 0 403. replace absent94 = . if absent94< 0 404. replace studftpt = . if studftpt< 0 405. replace schenr = . if schenr < 0 406. replace schlvl = . if schlvl < 0 407. replace ftpt94 = . if ftpt94 < 0 408. replace hourslw = . if hourslw < 0 409. replace hourslw = 99 if hourslw >99 & hourslw != . 410. replace uhourse = . if uhourse < 0 411. replace why3594 = . if why3594 < 0 412. replace unionmme = . if unionmme< 0 413. replace unioncov = . if unioncov< 0 414. } 415. . ** Save and exit . compress 416. saveold /home/data/morg/annual/morg`2',replace 417. summarize 418. clear 419. *! /usr/bin/rm -f aef.dct /tmp/aef.raw | /dev/null . *! /bin/rm -f aef.dct /tmp/aef.raw . end . ! /usr/bin/chmod a+r /home/data/morg/annual/m*.dta | /dev/null . ! /bin/chmod a+r /home/data/morg/annual/m*.dta . ! /usr/bin/chmod g+w /home/data/morg/annual/m*.dta | /dev/null . ! /bin/chmod g+w /home/data/morg/annual/m*.dta . ! /usr/bin/chgrp web /home/data/morg/annual/m*.dta | /dev/null . ! /bin/chgrp web /home/data/morg/annual/m*.dta . . program rw 1. * grab the annual file . * keep data from the relevant month . * sort by revised weight merge variables . * merge using the revised weight monthly file, 'rwmonyy.dta' . * save the merged file as 'mon' . use /homes/data/morg/annual/rw/annual 2. keep if intmonth==`3' 3. quietly describe 4. display "`3' `2' obs " r(N) 5. local rwlist qstnum intmonth year occurnum 6. sort `rwlist' 7. merge `rwlist' using /homes/data/morg/annual/rw/rw`2'`1' 8. drop if _merge == 2 9. save /homes/data/morg/annual/rw/`2', replace 10. 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 1979 79 79_83 . *aef2 1980 80 79_83 . *aef2 1981 81 79_83 . *aef2 1982 82 79_83 . *aef2 1983 83 79_83 . aef2 1984 84 84_88 obs 343665 Geography smsasize = . if smsasize <=0 inlisting 96 97 replace smsastat = . if smsastat==3 | smsastat<0 (52042 real changes made, 52042 to missing) replace centcity = . if centcity==4 | centcity<=0 (60378 real changes made, 60378 to missing) drop icntcity pmsarank cmsarank replace smsasize=. if smsasize<=0 generate byte smsa70 = smsasize (260231 missing values generated) drop smsasize Demography (57586 real changes made, 57586 to missing) (286079 real changes made) if 1984 > 1983 & 1984 < 1989 { (ch05: 286079 changes made) (ch613: 286079 changes made) (ch1417: 286079 changes made) if 1984 > 1983 & 1984 < 1994 { (343665 real changes made) (81303 real changes made) Employment docc80 (84867 missing values generated) recode docc80 (docc80: 258798 changes made) ** The renaming is part of the Census reweighting ; docc00 dind (84867 missing values generated) (dind: 258798 changes made) Wages (0 real changes made) (0 real changes made) (139 real changes made, 139 to missing) (0 real changes made) (0 real changes made) (166417 real changes made) (340647 real changes made) (340000 real changes made) (330739 real changes made) (317565 real changes made) Hours, Unions ch613 was int now byte ch1417 was int now byte ch05 was int now byte docc80 was int now byte dind was float now byte file /home/data/morg/annual/morg84.dta saved Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- minsamp | 343665 6.018733 1.999915 4 8 hhid | 0 state | 343665 52.94592 26.21478 11 95 smsarank | 343665 5.208657 10.52625 0 57 schenr | 67249 1.60679 .4884665 1 2 -------------+-------------------------------------------------------- schlvl | 26443 1.494119 .4999749 1 2 hhnum | 343665 1.091967 .3292597 1 8 activlwr | 343665 2.899946 2.248446 1 7 hourslw | 194147 38.67536 13.99387 1 99 reasonlw | 50027 10.10916 3.922843 1 15 -------------+-------------------------------------------------------- absentlw | 14140 3.595827 2.646903 1 8 classer | 260853 1.385236 .7467635 1 5 lineno | 343665 1.798656 1.080923 0 36 relahh | 343665 2.425787 1.294567 1 6 age | 343665 42.42364 18.52201 16 99 -------------+-------------------------------------------------------- marital | 343665 2.907369 2.505176 1 7 race | 343665 1.160287 .4479898 1 3 sex | 343665 1.530744 .4990547 1 2 veteran | 161889 4.880949 1.773514 1 6 gradeat | 343665 12.30682 3.033712 0 18 -------------+-------------------------------------------------------- gradecp | 343665 1.222187 .415717 1 2 esr | 343665 2.626823 2.128543 1 7 studftpt | 26443 1.113754 .3175184 1 2 intmonth | 343665 6.497298 3.455863 1 12 weight | 343665 1539.723 779.9211 23.15 16655.71 -------------+-------------------------------------------------------- smsastat | 291623 1.335951 .4723226 1 2 centcity | 283287 2.066438 .7879235 1 3 ethnic | 342905 7.777338 1.142623 1 9 ptstat | 343665 .6296713 1.793381 0 6 ftpt79 | 343665 1.044878 1.203676 0 5 -------------+-------------------------------------------------------- doinglw | 343148 2.967763 2.386222 1 8 hourslwa | 193609 38.64001 14.03294 0 99 uhours35 | 49363 1.709256 .4541103 1 2 why35lw | 49476 10.10983 3.922558 1 15 class | 259518 2.014161 1.814957 1 8 -------------+-------------------------------------------------------- uhours | 175777 37.76727 11.07017 0 99 paidhr | 174954 1.413577 .4924759 1 2 earnhr | 90719 674.1399 378.9471 1 9999 uearnwk | 151915 318.304 215.6998 0 999 earnwt | 343665 6161.268 3132.74 93.28 68606.39 -------------+-------------------------------------------------------- eligible | 343665 1.484242 .4997523 1 2 uhourse | 177248 37.80939 10.96385 0 99 paidhre | 177248 1.409979 .4918309 1 2 earnhre | 104580 682.9258 377.0261 50 9999 earnwke | 177248 322.4493 215.8607 0 999 -------------+-------------------------------------------------------- unionmme | 177248 1.814266 .3888931 1 2 I25a | 343665 .0087818 .0932991 0 1 I25b | 343665 .0106645 .1027169 0 1 I25c | 343665 .0376122 .1902568 0 1 I25d | 343665 .0759461 .2649122 0 1 -------------+-------------------------------------------------------- uearnwke | 104580 257.0817 167.2497 0 999 unionmm | 174659 1.814433 .3887582 1 2 unioncov | 143212 1.953803 .2099128 1 2 ind80 | 258798 548.2273 284.3926 10 991 occ80 | 258798 400.6177 245.0892 3 905 -------------+-------------------------------------------------------- famnum | 343665 .8561041 .4080798 0 5 ownchild | 286079 .9393944 1.17641 0 8 chldpres | 343665 2.086194 2.019784 0 8 pfamrel | 343665 1.796348 1.344383 0 5 year | 343665 1984 0 1984 1984 -------------+-------------------------------------------------------- smsa70 | 83434 1.614941 .4866121 1 2 ch613 | 343665 .2191262 .4136549 0 1 ch1417 | 343665 .1887769 .3913318 0 1 ch05 | 343665 .1606652 .3672224 0 1 docc80 | 258798 24.53068 12.20869 1 46 -------------+-------------------------------------------------------- dind | 258798 29.65944 13.94557 1 52 . *aef2 1985 85 84_88 . *aef2 1986 86 84_88 . *aef2 1987 87 84_88 . *aef2 1988 88 84_88 . *aef2 1989 89 89_93 . *aef2 1990 90 89_93 . *aef2 1991 91 89_93 . *aef2 1992 92 89_93 . *aef2 1993 93 89_93 . *aef2 1994 94 94_97 . *aef2 1995 95 94_97 . *aef2 1996 96 94_97 . *aef2 1997 97 94_97 . *aef2 1998 98 98_02 . *aef2 1999 99 98_02 . *aef2 2000 00 98_02 . *aef2 2001 01 98_02 . *aef2 2002 02 98_02 . *aef2 2003 03 03 . *aef2 2004 04 03 . . end of do-file . exit