Sie sind auf Seite 1von 6

.

clear all

. //Difference in Differences Model


. use "C:\Users\HP\Google Drive\Materi Kuliah\Semester III\Evaluasi Dampak\Pak Gilang\data\Kuliah
5\KIELMC.dta"

.
. describe

Contains data from C:\Users\HP\Google Drive\Materi Kuliah\Semester III\Evaluasi Dampak\Pak


Gilang\data\Kuliah 5\KIELMC.dta
obs: 321
vars: 25 26 Oct 2017 08:40
size: 23,433
--------------------------------------------------------------------------------------------------
-------------------------------------------
storage display value
variable name type format label variable label
--------------------------------------------------------------------------------------------------
-------------------------------------------
year int %9.0g 1978 or 1981
age int %9.0g age of house
agesq float %9.0g age^2
nbh byte %9.0g neighborhood, 1-6
cbd float %9.0g dist. to cent. bus. dstrct, ft.
intst float %9.0g dist. to interstate, ft.
lintst float %9.0g log(intst)
price float %9.0g selling price
rooms byte %9.0g # rooms in house
area int %9.0g square footage of house
land float %9.0g square footage lot
baths byte %9.0g # bathrooms
dist float %9.0g dist. from house to incin., ft.
ldist float %9.0g log(dist)
wind byte %9.0g prc. time wind incin. to house
lprice float %9.0g log(price)
y81 byte %9.0g =1 if year == 1981
larea float %9.0g log(area)
lland float %9.0g log(land)
y81ldist float %9.0g y81*ldist
lintstsq float %9.0g lintst^2
nearinc byte %9.0g =1 if dist <= 15840
y81nrinc byte %9.0g y81*nearinc
rprice float %9.0g price, 1978 dollars
lrprice float %9.0g log(rprice)
--------------------------------------------------------------------------------------------------
-------------------------------------------
Sorted by:

.
. *[1] Regresi Tahun 1981 (DepVar = rprice, harga riil)
.
. reg rprice nearinc if year==1981

Source | SS df MS Number of obs = 142


-------------+---------------------------------- F(1, 140) = 27.73
Model | 2.7059e+10 1 2.7059e+10 Prob > F = 0.0000
Residual | 1.3661e+11 140 975815048 R-squared = 0.1653
-------------+---------------------------------- Adj R-squared = 0.1594
Total | 1.6367e+11 141 1.1608e+09 Root MSE = 31238

------------------------------------------------------------------------------
rprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
nearinc | -30688.27 5827.709 -5.27 0.000 -42209.97 -19166.58
_cons | 101307.5 3093.027 32.75 0.000 95192.43 107422.6
------------------------------------------------------------------------------
.
. reg lrprice nearinc if year==1981 //Model Log

Source | SS df MS Number of obs = 142


-------------+---------------------------------- F(1, 140) = 38.85
Model | 4.65649138 1 4.65649138 Prob > F = 0.0000
Residual | 16.7808611 140 .119863293 R-squared = 0.2172
-------------+---------------------------------- Adj R-squared = 0.2116
Total | 21.4373524 141 .152037961 Root MSE = .34621

------------------------------------------------------------------------------
lrprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
nearinc | -.4025719 .0645888 -6.23 0.000 -.5302675 -.2748764
_cons | 11.47852 .0342802 334.84 0.000 11.41074 11.54629
------------------------------------------------------------------------------

.
. *[2] Regresi Tahun 1978 (DepVar = rprice, harga riil)
.
. reg rprice nearinc if year==1978

Source | SS df MS Number of obs = 179


-------------+---------------------------------- F(1, 177) = 15.74
Model | 1.3636e+10 1 1.3636e+10 Prob > F = 0.0001
Residual | 1.5332e+11 177 866239953 R-squared = 0.0817
-------------+---------------------------------- Adj R-squared = 0.0765
Total | 1.6696e+11 178 937979126 Root MSE = 29432

------------------------------------------------------------------------------
rprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
nearinc | -18824.37 4744.594 -3.97 0.000 -28187.62 -9461.117
_cons | 82517.23 2653.79 31.09 0.000 77280.09 87754.37
------------------------------------------------------------------------------

.
. reg lrprice nearinc if year==1978 //Model Log

Source | SS df MS Number of obs = 179


-------------+---------------------------------- F(1, 177) = 40.31
Model | 4.44632519 1 4.44632519 Prob > F = 0.0000
Residual | 19.5249099 177 .110310226 R-squared = 0.1855
-------------+---------------------------------- Adj R-squared = 0.1809
Total | 23.9712351 178 .13466986 Root MSE = .33213

------------------------------------------------------------------------------
lrprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
nearinc | -.339923 .0535412 -6.35 0.000 -.4455842 -.2342618
_cons | 11.28542 .0299471 376.84 0.000 11.22632 11.34452
------------------------------------------------------------------------------

.
. *[3] Estimasi DID
. *Membandingkan perubahan kelompok antar waktu
. *Model rprice nearinc y81 nearinc.y81
. reg rprice nearinc##year

Source | SS df MS Number of obs = 321


-------------+---------------------------------- F(3, 317) = 22.25
Model | 6.1055e+10 3 2.0352e+10 Prob > F = 0.0000
Residual | 2.8994e+11 317 914632739 R-squared = 0.1739
-------------+---------------------------------- Adj R-squared = 0.1661
Total | 3.5099e+11 320 1.0969e+09 Root MSE = 30243

------------------------------------------------------------------------------
rprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
1.nearinc | -18824.37 4875.322 -3.86 0.000 -28416.45 -9232.293
|
year |
1981 | 18790.29 4050.065 4.64 0.000 10821.88 26758.69
|
nearinc#year |
1 1981 | -11863.9 7456.646 -1.59 0.113 -26534.67 2806.867
|
_cons | 82517.23 2726.91 30.26 0.000 77152.1 87882.36
------------------------------------------------------------------------------

. reg rprice i.nearinc##i.year

Source | SS df MS Number of obs = 321


-------------+---------------------------------- F(3, 317) = 22.25
Model | 6.1055e+10 3 2.0352e+10 Prob > F = 0.0000
Residual | 2.8994e+11 317 914632739 R-squared = 0.1739
-------------+---------------------------------- Adj R-squared = 0.1661
Total | 3.5099e+11 320 1.0969e+09 Root MSE = 30243

------------------------------------------------------------------------------
rprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
1.nearinc | -18824.37 4875.322 -3.86 0.000 -28416.45 -9232.293
|
year |
1981 | 18790.29 4050.065 4.64 0.000 10821.88 26758.69
|
nearinc#year |
1 1981 | -11863.9 7456.646 -1.59 0.113 -26534.67 2806.867
|
_cons | 82517.23 2726.91 30.26 0.000 77152.1 87882.36
------------------------------------------------------------------------------

. reg lrprice i.nearinc##i.year

Source | SS df MS Number of obs = 321


-------------+---------------------------------- F(3, 317) = 34.47
Model | 11.8433724 3 3.94779079 Prob > F = 0.0000
Residual | 36.305771 317 .114529246 R-squared = 0.2460
-------------+---------------------------------- Adj R-squared = 0.2388
Total | 48.1491434 320 .150466073 Root MSE = .33842

------------------------------------------------------------------------------
lrprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
1.nearinc | -.339923 .0545555 -6.23 0.000 -.4472595 -.2325865
|
year |
1981 | .1930937 .0453207 4.26 0.000 .1039263 .2822611
|
nearinc#year |
1 1981 | -.0626489 .0834408 -0.75 0.453 -.2268166 .1015188
|
_cons | 11.28542 .0305145 369.84 0.000 11.22539 11.34546
------------------------------------------------------------------------------
.
. //output menghasilkan SE yang besar, maka perlu dimasukkan variabel kontrol
.
. reg rprice i.nearinc##i.year c.age##c.agesq //misalnya ditambahkan variabel age

Source | SS df MS Number of obs = 321


-------------+---------------------------------- F(6, 314) = 40.58
Model | 1.5329e+11 6 2.5548e+10 Prob > F = 0.0000
Residual | 1.9771e+11 314 629637614 R-squared = 0.4367
-------------+---------------------------------- Adj R-squared = 0.4260
Total | 3.5099e+11 320 1.0969e+09 Root MSE = 25093
-------------------------------------------------------------------------------
rprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
--------------+----------------------------------------------------------------
1.nearinc | 11843.02 4777.963 2.48 0.014 2442.153 21243.89
|
year |
1981 | 20987.75 3384.191 6.20 0.000 14329.2 27646.31
|
nearinc#year |
1 1981 | -23178.82 6257.73 -3.70 0.000 -35491.2 -10866.44
|
age | -2173.031 232.087 -9.36 0.000 -2629.673 -1716.389
agesq | 22.57727 4.027695 5.61 0.000 14.65259 30.50195
|
c.age#c.agesq | -.0583595 .0165613 -3.52 0.000 -.0909447 -.0257743
|
_cons | 91511.19 2459.347 37.21 0.000 86672.31 96350.07
-------------------------------------------------------------------------------

.
. reg rprice i.nearinc##i.year c.age##c.agesq area land rooms baths intst cbd wind i.nbh
//atau variabel kontrol lainnya

Source | SS df MS Number of obs = 321


-------------+---------------------------------- F(19, 301) = 32.36
Model | 2.3563e+11 19 1.2402e+10 Prob > F = 0.0000
Residual | 1.1536e+11 301 383271472 R-squared = 0.6713
-------------+---------------------------------- Adj R-squared = 0.6506
Total | 3.5099e+11 320 1.0969e+09 Root MSE = 19577

-------------------------------------------------------------------------------
rprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
--------------+----------------------------------------------------------------
1.nearinc | 10655.11 5382.627 1.98 0.049 62.76087 21247.45
|
year |
1981 | 13187.68 2831.625 4.66 0.000 7615.39 18759.97
|
nearinc#year |
1 1981 | -12472.91 5099.245 -2.45 0.015 -22507.6 -2438.23
|
age | -647.5491 252.6707 -2.56 0.011 -1144.774 -150.3244
agesq | 2.746347 3.841339 0.71 0.475 -4.812933 10.30563
|
c.age#c.agesq | .001157 .0146948 0.08 0.937 -.0277606 .0300747
|
area | 17.6028 2.365126 7.44 0.000 12.94853 22.25708
land | .1449386 .0326103 4.44 0.000 .0807656 .2091115
rooms | 3502.233 1707.581 2.05 0.041 141.9249 6862.541
baths | 7730.414 2739.51 2.82 0.005 2339.396 13121.43
intst | -.8530441 1.038181 -0.82 0.412 -2.896057 1.189969
cbd | .843724 1.035528 0.81 0.416 -1.194066 2.881514
wind | -679.2488 1055.407 -0.64 0.520 -2756.159 1397.661
|
nbh |
1 | -4691.575 6308.943 -0.74 0.458 -17106.8 7723.647
2 | -5929.895 3883.013 -1.53 0.128 -13571.18 1711.395
3 | -15363.19 8545.092 -1.80 0.073 -32178.88 1452.494
4 | -8520.449 4781.474 -1.78 0.076 -17929.8 888.9002
5 | -9521.168 5902.322 -1.61 0.108 -21136.21 2093.873
6 | -4834.704 5603.205 -0.86 0.389 -15861.12 6191.712
|
_cons | 9839.861 13095.9 0.75 0.453 -15931.25 35610.97
-------------------------------------------------------------------------------

. reg lrprice i.nearinc##i.year c.age##c.agesq area land rooms baths intst cbd wind i.nbh
//atau variabel kontrol lainnya
Source | SS df MS Number of obs = 321
-------------+---------------------------------- F(19, 301) = 44.26
Model | 35.4578461 19 1.86620243 Prob > F = 0.0000
Residual | 12.6912972 301 .042163778 R-squared = 0.7364
-------------+---------------------------------- Adj R-squared = 0.7198
Total | 48.1491434 320 .150466073 Root MSE = .20534

-------------------------------------------------------------------------------
lrprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
--------------+----------------------------------------------------------------
1.nearinc | .0143573 .0564561 0.25 0.799 -.0967413 .125456
|
year |
1981 | .1348931 .0296997 4.54 0.000 .0764478 .1933385
|
nearinc#year |
1 1981 | -.0779958 .0534838 -1.46 0.146 -.1832454 .0272537
|
age | -.0061328 .0026502 -2.31 0.021 -.011348 -.0009177
agesq | 1.43e-06 .0000403 0.04 0.972 -.0000779 .0000807
|
c.age#c.agesq | 1.26e-07 1.54e-07 0.82 0.414 -1.77e-07 4.29e-07
|
area | .0001792 .0000248 7.23 0.000 .0001304 .000228
land | 8.97e-07 3.42e-07 2.62 0.009 2.24e-07 1.57e-06
rooms | .0549722 .0179101 3.07 0.002 .0197274 .0902171
baths | .1157678 .0287336 4.03 0.000 .0592237 .1723119
intst | -8.45e-06 .0000109 -0.78 0.438 -.0000299 .000013
cbd | 9.66e-06 .0000109 0.89 0.374 -.0000117 .000031
wind | -.0043641 .0110697 -0.39 0.694 -.0261479 .0174197
|
nbh |
1 | -.0171971 .0661718 -0.26 0.795 -.1474151 .1130209
2 | -.0384735 .0407273 -0.94 0.346 -.1186197 .0416728
3 | -.1905615 .0896258 -2.13 0.034 -.3669341 -.0141889
4 | -.0501109 .0501508 -1.00 0.318 -.1488016 .0485798
5 | -.0809959 .061907 -1.31 0.192 -.2028212 .0408293
6 | -.0363738 .0587696 -0.62 0.536 -.1520252 .0792776
|
_cons | 10.29594 .1373573 74.96 0.000 10.02564 10.56625
-------------------------------------------------------------------------------

.
. //hedonic pricing model untuk estimasi harga rumah
. reg rprice area land rooms baths intst cbd wind i.nbh

Source | SS df MS Number of obs = 321


-------------+---------------------------------- F(13, 307) = 36.19
Model | 2.1239e+11 13 1.6337e+10 Prob > F = 0.0000
Residual | 1.3861e+11 307 451485398 R-squared = 0.6051
-------------+---------------------------------- Adj R-squared = 0.5884
Total | 3.5099e+11 320 1.0969e+09 Root MSE = 21248

------------------------------------------------------------------------------
rprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
area | 17.26673 2.433496 7.10 0.000 12.47829 22.05518
land | .1095755 .0349666 3.13 0.002 .040771 .17838
rooms | 1624.329 1738.399 0.93 0.351 -1796.356 5045.014
baths | 15147.82 2413.832 6.28 0.000 10398.07 19897.57
intst | -.9105435 1.081437 -0.84 0.400 -3.03851 1.217423
cbd | 1.087156 1.024018 1.06 0.289 -.9278257 3.102138
wind | -330.0852 1113.536 -0.30 0.767 -2521.213 1861.043
|
nbh |
1 | -5275.766 6799.603 -0.78 0.438 -18655.49 8103.956
2 | -9839.738 4131.981 -2.38 0.018 -17970.32 -1709.151
3 | -19193.81 9097.019 -2.11 0.036 -37094.21 -1293.414
4 | -12874.77 4421.555 -2.91 0.004 -21575.15 -4174.379
5 | -14033.86 6222.559 -2.26 0.025 -26278.12 -1789.598
6 | -7085.542 6024.045 -1.18 0.240 -18939.18 4768.1
|
_cons | 3535.701 10512.53 0.34 0.737 -17150.03 24221.43
------------------------------------------------------------------------------

.
. *[4] Correlated Standard Errors (SE) --> untuk memperoleh SE yang efisien bisa menggunakan vce
atau robust
. //reg rprice i.nearinc##i.year c.age##c.agesq area land rooms baths intst cbd wind
i.nbh vce(cluster clustervar) //atau
. reg rprice i.nearinc##i.year c.age##c.agesq area land rooms baths intst cbd wind i.nbh,
robust

Linear regression Number of obs = 321


F(19, 301) = 44.92
Prob > F = 0.0000
R-squared = 0.6713
Root MSE = 19577

-------------------------------------------------------------------------------
| Robust
rprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]
--------------+----------------------------------------------------------------
1.nearinc | 10655.11 8326.413 1.28 0.202 -5730.247 27040.46
|
year |
1981 | 13187.68 2504.562 5.27 0.000 8259.009 18116.35
|
nearinc#year |
1 1981 | -12472.91 6503.827 -1.92 0.056 -25271.64 325.8155
|
age | -647.5491 323.7681 -2.00 0.046 -1284.685 -10.41338
agesq | 2.746347 4.467046 0.61 0.539 -6.044249 11.53694
|
c.age#c.agesq | .001157 .0161684 0.07 0.943 -.0306604 .0329745
|
area | 17.6028 4.183638 4.21 0.000 9.36992 25.83569
land | .1449386 .1235781 1.17 0.242 -.0982479 .388125
rooms | 3502.233 1421.758 2.46 0.014 704.3893 6300.077
baths | 7730.414 3446.629 2.24 0.026 947.8743 14512.95
intst | -.8530441 .8546723 -1.00 0.319 -2.534934 .8288455
cbd | .843724 .8100605 1.04 0.298 -.750375 2.437823
wind | -679.2488 912.9233 -0.74 0.457 -2475.769 1117.271
|
nbh |
1 | -4691.575 9248.889 -0.51 0.612 -22892.25 13509.1
2 | -5929.895 2812.614 -2.11 0.036 -11464.77 -395.0181
3 | -15363.19 4804.306 -3.20 0.002 -24817.47 -5908.91
4 | -8520.449 5240.358 -1.63 0.105 -18832.83 1791.928
5 | -9521.168 4024.009 -2.37 0.019 -17439.92 -1602.415
6 | -4834.704 5156.213 -0.94 0.349 -14981.49 5312.087
|
_cons | 9839.861 12799.13 0.77 0.443 -15347.25 35026.97
-------------------------------------------------------------------------------

.
. save "C:\Users\HP\Google Drive\Materi Kuliah\Semester III\Evaluasi Dampak\Pak Gilang\data\Kuliah
5\KIELMC.dta", replace
file C:\Users\HP\Google Drive\Materi Kuliah\Semester III\Evaluasi Dampak\Pak Gilang\data\Kuliah
5\KIELMC.dta saved

.
end of do-file.

Das könnte Ihnen auch gefallen