---------------------------------------------------------------------------------------------------------- name: log: C:\Users\Aki\Documents\stata\feb14.log log type: text opened on: 14 Feb 2022, 18:45:05 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . sysuse auto (1978 Automobile Data) . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . rename rep78 repair_record . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . rename repair_record rep78 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . sum Price variable Price not found r(111); end of do-file r(111); . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . sum price Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- price | 74 6165.257 2949.496 3291 15906 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . rename * *1978 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . rename *1978 * . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . rename * *a . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . rename *a * . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . rename m* M* . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . rename M* m* . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . label variable rep78 "repair record of cars in 1978" . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab rep78 repair | record of | cars in | 1978 | Freq. Percent Cum. ------------+----------------------------------- 1 | 2 2.90 2.90 2 | 8 11.59 14.49 3 | 30 43.48 57.97 4 | 18 26.09 84.06 5 | 11 15.94 100.00 ------------+----------------------------------- Total | 69 100.00 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . label dir origin . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab foreign Car type | Freq. Percent Cum. ------------+----------------------------------- Domestic | 52 70.27 70.27 Foreign | 22 29.73 100.00 ------------+----------------------------------- Total | 74 100.00 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab rep78 repair | record of | cars in | 1978 | Freq. Percent Cum. ------------+----------------------------------- 1 | 2 2.90 2.90 2 | 8 11.59 14.49 3 | 30 43.48 57.97 4 | 18 26.09 84.06 5 | 11 15.94 100.00 ------------+----------------------------------- Total | 69 100.00 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . label define repair 1 "A" 2 "B" 3 "C" 4 "D" 5 "E" . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . label dir repair origin . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . label values rep78 repair . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab rep78 repair | record of | cars in | 1978 | Freq. Percent Cum. ------------+----------------------------------- A | 2 2.90 2.90 B | 8 11.59 14.49 C | 30 43.48 57.97 D | 18 26.09 84.06 E | 11 15.94 100.00 ------------+----------------------------------- Total | 69 100.00 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . help egen . end of do-file . sort price . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . egen deciles = cut (price), group (10) . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab deciles deciles | Freq. Percent Cum. ------------+----------------------------------- 0 | 7 9.46 9.46 1 | 7 9.46 18.92 2 | 8 10.81 29.73 3 | 7 9.46 39.19 4 | 8 10.81 50.00 5 | 7 9.46 59.46 6 | 7 9.46 68.92 7 | 8 10.81 79.73 8 | 7 9.46 89.19 9 | 8 10.81 100.00 ------------+----------------------------------- Total | 74 100.00 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . egen rowmean = rowmean (price mpg weight) . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . browse price mpg weight rowmean . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab rep78, sum (price) repair | record of | cars in | Summary of Price 1978 | Mean Std. Dev. Freq. ------------+------------------------------------ A | 4,564.5 522.55191 2 B | 5,967.625 3,579.357 8 C | 6,429.233 3,525.14 30 D | 6,071.5 1,709.608 18 E | 5,913 2,615.763 11 ------------+------------------------------------ Total | 6,146.043 2,912.44 69 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . egen pricerepair = mean (price), by(rep78) . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab pricerepair pricerepair | Freq. Percent Cum. ------------+----------------------------------- 4564.5 | 2 2.70 2.70 5913 | 11 14.86 17.57 5967.625 | 8 10.81 28.38 6071.5 | 18 24.32 52.70 6429.233 | 30 40.54 93.24 6430.4 | 5 6.76 100.00 ------------+----------------------------------- Total | 74 100.00 . end of do-file . sum price Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- price | 74 6165.257 2949.496 3291 15906 . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . gen highprice = 1 if price>6165 (52 missing values generated) . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . replace highprice = 0 if price<=6165 (52 real changes made) . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab highprice highprice | Freq. Percent Cum. ------------+----------------------------------- 0 | 52 70.27 70.27 1 | 22 29.73 100.00 ------------+----------------------------------- Total | 74 100.00 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab rep78 repair | record of | cars in | 1978 | Freq. Percent Cum. ------------+----------------------------------- A | 2 2.90 2.90 B | 8 11.59 14.49 C | 30 43.48 57.97 D | 18 26.09 84.06 E | 11 15.94 100.00 ------------+----------------------------------- Total | 69 100.00 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . gen A = 1 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . replace A = 0 if rep78>1 (72 real changes made) . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . gen B = 1 . replace B = 0 if rep78!=2 (66 real changes made) . . gen C = 1 . replace C = 0 if rep78!=3 (44 real changes made) . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab rep78, gen(dummy) repair | record of | cars in | 1978 | Freq. Percent Cum. ------------+----------------------------------- A | 2 2.90 2.90 B | 8 11.59 14.49 C | 30 43.48 57.97 D | 18 26.09 84.06 E | 11 15.94 100.00 ------------+----------------------------------- Total | 69 100.00 . end of do-file . drop A B . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . rename dummy1 A . rename dummy2 B . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . drop dummy5 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . drop A B . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . keep make price foreign trunk . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . keep *e* . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab foreign Car type | Freq. Percent Cum. ------------+----------------------------------- Domestic | 52 70.27 70.27 Foreign | 22 29.73 100.00 ------------+----------------------------------- Total | 74 100.00 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . drop if foreign==1 (22 observations deleted) . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . tab foreign Car type | Freq. Percent Cum. ------------+----------------------------------- Domestic | 52 100.00 100.00 ------------+----------------------------------- Total | 52 100.00 . end of do-file . do "C:\Users\Aki\AppData\Local\Temp\STDd1c_000000.tmp" . log close name: log: C:\Users\Aki\Documents\stata\feb14.log log type: text closed on: 14 Feb 2022, 19:46:51 ----------------------------------------------------------------------------------------------------------