------------------------------------------------------------------------------------------------------------------------------------- log: /disk/nber10/SCCS/morg/sources/annual2005.log log type: text opened on: 1 Mar 2006, 15:31:21 . set memory 1000m (1024000k) . 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 . * run with nohup stata -b do annual2002 & to run in batch mode . do rw . . 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 . end of do-file . program define aef2 1. local dct_name "aef`3'.dbd" 2. local raw_name "../raw/morg`2'" 3. display "dct_name `dct_name'" 4. display "raw_name `raw_name'" 5. quietly infile using "`dct_name'" if age>15&age!=. , using("`raw_name'") clear 6. *quietly infile using "`dct_name'" if age>15&age!=. in 1/100 , using("`raw_name'") clear . *quietly infile using aef if age>15&age!=. . display "infile successful" 7. #delimit cr delimiter now cr . generate int year = `1' 8. *summarize . tab intmonth if `1'==2005 9. quietly describe 10. display "obs " r(N) 11. ** Revised Census 2000-based Weights. Impact employment and union variables . if inlist( `1', 2000 , 2001 , 2002 ) { 12. gen id = _n 13. local rwlist qstnum intmonth year occurnum 14. sort `rwlist' 15. quietly describe 16. display "total obs pre-revise `1' " r(N) 17. saveold /homes/data/morg/annual/rw/annual, replace 18. clear 19. rw `2' jan 1 20. rw `2' feb 2 21. rw `2' mar 3 22. rw `2' apr 4 23. rw `2' may 5 24. rw `2' jun 6 25. rw `2' jul 7 26. rw `2' aug 8 27. rw `2' sep 9 28. rw `2' oct 10 29. rw `2' nov 11 30. rw `2' dec 12 31. local monlist feb mar apr may jun jul aug sep oct nov dec 32. clear 33. display "using jan" 34. use /homes/data/morg/annual/rw/jan 35. foreach mon in `monlist' { 36. append using /home/data/morg/annual/rw/`mon' 37. } 38. quietly describe 39. display "total obs post-revise" r(N) 40. display "start renaming" 41. rename neio1icd ind02 42. rename ntio1ocd occ00 43. replace occ00 = . if occ00 < 0 44. rename class94 class94p 45. replace class94p = . if class94p<0 46. . rename neio1cow class94 47. rename earnwt earnwtp 48. rename nworwgt earnwt 49. rename weight weightp 50. rename nwsswgt weight 51. display "done renaming" 52. display "drop 2000" 53. if `1' == 2000 { 54. drop neerncov neernlab 55. } 56. display "rename 2001-2002" 57. if inlist( `1' , 2001 , 2002 ) { 58. rename unioncov unioncop 59. replace unioncop = . if unioncop < 0 60. rename neerncov unioncov 61. rename unionmme unionmep 62. replace unionmep = . if unionmep < 0 63. rename neernlab unionmme 64. } 65. sort id 66. drop id _merge 67. } 68. . * Miscellaneous (record keeping) variables . if `1' == 1994 { 69. replace hhid = hhid94 70. drop hhid94 71. } 72. if `1'== 1995 { 73. replace hhid = hhid94 if intmonth<9 74. drop hhid94 75. } 76. if inlist( `1', 1996 , 1997 ) { 77. drop hhid94 78. } 79. * Geography . display "Geography" 80. if `1'==2004 { 81. display "replace serial" 82. replace serial = serial04 if intmonth >= 5 83. replace hhnum = hhnum04 if intmonth >= 5 84. display "replace cmsacode" 85. replace cmsacode = . if intmonth >= 5 86. display "replace msafips" 87. replace msafips = . if intmonth >= 5 88. display "replace smsa93" 89. replace smsa93 = . if smsa93<2 & intmonth<=4 90. replace smsa93 = . if intmonth >= 5 91. display "replacing smsa04 in May 2004 and later" 92. replace smsa04 = . if smsa04<2 & intmonth >= 5 93. } 94. if `1' == 2005 { 95. replace serial = serial04 96. replace hhnum = hhnum04 97. display "dropping cmsacode msafips smsa93" 98. drop cmsacode msafips smsa93 99. replace smsa04 = . if smsa04<2 & intmonth >= 5 100. } 101. if `1' == 2003 { 102. display "dropping non-2003 variables" 103. drop cbsafips smsa04 serial04 hhnum04 hrhhid2 104. } 105. if `1'==2004 { 106. display "replacing pre-May 2004 variables" 107. replace cbsafips = . if intmonth <=4 108. replace smsa04 = . if intmonth <=4 109. replace hrhhid2 ="" if intmonth <=4 110. } 111. if `1' >= 2004 { 112. drop serial04 hhnum04 113. } 114. if `1' >= 1996 & `1' <= 2003 { 115. replace smsa93 = . if smsa93<2 116. } 117. display "smsasize = . if smsasize <=0" 118. capture replace smsasize = . if smsasize <=0 119. if `1' == 1995 { 120. replace smsastat = smsa995 if intmonth>8 121. replace icntcity = icntct94 if intmonth<9 122. replace centcity = centcitx if intmonth<9 123. replace smsa93 = . if intmonth>=9 & smsa93<2 124. replace smsa93 = . if intmonth<9 125. drop pmsarank 126. dis "gen smsa80" 127. generate smsa80 = smsasize 128. dis "rep smsa80" 129. replace smsa80 = . if intmonth >= 10 130. dis "replace county" 131. replace county = . if county < 0 132. dis "drop county" 133. if intmonth<9 { 134. drop county 135. } 136. } 137. display "inlisting 96 97" 138. if inlist( `1', 1996 , 1997 ) { 139. replace smsastat = smsa995 140. } 141. display "replace smsastat = . if smsastat==3 | smsastat<0" 142. replace smsastat = . if smsastat==3 | smsastat<0 143. if `1' == 1994 { 144. drop smsa93 145. replace centcity = centcitx 146. replace icntcity = icntct94 147. replace pmsarank = . if intmonth > 3 148. replace pmsarank = . if pmsarank <= 0 149. replace cmsarank = . if intmonth > 3 150. } 151. if inlist( `1', 1996 , 1997 ) { 152. drop pmsarank 153. } 154. if `1' >= 1994 & `1' <= 1997 { 155. drop centcitx icntct94 smsa995 156. } 157. if `1' >= 1994 { 158. replace hurespli =. if hurespli <0 159. replace peinusyr = . if peinusyr < 0 160. } 161. display "replace centcity = . if centcity==4 | centcity<=0" 162. replace centcity = . if centcity==4 | centcity<=0 163. if `1' >= 1986 & `1' < 1994 { 164. replace pmsarank = . if pmsarank<=0 165. } 166. if `1' >= 1995 & `1' <= 1997 { 167. drop cmsarank 168. } 169. if `1' >= 1986 { 170. replace icntcity = . if icntcity<=0 171. } 172. if `1' > 1984 & `1' < 1995 { 173. replace cmsarank = . if cmsarank<=0 174. } 175. if `1' >= 1989 & `1' <= 2004 { 176. replace msafips = . if msafips <=0 177. replace cmsacode = . if cmsacode<=0 178. } 179. if `1' == 1983 { 180. drop docc70 occ70 181. } 182. if `1' == 1985 { 183. replace smsarank = . if intmonth > 9 184. } 185. if `1' == 1984 { 186. display "drop icntcity pmsarank cmsarank" 187. drop icntcity pmsarank cmsarank 188. } 189. if `1' == 1985 & intmonth < 10 { 190. drop icntcity pmsarank cmsarank 191. } 192. if `1' == 1994 { 193. replace cmsarank = . if intmonth>3 194. } 195. display "replace smsasize=. if smsasize<=0" 196. **should line below be commented out??? . capture replace smsasize=. if smsasize<=0 197. if `1' < 1985 { 198. display "generate byte smsa70 = smsasize" 199. generate byte smsa70 = smsasize 200. } 201. if `1' > 1985 & `1' < 1995 { 202. generate byte smsa80 = smsasize 203. } 204. if `1' == 1985 { 205. generate byte smsa70 = smsasize if intmonth<10 206. } 207. if `1' == 1985 { 208. generate byte smsa80 = smsasize if intmonth>9 209. } 210. display "drop smsasize" 211. capture drop smsasize 212. if `1' > 1985 & `1' < 1989 { 213. drop smsarank 214. } 215. if `1' < 1983 { 216. display "drop unioncov unionmme occ80 ind80" 217. drop unioncov unionmme occ80 ind80 218. } 219. . * Demography . display "Demography" 220. if `1' > 1983 & `1' < 1994 { 221. replace ownchild = . if ownchild ==0 222. replace ownchild = ownchild - 1 223. generate int ch613=chldpres 224. generate int ch1417=chldpres 225. } 226. display "if `1' > 1983 & `1' < 1989 {" 227. if `1' > 1983 & `1' < 1989 { 228. generate int ch05= chldpres 229. recode ch05 (4 6/8 = 1) (0/3 5 = 0) 230. recode ch613 (3 5 7/8 = 1) (0/2 4 6 = 0) 231. recode ch1417 (2 5/6 8 =1) (0/1 3/4 7 = 0) 232. } 233. if `1' > 1988 & `1' < 1994 { 234. display "if `1' > 1988 & `1' < 1994 {" 235. generate int ch02 = chldpres 236. generate int ch35 = chldpres 237. recode ch02 (2 6/8 12/14 16 = 1) (0/1 3/5 9/11 15 = 0) 238. recode ch35 (3 6 9/10 12/13 15/16 = 1) (0/2 4/5 7/8 11 14 = 0) 239. recode ch613 (4 7 9 11/12 14/16 = 1) (0/3 5/6 8 10 13 = 0) 240. recode ch1417 (5 8 10/11 13/16 = 1) (0/4 6/7 9 12 = 0 ) 241. generate int ch05 = ch02 242. replace ch05 = ch35 if ch35 == 1 243. label variable ch02 "Children 0-2" 244. label variable ch35 "Children 3-5" 245. } 246. if `1' > 1983 & `1' < 1994 { 247. display "if `1' > 1983 & `1' < 1994 {" 248. label variable ch05 "Children 0-5" 249. label variable ch613 "Children 6-13" 250. label variable ch1417 "Children 6-17" 251. } 252. if `1' == 1998 { 253. drop ownchild chldpres 254. } 255. if `1' >= 1999 { 256. replace ownchild = . if ownchild < 0 257. replace chldpres = . if chldpres < 0 258. generate int ch02 = chldpres 259. generate int ch35 = chldpres 260. generate int ch613 = chldpres 261. generate int ch1417 = chldpres 262. recode ch02 (1 5/7 11/13 15 = 1) (0 2/4 8/10 14 = 0) 263. recode ch35 (2 5 8/9 11/12 14/15 = 1) (0/1 3/4 6/7 10 13 =0) 264. recode ch613 (3 6 8 10/11 13/15 = 1) (0/2 4/5 7 9 12 = 0) 265. recode ch1417 (4 7 9/10 12/15 = 1) (0/3 5/6 8 11 = 0) 266. generate int ch05 = ch02 267. replace ch05 = ch35 if ch35 == 1 268. } 269. . if `1' == 1999 { 270. replace ownchild = . if intmonth < 10 271. replace chldpres = . if intmonth < 10 272. replace ch613 = . if intmonth < 10 273. replace ch1417 = . if intmonth < 10 274. replace ch05 = . if intmonth < 10 275. replace ch02 = . if intmonth < 10 276. replace ch35 = . if intmonth < 10 277. } 278. if `1' > 1988 & `1' < 1992 { 279. drop grade92 280. } 281. if `1' < 1989 { 282. replace gradeat = gradeat - 1 283. replace marital = 7 if marital==5 284. } 285. if `1' > 1991 { 286. replace grade92 = . if grade92 < 0 287. } 288. if `1' >= 1998 { 289. replace ged = . if ged < 0 290. replace gedhigr = . if gedhigr < 0 291. replace yrcoll = . if yrcoll < 0 292. replace grprof = . if grprof < 0 293. replace gr6cor = . if gr6cor < 0 294. replace ms123 = . if ms123 < 0 295. generate double ihigrdc = . 296. ** Jaeger . label var ihigrdc "Imputed highest grade completed" 297. replace ihigrdc = 0 if grade92==31 298. replace ihigrdc = 2.5 if grade92==32 299. replace ihigrdc = 5.5 if grade92==33 300. replace ihigrdc = 7.5 if grade92==34 301. replace ihigrdc = 9 if grade92==35 302. replace ihigrdc =10 if grade92==36 303. replace ihigrdc =11 if grade92==37 304. replace ihigrdc =12 if grade92==38 305. replace ihigrdc = 0 if grade92==39 & ged==2 & gedhigr==1 306. replace ihigrdc = 2.5 if grade92==39 & ged==2 & gedhigr==2 307. replace ihigrdc = 5.5 if grade92==39 & ged==2 & gedhigr==3 308. replace ihigrdc = 7.5 if grade92==39 & ged==2 & gedhigr==4 309. replace ihigrdc = 9 if grade92==39 & ged==2 & gedhigr==5 310. replace ihigrdc = 10 if grade92==39 & ged==2 & gedhigr==6 311. replace ihigrdc = 11 if grade92==39 & ged==2 & gedhigr==7 312. replace ihigrdc = 12 if grade92==39 & ged==2 & gedhigr==8 313. replace ihigrdc = 12 if ged==1 314. replace ihigrdc = 12 if grade92>=40 & grade92<=42 & yrcoll==1 315. replace ihigrdc = 13 if grade92>=40 & grade92<=42 & yrcoll==2 316. replace ihigrdc = 14 if grade92>=40 & grade92<=42 & yrcoll==3 317. replace ihigrdc = 15 if grade92>=40 & grade92<=42 & yrcoll==4 318. replace ihigrdc = 16 if grade92>=40 & grade92<=42 & yrcoll==5 319. replace ihigrdc = 16 if grade92==43 & grprof==2 320. replace ihigrdc = 17 if grade92==43 & gr6cor==2 321. replace ihigrdc = 18 if grade92==43 & gr6cor==1 322. replace ihigrdc = 17 if grade92==44 & ms123==1 323. replace ihigrdc = 18 if grade92==44 & ms123>=2 & ms123<. 324. replace ihigrdc = 18 if grade92==45 | grade92==46 325. } 326. if inlist( `1', 1992 , 1993 ) { 327. drop gradecp gradeat 328. } 329. if `1' == 1995 { 330. replace relref94 = . if intmonth > 2 331. replace relref95 = . if intmonth < 3 332. } 333. if inlist( `1', 1996 , 1997 ) { 334. drop relref94 335. } 336. if `1' == 1994 { 337. drop relref95 338. } 339. if `1' >= 1994 { 340. replace penatvty = . if penatvty < 0 341. replace pemntvty = . if pemntvty < 0 342. replace pefntvty = . if pefntvty < 0 343. replace prcitshp = . if prcitshp < 0 344. replace prcitflg = . if prcitflg < 0 345. } 346. if `1' > 1989 { 347. replace ethnic = . if ethnic < 0 348. replace ethnic = . if ethnic >= 10 349. } 350. if `1' >= 1994 & `1' <= 2004 { 351. replace veteran = . if veteran < 0 352. drop vet1-vet4 353. } 354. if `1' == 2005 { 355. display "replacing veteran Jan-July 2005" 356. replace veteran = . if veteran < 0 & intmonth <= 7 357. display "replacing vet1-vet4 if intmonth <= 7 " 358. replace vet1 = . if intmonth <= 7 359. replace vet2 = . if intmonth <= 7 360. replace vet3 = . if intmonth <= 7 361. replace vet4 = . if intmonth <= 7 362. } 363. if `1' == 2005 { 364. replace veteran = . if intmonth >= 8 365. replace vet1 = . if vet1 < 0 & intmonth >= 8 366. replace vet2 = . if vet2 < 0 & intmonth >= 8 367. replace vet3 = . if vet3 < 0 & intmonth >= 8 368. replace vet4 = . if vet4 < 0 & intmonth >= 8 369. } 370. . * Employment . display "Employment" 371. if `1' >= 1994 & `1' <= 2002 { 372. replace occ80 = . if occ80 <0 373. replace ind80 = . if ind80 < 10 374. replace class94 = . if class94<0 375. } 376. if `1' >= 2000 { 377. replace occ00 = . if occ00 <0 378. replace ind02 = . if ind02 < 10 379. replace class94 = . if class94<0 380. } 381. #delimit ; delimiter now ; . ; . display "docc80" ; 382. if `1' >= 1983 & `1' <= 2002 { > display "generate int docc80=occ80;"; 383. generate int docc80=occ80; 384. display "recode docc80"; 385. 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=12) > (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); 386. } ; 387. display "** The renaming is part of the Census reweighting ; " ; 388. if inlist( `1', 2000 , 2001 , 2002 ) { > *display "renaming docc80 docc80p " ; 389. *rename docc80 docc80p ; . } ; 390. display "docc00" ; 391. if `1' >= 2000 { > display "generate int docc00=occ00;"; 392. generate int docc00=occ00; 393. display "recode docc00"; 394. recode docc00 (10/430=1) (500/950=2) (1000/1240=3) (1300/1560=4) (1600/1960=5) > (2000/2060=6) (2100/2150=7) (2200/2550=8) (2600/2960=9) (3000/3540=10) (3600/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); 395. } ; 396. display "dind"; 397. if `1'<= 1982 { > display "`1' <= 1982: creating dind from ind70"; 398. gen dind=ind70 ; 399. 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) ; 400. } ; 401. if `1' <=1991 & `1' >=1983 { > display "replacing dind for `1': `1' <=1991 & `1' >=1983"; 402. gen dind=ind80; 403. 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); 404. } ; 405. if `1' >= 1992 & `1' <= 2002 { > display "replacing dind for `1': `1' >= 1992 & `1' <= 2002 "; 406. gen dind=ind80; 407. 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) ; 408. }; 409. if `1' >= 2000 { > display "replacing dind for `1' >= 2000 " ; 410. gen dind02 = ind02; 411. 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 8670=45) > (8680 8690=46) (8770/8890=47) (8970/9090=48) (9160/9190=49) (9290=50) > (9370/9590=51) (9890=52) ; 412. } ; 413. #delimit cr delimiter now cr . **Wages (If earnings are 0, then wage rate is missing, not zero). . display "Wages" 414. replace paidhr = . if paidhr <=0 415. replace paidhre = . if paidhre <=0 416. replace earnhr = . if earnhr <=0 417. replace earnhre = . if earnhre <=0 418. replace earnwke = . if earnwke < 0 419. if `1' < 1989 { 420. replace eligible = 2 if eligible == . 421. } 422. if `1' >= 1989 { 423. replace eligible = 2 if eligible <= 0 424. } 425. if `1' < 1989 { 426. replace I25a = 0 if I25a ==. 427. replace I25b = 0 if I25b ==. 428. replace I25c = 0 if I25c ==. 429. replace I25d = 0 if I25d ==. 430. } 431. if `1' >= 1994 { 432. replace I25a = 0 if I25a <= 3 433. replace I25b = 0 if I25b <= 3 434. *replace I25a = . if I25a < 0 . *replace I25b = . if I25b < 0 . replace earnhre = . if earnhre ==1 435. replace uhourse = . if lfsr94 >2 | lfsr94 <1 436. replace lfsr94 = . if lfsr94 < 0 437. } 438. if `1' >= 1996 { 439. replace I25c = . if I25c < 0 440. replace I25d = . if I25d < 0 441. } 442. if `1' == 1995 { 443. replace I25c = . if I25c < 0 444. replace I25d = . if I25d < 0 445. replace I25c = . if intmonth < 9 446. replace I25d = . if intmonth < 9 447. } 448. if `1' == 1994 { 449. drop I25c I25d 450. } 451. ** Hours, Unions . display "Hours, Unions" 452. if `1' >= 1994 { 453. replace reason94 = . if reason94< 0 454. replace absent94 = . if absent94< 0 455. replace studftpt = . if studftpt< 0 456. replace schenr = . if schenr < 0 457. replace schlvl = . if schlvl < 0 458. replace ftpt94 = . if ftpt94 < 0 459. replace hourslw = . if hourslw < 0 460. replace hourslw = 99 if hourslw >99 & hourslw != . 461. replace uhourse = . if uhourse < 0 462. replace why3594 = . if why3594 < 0 463. replace unionmme = . if unionmme< 0 464. replace unioncov = . if unioncov< 0 465. } 466. . ** Save and exit . compress 467. saveold /home/data/morg/annual/morg`2',replace 468. summarize 469. clear 470. *! /usr/bin/rm -f aef.dct /tmp/aef.raw . *! /bin/rm -f aef.dct /tmp/aef.raw . ! /usr/bin/chmod a+r /home/data/morg/annual/morg`2'.dta 471. ! /bin/chmod a+r /home/data/morg/annual/morg`2'.dta 472. ! /usr/bin/chmod g+w /home/data/morg/annual/morg`2'.dta 473. ! /bin/chmod g+w /home/data/morg/annual/morg`2'.dta 474. ! /usr/bin/chgrp web /home/data/morg/annual/morg`2'.dta 475. ! /bin/chgrp web /home/data/morg/annual/morg`2'.dta 476. 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 . *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 . aef2 2005 05 03 dct_name aef03.dbd raw_name ../raw/morg05 infile successful Interview | Month | Freq. Percent Cum. ------------+----------------------------------- 1 | 27,346 8.47 8.47 2 | 26,937 8.34 16.81 3 | 26,619 8.24 25.05 4 | 26,917 8.33 33.38 5 | 26,842 8.31 41.69 6 | 26,945 8.34 50.03 7 | 26,776 8.29 58.32 8 | 27,217 8.43 66.75 9 | 26,761 8.29 75.04 10 | 27,138 8.40 83.44 11 | 26,645 8.25 91.69 12 | 26,848 8.31 100.00 ------------+----------------------------------- Total | 322,991 100.00 obs 322991 Geography (322991 real changes made) (322991 real changes made) dropping cmsacode msafips smsa93 (61335 real changes made, 61335 to missing) smsasize = . if smsasize <=0 inlisting 96 97 replace smsastat = . if smsastat==3 | smsastat<0 (2790 real changes made, 2790 to missing) (52 real changes made, 52 to missing) (16 real changes made, 16 to missing) replace centcity = . if centcity==4 | centcity<=0 (59066 real changes made, 59066 to missing) (299320 real changes made, 299320 to missing) replace smsasize=. if smsasize<=0 drop smsasize Demography if 2005 > 1983 & 2005 < 1989 { (118886 real changes made, 118886 to missing) (118734 real changes made, 118734 to missing) (118734 missing values generated) (118734 missing values generated) (118734 missing values generated) (118734 missing values generated) (ch02: 82459 changes made) (ch35: 92581 changes made) (ch613: 92581 changes made) (ch1417: 92581 changes made) (118734 missing values generated) (16636 real changes made) (0 real changes made) (222920 real changes made, 222920 to missing) (313596 real changes made, 313596 to missing) (236842 real changes made, 236842 to missing) (269797 real changes made, 269797 to missing) (309396 real changes made, 309396 to missing) (303929 real changes made, 303929 to missing) (322991 missing values generated) (1249 real changes made) (2466 real changes made) (4610 real changes made) (8399 real changes made) (8437 real changes made) (13053 real changes made) (13742 real changes made) (4516 real changes made) (30 real changes made) (16 real changes made) (69 real changes made) (704 real changes made) (1166 real changes made) (2523 real changes made) (3554 real changes made) (1333 real changes made) (90676 real changes made) (10611 real changes made) (22073 real changes made) (37968 real changes made) (11301 real changes made) (4196 real changes made) (39599 real changes made) (4773 real changes made) (8822 real changes made) (1886 real changes made) (17176 real changes made) (8043 real changes made) (0 real changes made) (0 real changes made) (0 real changes made) (0 real changes made) (0 real changes made) (289970 real changes made, 289970 to missing) (0 real changes made) replacing veteran Jan-July 2005 (860 real changes made, 860 to missing) replacing vet1-vet4 if intmonth <= 7 (0 real changes made) (0 real changes made) (0 real changes made) (0 real changes made) (134609 real changes made, 134609 to missing) (120345 real changes made, 120345 to missing) (131997 real changes made, 131997 to missing) (134023 real changes made, 134023 to missing) (134473 real changes made, 134473 to missing) Employment (100748 real changes made, 100748 to missing) (100748 real changes made, 100748 to missing) (100748 real changes made, 100748 to missing) docc80 ** The renaming is part of the Census reweighting ; docc00 (100748 missing values generated) recode docc00 (docc00: 222243 changes made) dind (100748 missing values generated) (dind02: 222243 changes made) Wages (143843 real changes made, 143843 to missing) (0 real changes made) (214382 real changes made, 214382 to missing) (0 real changes made) (0 real changes made) (143843 real changes made) (119943 real changes made) (143843 real changes made) (0 real changes made) (119943 real changes made, 119943 to missing) (1415 real changes made, 1415 to missing) (214318 real changes made, 214318 to missing) (143843 real changes made, 143843 to missing) Hours, Unions (307950 real changes made, 307950 to missing) (314625 real changes made, 314625 to missing) (298403 real changes made, 298403 to missing) (274495 real changes made, 274495 to missing) (298403 real changes made, 298403 to missing) (1415 real changes made, 1415 to missing) (128309 real changes made, 128309 to missing) (112 real changes made) (18392 real changes made, 18392 to missing) (274175 real changes made, 274175 to missing) (143843 real changes made, 143843 to missing) (165989 real changes made, 165989 to missing) hourslw was int now byte ch02 was int now byte ch35 was int now byte ch613 was int now byte ch1417 was int now byte ch05 was int now byte docc00 was int now byte dind02 was float now byte file /home/data/morg/annual/morg05.dta saved Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- hhid | 0 intmonth | 322991 6.493348 3.45407 1 12 hurespli | 322939 1.491935 .8580982 1 15 minsamp | 322991 6.011251 1.999971 4 8 hrlonglk | 322991 1.991764 .1280753 0 2 -------------+-------------------------------------------------------- hrhhid2 | 0 serial | 0 hhnum | 322991 1.052416 .2465816 1 7 state | 322991 53.35078 26.35006 11 95 cbsafips | 322991 24937.34 21218.49 0 79600 -------------+-------------------------------------------------------- county | 322991 27.46992 65.86541 0 810 centcity | 263925 2.003785 .7415407 1 3 smsastat | 320201 1.228185 .419663 1 2 icntcity | 23671 1.413502 .951166 1 7 smsa04 | 261656 4.202594 2.155997 0 7 -------------+-------------------------------------------------------- relref95 | 322991 3.0294 3.065008 1 18 age | 322991 45.26263 17.96758 16 85 sex | 322991 1.523104 .4994667 1 2 veteran | 187522 5.667804 1.109807 1 6 grade92 | 322991 39.8775 2.800101 31 46 -------------+-------------------------------------------------------- race | 322991 1.378283 1.27769 1 21 ethnic | 33021 1.994246 1.406191 1 5 lineno | 322991 1.753708 1.056181 1 16 famnum | 322991 .8039326 .4542456 0 6 pfamrel | 322991 1.380091 1.052093 -1 4 -------------+-------------------------------------------------------- marital | 322991 3.287677 2.624325 1 7 penatvty | 322991 85.09706 81.11334 57 555 pemntvty | 322991 92.79985 88.31731 57 555 pefntvty | 322991 92.97181 88.39068 57 555 prcitshp | 322991 1.446567 1.178979 1 5 -------------+-------------------------------------------------------- prcitflg | 322991 .1215266 1.662693 0 41 peinusyr | 322975 1.40579 4.066652 0 18 lfsr94 | 321576 2.761863 2.344953 1 7 absent94 | 8366 6.06897 3.369268 4 14 uhourse | 184656 38.99408 11.23143 0 99 -------------+-------------------------------------------------------- reason94 | 15041 5.105711 2.828285 1 13 hourslw | 194682 38.91666 13.44656 1 99 why3594 | 48816 14.91937 7.031162 1 23 ftpt94 | 321576 2.67404 2.437441 1 12 class94 | 222243 4.125187 1.181348 1 8 -------------+-------------------------------------------------------- eligible | 322991 1.445347 .4970048 1 2 paidhre | 179148 1.39339 .4885034 1 2 earnhre | 108609 1349.818 780.5516 32 9999 earnwke | 179148 709.9971 538.8712 0 2884.61 unionmme | 179148 1.876382 .3291467 1 2 -------------+-------------------------------------------------------- unioncov | 157002 1.985229 .1206335 1 2 schenr | 48496 1.492989 .499956 1 2 studftpt | 24588 1.08252 .2751608 1 2 schlvl | 24588 1.477591 .4995077 1 2 earnwt | 322991 8399.581 4715.556 0 133411.1 -------------+-------------------------------------------------------- weight | 322991 2099.895 1173.812 0 34716.21 chldpres | 204257 2.322496 3.380268 0 15 ownchild | 204105 .8503319 1.131901 0 10 I25d | 179148 .3094313 .4622605 0 1 I25c | 108673 .3414095 .4741847 0 1 -------------+-------------------------------------------------------- I25a | 322991 .3449817 3.530872 0 43 I25b | 322991 3.505831 11.60454 0 42 qstnum | 0 occurnum | 0 ged | 100071 1.093883 .2916678 1 2 -------------+-------------------------------------------------------- gedhigr | 9395 6.343268 1.193801 1 8 yrcoll | 86149 2.726033 .9999293 1 5 grprof | 53194 1.744426 .4361874 1 2 gr6cor | 13595 1.351085 .477327 1 2 ms123 | 19062 2.171178 .582902 1 3 -------------+-------------------------------------------------------- cmpwgt | 322991 2100.151 1175.252 0 34708.83 ind02 | 222243 6109.839 2737.451 170 9890 occ00 | 222243 4342.378 2555.252 10 9840 vet1 | 14264 4.39477 1.892543 1 9 vet2 | 2612 4.419219 1.699343 2 9 -------------+-------------------------------------------------------- vet3 | 586 5.035836 1.592851 3 9 vet4 | 136 6.705882 1.559286 4 9 year | 322991 2005 0 2005 2005 ch02 | 204257 .1157414 .3199154 0 1 ch35 | 204257 .1230998 .3285526 0 1 -------------+-------------------------------------------------------- ch613 | 204257 .2612836 .4393352 0 1 ch1417 | 204257 .1588783 .3655634 0 1 ch05 | 204257 .1971879 .3978763 0 1 ihigrdc | 322991 13.10552 3.01179 0 18 docc00 | 222243 12.89276 6.631031 1 23 -------------+-------------------------------------------------------- dind02 | 222243 30.06931 14.6842 1 52 . . end of do-file . exit,clear