------------------------------------------------------------------------------------------------------ log: /disk/nber10/SCCS/ces/funeral.log log type: text opened on: 17 Jul 2009, 17:14:34 . set more off . set mem 500m (512000k) . ** by Jean Roth, jroth@nber.org , 2009-07-16 . *use newid ucc 2005/sas/Intrvw05/mtbi061.dta . *describe . *count if ucc=="680140" . *use newid ref_race using 2005/sas/Intrvw05/fmli051.dta . . program loop 1. ***************************************************** . ** Getting data set name from full path and file name . set obs 1 2. gen j="`1'" 3. gen year=substr(j,1,4) 4. gen yr=substr(year,3,2) 5. gen r=reverse(j) 6. gen i=index(r,"/") 7. quietly sum i 8. local i = `r(mean)'-1 9. gen s=substr(r,1,`i') 10. gen c=reverse(s) 11. gen m=subinstr(c,".dta","",1) 12. gen e=subinstr(m,"x","",1) 13. gen f=subinstr(e,"mtbi","fmli",1) 14. local m = m[1] 15. di "m=`m'" 16. local f = f[1] 17. di "f=`f'" 18. clear 19. ***************************************************** . *use newid ucc using `1' if ucc=="680140" . use newid ucc cost ref_yr using `1' 20. describe 21. sort newid 22. save /tmp/`m', replace 23. clear 24. use newid ref_race using "`2'" 25. sort newid 26. merge newid using /tmp/`m' 27. *assert _merge==3 . tab _merge 28. ** Funerals . keep if ucc=="680140" 29. bysort ref_race: sum cost 30. save /tmp/`m', replace 31. clear 32. end loop . loop ./2001/intrvw01/mtbi011x.dta ./2001/intrvw01/fmli011x.dta obs was 0, now 1 m=mtbi011x f=fmli011 Contains data from ./2001/intrvw01/mtbi011x.dta obs: 697,014 vars: 4 size: 18,122,364 (96.5% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ ref_yr str4 %4s ucc str6 %6s cost double %10.0g newid long %12.0g ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi011x.dta not found) file /tmp/mtbi011x.dta saved variable newid does not uniquely identify observations in /tmp/mtbi011x.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 697,014 100.00 100.00 ------------+----------------------------------- Total | 697,014 100.00 (696747 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 220 286.9227 1169.434 5 9880 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 18 1104.111 2129.042 1 7000 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 3 33.33333 11.54701 20 40 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 26 238.8846 606.1041 10 2510 file /tmp/mtbi011x.dta saved . loop ./2001/intrvw01/mtbi012.dta ./2001/intrvw01/fmli012.dta obs was 0, now 1 m=mtbi012 f=fmli012 Contains data from ./2001/intrvw01/mtbi012.dta obs: 657,688 vars: 4 size: 17,099,888 (96.7% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ ref_yr str4 %4s ucc str6 %6s cost double %10.0g newid long %12.0g ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi012.dta not found) file /tmp/mtbi012.dta saved variable newid does not uniquely identify observations in /tmp/mtbi012.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 657,688 100.00 100.00 ------------+----------------------------------- Total | 657,688 100.00 (657404 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 241 449.6846 1964.333 3.3333 25000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 12 962.4167 2282.664 18.6667 8000 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 2 656 910.7535 12 1300 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 29 159.2069 549.6993 5 3000 file /tmp/mtbi012.dta saved . loop ./2001/intrvw01/mtbi013.dta ./2001/intrvw01/fmli013.dta obs was 0, now 1 m=mtbi013 f=fmli013 Contains data from ./2001/intrvw01/mtbi013.dta obs: 658,322 vars: 4 size: 17,116,372 (96.7% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ ref_yr str4 %4s ucc str6 %6s cost double %10.0g newid long %12.0g ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi013.dta not found) file /tmp/mtbi013.dta saved variable newid does not uniquely identify observations in /tmp/mtbi013.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 658,322 100.00 100.00 ------------+----------------------------------- Total | 658,322 100.00 (658077 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 194 591.1907 1539.079 1.6667 10000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 22 279.2727 856.1812 25 4000 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 29 52.51723 40.29176 10 200 file /tmp/mtbi013.dta saved . loop ./2001/intrvw01/mtbi014.dta ./2001/intrvw01/fmli014.dta obs was 0, now 1 m=mtbi014 f=fmli014 Contains data from ./2001/intrvw01/mtbi014.dta obs: 679,163 vars: 4 size: 17,658,238 (96.6% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ ref_yr str4 %4s ucc str6 %6s cost double %10.0g newid long %12.0g ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi014.dta not found) file /tmp/mtbi014.dta saved variable newid does not uniquely identify observations in /tmp/mtbi014.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 679,163 100.00 100.00 ------------+----------------------------------- Total | 679,163 100.00 (678894 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 206 482.0825 1450.619 2.3333 13011 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 23 678.2174 1295.707 25 5000 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 5 117 150.2332 15 380 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 35 78.85714 179.9214 3.3333 1000 file /tmp/mtbi014.dta saved . ***loop ./2001/intrvw01/mtbi021.dta ./2002/intrvw02/fmli021.dta . loop ./2002/intrvw02/mtbi021x.dta ./2002/intrvw02/fmli021x.dta obs was 0, now 1 m=mtbi021x f=fmli021 Contains data from ./2002/intrvw02/mtbi021x.dta obs: 716,727 vars: 4 size: 18,634,902 (96.4% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi021x.dta not found) file /tmp/mtbi021x.dta saved variable newid does not uniquely identify observations in /tmp/mtbi021x.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 716,727 100.00 100.00 ------------+----------------------------------- Total | 716,727 100.00 (716444 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 222 624.8153 1793.245 3 12500 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 19 984.8947 1402.301 32 5000 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 4 500.5 332.3333 2 666.6667 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 38 300.6579 1616.276 6.6667 10000 file /tmp/mtbi021x.dta saved . loop ./2002/intrvw02/mtbi022.dta ./2002/intrvw02/fmli022.dta obs was 0, now 1 m=mtbi022 f=fmli022 Contains data from ./2002/intrvw02/mtbi022.dta obs: 685,144 vars: 4 size: 17,813,744 (96.6% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi022.dta not found) file /tmp/mtbi022.dta saved variable newid does not uniquely identify observations in /tmp/mtbi022.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 685,144 100.00 100.00 ------------+----------------------------------- Total | 685,144 100.00 (684831 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 246 523.5976 1453.917 1.6667 10000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 23 775.087 1946.068 34 9492 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 1 35 . 35 35 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 43 373.3721 1973.849 6.6667 13000 file /tmp/mtbi022.dta saved . loop ./2002/intrvw02/mtbi023.dta ./2002/intrvw02/fmli023.dta obs was 0, now 1 m=mtbi023 f=fmli023 Contains data from ./2002/intrvw02/mtbi023.dta obs: 703,842 vars: 4 size: 18,299,892 (96.5% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi023.dta not found) file /tmp/mtbi023.dta saved variable newid does not uniquely identify observations in /tmp/mtbi023.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 703,842 100.00 100.00 ------------+----------------------------------- Total | 703,842 100.00 (703551 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 250 520.836 1786.978 5 15000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 12 896.25 1619.138 5 5232 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 1 300 . 300 300 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 28 892.4286 2406.912 6.6667 9798 file /tmp/mtbi023.dta saved . loop ./2002/intrvw02/mtbi024.dta ./2002/intrvw02/fmli024.dta obs was 0, now 1 m=mtbi024 f=fmli024 Contains data from ./2002/intrvw02/mtbi024.dta obs: 710,899 vars: 4 size: 18,483,374 (96.5% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi024.dta not found) file /tmp/mtbi024.dta saved variable newid does not uniquely identify observations in /tmp/mtbi024.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 710,899 100.00 100.00 ------------+----------------------------------- Total | 710,899 100.00 (710602 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 226 374.938 1175.082 3 10000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 30 437.9333 913.2085 6.6667 4000 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 2 20 21.2132 5 35 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 39 213.6154 446.5961 10 2000 file /tmp/mtbi024.dta saved . ***loop ./2002/intrvw02/mtbi031.dta . loop ./2003/Intrvw03/mtbi031x.dta ./2003/Intrvw03/fmli031x.dta obs was 0, now 1 m=mtbi031x f=fmli031 Contains data from ./2003/Intrvw03/mtbi031x.dta obs: 735,461 vars: 4 size: 19,121,986 (96.4% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi031x.dta not found) file /tmp/mtbi031x.dta saved variable newid does not uniquely identify observations in /tmp/mtbi031x.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 1 | 1 0.00 0.00 3 | 735,461 100.00 100.00 ------------+----------------------------------- Total | 735,462 100.00 (735158 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 236 652.3093 2119.357 3 15000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 28 396.6071 800.5718 12 3132 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 1 58 . 58 58 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 39 137 285.2088 6.6667 1500 file /tmp/mtbi031x.dta saved . loop ./2003/Intrvw03/mtbi032.dta ./2003/Intrvw03/fmli032.dta obs was 0, now 1 m=mtbi032 f=fmli032 Contains data from ./2003/Intrvw03/mtbi032.dta obs: 677,105 vars: 4 size: 17,604,730 (96.6% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi032.dta not found) file /tmp/mtbi032.dta saved variable newid does not uniquely identify observations in /tmp/mtbi032.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 677,105 100.00 100.00 ------------+----------------------------------- Total | 677,105 100.00 (676902 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 161 493.5652 1491.503 5 10000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 15 345.0667 895.3208 15.3333 3500 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 25 53.2 47.64335 6.6667 200 ------------------------------------------------------------------------------------------------------ -> ref_race = 6 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 2 30 14.14214 20 40 file /tmp/mtbi032.dta saved . loop ./2003/Intrvw03/mtbi033.dta ./2003/Intrvw03/fmli033.dta obs was 0, now 1 m=mtbi033 f=fmli033 Contains data from ./2003/Intrvw03/mtbi033.dta obs: 666,895 vars: 4 size: 17,339,270 (96.7% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi033.dta not found) file /tmp/mtbi033.dta saved variable newid does not uniquely identify observations in /tmp/mtbi033.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 1 | 2 0.00 0.00 3 | 666,895 100.00 100.00 ------------+----------------------------------- Total | 666,897 100.00 (666723 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 137 761.1606 1981.504 6.6667 12150 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 5 963 2043.437 25 4618 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 29 204.5517 762.0009 .3333 4000 ------------------------------------------------------------------------------------------------------ -> ref_race = 6 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 3 25 0 25 25 file /tmp/mtbi033.dta saved . loop ./2003/Intrvw03/mtbi034.dta ./2003/Intrvw03/fmli034.dta obs was 0, now 1 m=mtbi034 f=fmli034 Contains data from ./2003/Intrvw03/mtbi034.dta obs: 666,500 vars: 4 size: 17,329,000 (96.7% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: (note: file /tmp/mtbi034.dta not found) file /tmp/mtbi034.dta saved variable newid does not uniquely identify observations in /tmp/mtbi034.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 666,500 100.00 100.00 ------------+----------------------------------- Total | 666,500 100.00 (666334 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 129 693.6589 1661.198 5 8000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 12 760.25 1373.82 40 5000 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 4 1287.5 2475 50 5000 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 17 43.82353 44.61161 6.6667 200 ------------------------------------------------------------------------------------------------------ -> ref_race = 6 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 4 30.5 7 20 34 file /tmp/mtbi034.dta saved . **loop ./2003/Intrvw03/mtbi041.dta . loop ./2004/Intrvw04/mtbi041x.dta ./2004/Intrvw04/fmli041x.dta obs was 0, now 1 m=mtbi041x f=fmli041 Contains data from ./2004/Intrvw04/mtbi041x.dta obs: 689,817 vars: 4 size: 17,935,242 (96.6% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: file /tmp/mtbi041x.dta saved variable newid does not uniquely identify observations in /tmp/mtbi041x.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 1 | 1 0.00 0.00 3 | 689,817 100.00 100.00 ------------+----------------------------------- Total | 689,818 100.00 (689631 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 141 831.7872 2093.899 1.6667 9927 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 14 199.2857 519.6036 20 2000 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 1 120 . 120 120 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 23 55.34781 56.92708 10 176 ------------------------------------------------------------------------------------------------------ -> ref_race = 5 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 2 6000 0 6000 6000 ------------------------------------------------------------------------------------------------------ -> ref_race = 6 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 6 67 36.14969 34 100 file /tmp/mtbi041x.dta saved . loop ./2004/Intrvw04/mtbi042.dta ./2004/Intrvw04/fmli042.dta obs was 0, now 1 m=mtbi042 f=fmli042 Contains data from ./2004/Intrvw04/mtbi042.dta obs: 641,506 vars: 4 size: 16,679,156 (96.8% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: file /tmp/mtbi042.dta saved variable newid does not uniquely identify observations in /tmp/mtbi042.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 641,506 100.00 100.00 ------------+----------------------------------- Total | 641,506 100.00 (641323 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 136 813.2647 2102.451 1.6667 12000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 19 1016.158 2339.866 10 8000 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 1 50 . 50 50 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 16 406.5625 1076.416 20 4000 ------------------------------------------------------------------------------------------------------ -> ref_race = 5 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 3 34 0 34 34 ------------------------------------------------------------------------------------------------------ -> ref_race = 6 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 8 156.5 261.8697 34 800 file /tmp/mtbi042.dta saved . loop ./2004/Intrvw04/mtbi043.dta ./2004/Intrvw04/fmli043.dta obs was 0, now 1 m=mtbi043 f=fmli043 Contains data from ./2004/Intrvw04/mtbi043.dta obs: 643,888 vars: 4 size: 16,741,088 (96.8% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: file /tmp/mtbi043.dta saved variable newid does not uniquely identify observations in /tmp/mtbi043.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 643,888 100.00 100.00 ------------+----------------------------------- Total | 643,888 100.00 (643727 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 133 566.3158 1639.916 3.3333 9183 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 10 344.5 770.8561 20 2500 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 2 825 954.5942 150 1500 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 11 371.3636 1005.739 10 3395 ------------------------------------------------------------------------------------------------------ -> ref_race = 5 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 4 50.5 33 34 100 ------------------------------------------------------------------------------------------------------ -> ref_race = 6 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 1 1200 . 1200 1200 file /tmp/mtbi043.dta saved . loop ./2004/Intrvw04/mtbi044.dta ./2004/Intrvw04/fmli044.dta obs was 0, now 1 m=mtbi044 f=fmli044 Contains data from ./2004/Intrvw04/mtbi044.dta obs: 642,795 vars: 4 size: 16,712,670 (96.8% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: file /tmp/mtbi044.dta saved variable newid does not uniquely identify observations in /tmp/mtbi044.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 1 | 1 0.00 0.00 3 | 642,795 100.00 100.00 ------------+----------------------------------- Total | 642,796 100.00 (642643 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 120 917.35 2058.131 4 12000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 17 1176.882 2335.068 50 8000 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 9 975.2222 1732.636 20 5000 ------------------------------------------------------------------------------------------------------ -> ref_race = 5 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 2 80 28.28427 60 100 ------------------------------------------------------------------------------------------------------ -> ref_race = 6 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 5 51.99998 55.70758 10 150 file /tmp/mtbi044.dta saved . *loop ./2004/Intrvw04/mtbi051.dta . loop ./2005/sas/Intrvw05/mtbi051x.dta ./2005/sas/Intrvw05/fmli051x.dta obs was 0, now 1 m=mtbi051x f=fmli051 Contains data from ./2005/sas/Intrvw05/mtbi051x.dta obs: 441,781 vars: 4 size: 11,486,306 (97.8% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: file /tmp/mtbi051x.dta saved variable newid does not uniquely identify observations in /tmp/mtbi051x.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 441,781 100.00 100.00 ------------+----------------------------------- Total | 441,781 100.00 (441691 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 73 1337.123 2482.287 13.3333 10000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 10 1111.7 2826.425 20 9000 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 5 2266 2860.075 50 5900 ------------------------------------------------------------------------------------------------------ -> ref_race = 5 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 2 130 28.28427 110 150 file /tmp/mtbi051x.dta saved . loop ./2005/sas/Intrvw05/mtbi052.dta ./2005/sas/Intrvw05/fmli052.dta obs was 0, now 1 m=mtbi052 f=fmli052 Contains data from ./2005/sas/Intrvw05/mtbi052.dta obs: 636,111 vars: 4 size: 16,538,886 (96.8% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: file /tmp/mtbi052.dta saved variable newid does not uniquely identify observations in /tmp/mtbi052.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 636,111 100.00 100.00 ------------+----------------------------------- Total | 636,111 100.00 (635967 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 113 1221.319 2441.569 5 12000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 13 1019 2196.572 20 7106 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 15 455 1282.195 15 5000 ------------------------------------------------------------------------------------------------------ -> ref_race = 5 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 3 40 17.32051 20 50 file /tmp/mtbi052.dta saved . loop ./2005/sas/Intrvw05/mtbi053.dta ./2005/sas/Intrvw05/fmli053.dta obs was 0, now 1 m=mtbi053 f=fmli053 Contains data from ./2005/sas/Intrvw05/mtbi053.dta obs: 627,554 vars: 4 size: 16,316,404 (96.9% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: file /tmp/mtbi053.dta saved variable newid does not uniquely identify observations in /tmp/mtbi053.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 627,554 100.00 100.00 ------------+----------------------------------- Total | 627,554 100.00 (627418 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 98 1121.122 2359.437 1 12000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 18 281.1667 508.5439 14 1781 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 13 56.15385 37.75766 20 150 ------------------------------------------------------------------------------------------------------ -> ref_race = 5 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 3 20 0 20 20 ------------------------------------------------------------------------------------------------------ -> ref_race = 6 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 4 142.75 125.6858 1 300 file /tmp/mtbi053.dta saved . loop ./2005/sas/Intrvw05/mtbi054.dta ./2005/sas/Intrvw05/fmli054.dta obs was 0, now 1 m=mtbi054 f=fmli054 Contains data from ./2005/sas/Intrvw05/mtbi054.dta obs: 630,305 vars: 4 size: 16,387,930 (96.9% of memory free) ------------------------------------------------------------------------------------------------------ storage display value variable name type format label variable label ------------------------------------------------------------------------------------------------------ newid long %12.0g ucc str6 %6s cost double %10.0g ref_yr str4 %4s ------------------------------------------------------------------------------------------------------ Sorted by: file /tmp/mtbi054.dta saved variable newid does not uniquely identify observations in /tmp/mtbi054.dta _merge | Freq. Percent Cum. ------------+----------------------------------- 1 | 2 0.00 0.00 3 | 630,305 100.00 100.00 ------------+----------------------------------- Total | 630,307 100.00 (630183 observations deleted) ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 95 969.7684 2052.947 1 10019 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 15 63.93333 107.7228 6 430 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 8 72 79.12377 20 236 ------------------------------------------------------------------------------------------------------ -> ref_race = 5 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 4 57.5 15 50 80 ------------------------------------------------------------------------------------------------------ -> ref_race = 6 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 2 47.5 3.535534 45 50 file /tmp/mtbi054.dta saved . **loop ./2005/sas/Intrvw05/mtbi061.dta . . use /tmp/mtbi051x, clear . append using /tmp/mtbi052 . append using /tmp/mtbi053 . append using /tmp/mtbi054 . append using /tmp/mtbi041x . append using /tmp/mtbi042 . append using /tmp/mtbi043 . append using /tmp/mtbi044 . append using /tmp/mtbi031x . append using /tmp/mtbi032 . append using /tmp/mtbi033 . append using /tmp/mtbi034 . append using /tmp/mtbi021x . append using /tmp/mtbi022 . append using /tmp/mtbi023 . append using /tmp/mtbi024 . append using /tmp/mtbi011x . append using /tmp/mtbi012 . append using /tmp/mtbi013 . append using /tmp/mtbi014 . bysort ref_race: sum cost ------------------------------------------------------------------------------------------------------ -> ref_race = 1 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 3377 635.4845 1810.036 1 25000 ------------------------------------------------------------------------------------------------------ -> ref_race = 2 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 335 655.9731 1540.17 1 9492 ------------------------------------------------------------------------------------------------------ -> ref_race = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 27 422.2963 995.442 2 5000 ------------------------------------------------------------------------------------------------------ -> ref_race = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 477 271.1971 1136.244 .3333 13000 ------------------------------------------------------------------------------------------------------ -> ref_race = 5 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 23 571.0435 1713.39 20 6000 ------------------------------------------------------------------------------------------------------ -> ref_race = 6 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cost | 35 115.3429 233.32 1 1200 . end of do-file . exit,clearwq option clearwq not allowed r(198); . exit,clear