Ekonometrika 2 Program S1 Ilmu Ekonomi FEUI Maret 2012 Lab ke-4 Analisis Time Series 2 SOAL A
Gunakan data PHILLIPS.dat PHILLIPS.dat dengan deskripsi variable di PHILLIPS.txt. PHILLIPS.txt. .
use “http://fmwww.bc.edu/ec-p/data/wooldridge/PHILLIPS.dta ”
. *Lakukan set time data terlebih dahulu series . tsset year time variable: year, 1948 to 1996 delta: 1 unit
sebelum
melakukan
estimasi
times
Lakukan pengujian apakah terdapat serial correlation pada masing – masing masing model di bawah ini (i) model statis statis kurva Phllips (1) inf t t =b0+b1unemt +ut (1)
. quietly reg inf unem . dwstat Durbin-Watson d-statistic(
2,
49) =
.8027005
. bgodfrey Breusch-Godfrey LM test for autocorrelation --------------------------------------------------------------------------lags(p) | chi2 df Prob > chi2 -------------+------------------------------------------------------------1 | 18.472 1 0.0000 --------------------------------------------------------------------------H0: no serial correlation . predict u1, resid . reg u1 L.u1 Source | SS df MS -------------+------------------------------------------+-----------------------------Model | 150.91704 1 150.91704 Residual | 285.198412 46 6.19996547 -------------+------------------------------------------+----------------------------Total | 436.115452 47 9.27905217
Number of obs F( 1, 46) 46) Prob > F R-squared Adj R-squared Root MSE
= = = = = =
48 24.34 0.0000 0.3460 0.3318 2.49
---------------------------------------------------------------------------------------------------------------------------------------------------------u1 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+------------------------------------------------------+-----------------------------------------------------------------------------------u1 |
[email protected] || http://www.scribd.com/akbar_suwardi ||
1
L1. | .5729695 .1161334 4.93 0.000 .3392052 .8067338 | _cons | -.1133967 .359404 -0.32 0.754 -.8368393 .610046 ---------------------------------------------------------------------------------------------------------------------------------------------------------
(ii)
dinamik kurva Phillips-1 (kurva Philips dengan asumsi angka pengangguran alamiah konstan) (2) cinf=d 0+d 1unem+e (2)
. quietly reg cinf unem . dwstat Durbin-Watson d-statistic( . bgodfrey
2,
48) =
1.769648
Breusch-Godfrey LM test for autocorrelation --------------------------------------------------------------------------lags(p) | chi2 df Prob > chi2 -------------+------------------------------------------------------------1 | 0.062 1 0.8039 --------------------------------------------------------------------------H0: no serial correlation . predict u2, resid (1 missing value generated) . reg u2 L.u2 Source | SS df MS -------------+------------------------------------------+-----------------------------Model | .350023904 1 .350023904 Residual | 190.837373 45 4.24083051 -------------+------------------------------------------+----------------------------Total | 191.187397 46 4.15624776
Number of obs F( 1, 45) Prob > F R-squared Adj R-squared Root MSE
= 47 = 0.08 = 0.7752 = 0.0018 = -0.0204 = 2.0593
---------------------------------------------------------------------------------------------------------------------------------------------------------u2 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+------------------------------------------------------+-----------------------------------------------------------------------------------u2 | L1. | -.0355928 .1238908 -0.29 0.775 -.2851216 .213936 | _cons | .1941655 .3003839 0.65 0.521 -.4108387 .7991698 ---------------------------------------------------------------------------------------------------------------------------------------------------------
(iii) dinamik kurva Phillips-2 (kurva Philips dengan asumsi angka pengangguran merupakan fungsi dari angka pengangguran pada periode sebelumnya) (3) cinf=q0+q1cunem+e (3) . quietly reg cinf cunem . dwstat Durbin-Watson d-statistic(
2,
48) =
1.849401
. bgodfrey
[email protected] || http://www.scribd.com/akbar_suwardi ||
2
Breusch-Godfrey LM test for autocorrelation --------------------------------------------------------------------------lags(p) | chi2 df Prob > chi2 -------------+------------------------------------------------------------1 | 0.042 1 0.8385 --------------------------------------------------------------------------H0: no serial correlation . predict u3, resid (1 missing value generated) . reg u3 L.u3 Source | SS df MS -------------+------------------------------------------+-----------------------------Model | .215297942 1 .215297942 Residual | 210.917548 45 4.68705663 -------------+------------------------------------------+----------------------------Total | 211.132846 46 4.58984449
Number of obs F( 1, 45) Prob > F R-squared Adj R-squared Root MSE
= 47 = 0.05 = 0.8313 = 0.0010 = -0.0212 = 2.165
---------------------------------------------------------------------------------------------------------------------------------------------------------u3 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+------------------------------------------------------+-----------------------------------------------------------------------------------u3 | L1. | -.0283512 .1322822 -0.21 0.831 -.2947812 .2380788 | _cons | .1585139 .3157922 0.50 0.618 -.4775242 .794552 ---------------------------------------------------------------------------------------------------------------------------------------------------------
Bandingkan hasil pengujian dari ketiga model di atas, dan beri analisis anda tentang persamaan dan/atau perbedaan hasil pengujian di atas. . quietly reg inf unem . estimates store inf . quietly reg cinf unem . estimates store cinf . quietly reg cinf cunem . estimates store cinf2 . estimates table inf cinf cinf2 , stat(N r2 r2_a aic bic) stfmt(%7.4g) star(0.1 0.05 0.01)
b(%7.4f)
----------------------------------------------------Variable | inf cinf cinf2 -------------+--------------------------------------unem | 0.4676 -0.5426** cunem | -0.8422** _cons | 1.4236 3.0306** -0.0782 -------------+--------------------------------------N | 49 48 48 r2 | .05272 .1078 .135 r2_a | .03257 .0884 .1162 aic | 252.9 224.2 222.7 bic | 256.6 228 226.5 ----------------------------------------------------legend: * p<.1; ** p<.05; *** p<.01
Lakukan pengujian Unit Root untuk mendeteksi stationaritas data inflasi dan data pengangguran dengan menggunakan regresi ADF
[email protected] || http://www.scribd.com/akbar_suwardi ||
3
model. Beri intrepretasi terhadap hasil pengujian anda!. Berdasarkan hasil pengujian ini, apakah anda mendeteksi adanya regresi palsu (spurious regression)? . * Lakukan pengujian Unit Root untuk mendeteksi stationaritas data inflasi dan data pengangguran dengan menggunakan regresi ADF . dfuller inf, regres trend Dickey-Fuller test for unit root
Number of obs
=
48
---------- Interpolated Dickey-Fuller --------Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value --------------------------------------------------------------------------------------------------------------------------------------------------------Z(t) -3.449 -4.168 -3.508 -3.185 --------------------------------------------------------------------------------------------------------------------------------------------------------MacKinnon approximate p-value for Z(t) = 0.0452 --------------------------------------------------------------------------------------------------------------------------------------------------------D.inf | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+------------------------------------------------------+-----------------------------------------------------------------------------------inf | L1. | -.3856691 .1118259 -3.45 0.001 -.6108981 -.1604402 _trend | .0362198 .0256589 1.41 0.165 -.0154598 .0878995 _cons | .5996598 .7310425 0.82 0.416 -.8727353 2.072055 --------------------------------------------------------------------------------------------------------------------------------------------------------. dfuller unem, regres trend Dickey-Fuller test for unit root
Number of obs
=
48
---------- Interpolated Dickey-Fuller --------Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value --------------------------------------------------------------------------------------------------------------------------------------------------------Z(t) -2.993 -4.168 -3.508 -3.185 --------------------------------------------------------------------------------------------------------------------------------------------------------MacKinnon approximate p-value for Z(t) = 0.1340 --------------------------------------------------------------------------------------------------------------------------------------------------------D.unem | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------unem | L1. | -.3507138 .1171655 -2.99 0.004 -.5866972 -.1147303 _trend | .0164492 .0132111 1.25 0.220 -.0101593 .0430576 _cons | 1.646202 .5768054 2.85 0.007 .4844567 2.807948 --------------------------------------------------------------------------------------------------------------------------------------------------------. * kesimpulannya: data inflasi dan data pengangguran tidak stasioner . * uji spurious regression . quietly reg inf unem . predict error, resid . dfuller error, regres trend Dickey-Fuller test for unit root Test
Number of obs
=
48
---------- Interpolated Dickey-Fuller --------1% Critical 5% Critical 10% Critical
[email protected] || http://www.scribd.com/akbar_suwardi ||
4
Statistic Value Value Value --------------------------------------------------------------------------------------------------------------------------------------------------------Z(t) -3.846 -4.168 -3.508 -3.185 --------------------------------------------------------------------------------------------------------------------------------------------------------MacKinnon approximate p-value for Z(t) = 0.0144 --------------------------------------------------------------------------------------------------------------------------------------------------------D.error | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+------------------------------------------------------+-----------------------------------------------------------------------------------error | L1. | -.4539094 .1180233 -3.85 0.000 -.6916206 -.2161982 _trend | .0304812 .026365 1.16 0.254 -.0226207 .0835831 _cons | -.8596548 .7381616 -1.16 0.250 -2.346388 .627079 --------------------------------------------------------------------------------------------------------------------------------------------------------. * kesimpulannya: tidak spurious regression atau nenilkik kointergarsi karen nilai error stasioner
SOAL B
Gunakan data Okun.dta .
use “http://fmwww.bc.edu/ec-p/data/wooldridge/okun.dta ”
. *Lakukan set time data terlebih dahulu sebelum melakukan estimasi times series . tsset year time variable: year, 1959 to 2005 delta: 1 unit
. reg
Estimasi persamaan persamaan di bawah ini dengan metode OLS pcrgdpt =b0+b1 ∆unemt +ut
(4)
pcrgdp cunem
Source | SS df MS -------------+------------------------------------------+-----------------------------Model | 131.353664 1 131.353664 Residual | 53.5559029 44 1.21717961 -------------+------------------------------------------+----------------------------Total | 184.909567 45 4.10910148
Number of obs F( 1, 44) Prob > F R-squared Adj R-squared Root MSE
= = = = = =
46 107.92 0.0000 0.7104 0.7038 1.1033
---------------------------------------------------------------------------------------------------------------------------------------------------------pcrgdp | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+-------------------------------------------------------+----------------------------------------------------------------------------------cunem | -1.890915 .1820239 -10.39 0.000 -2.25776 -1.52407 _cons | 3.344427 .1626743 20.56 0.000 3.016578 3.672275 ------------------------------------------------------------------------------
Lakukan pengujian pengujian AR (1) serial serial correlation dan berikan interpretasi interpretasi anda terhadap hasil pengujian ini dan dikaitkan dengan estimasi parameter persamaan (4).
. quietly reg
pcrgdp cunem
[email protected] || http://www.scribd.com/akbar_suwardi ||
5
. dwstat Durbin-Watson d-statistic(
2,
46) =
1.856618
. bgodfrey Breusch-Godfrey LM test for autocorrelation --------------------------------------------------------------------------lags(p) | chi2 df Prob > chi2 -------------+------------------------------------------------------------1 | 0.193 1 0.6601 --------------------------------------------------------------------------H0: no serial correlation . predict error, resid (1 missing value generated) . reg error L.error Source | SS df MS -------------+------------------------------------------+-----------------------------Model | .177626827 1 .177626827 Residual | 52.6493732 43 1.22440403 -------------+------------------------------------------+----------------------------Total | 52.827 44 1.20061364
Number of obs F( 1, 43) Prob > F R-squared Adj R-squared Root MSE
= 45 = 0.15 = 0.7052 = 0.0034 = -0.0198 = 1.1065
---------------------------------------------------------------------------------------------------------------------------------------------------------error | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------error | L1. | .0580417 .1523871 0.38 0.705 -.2492761 .3653595 | _cons | .0176032 .1649796 0.11 0.916 -.31511 .3503163 ------------------------------------------------------------------------------
2
Hitung residual dari hasil estimasi di atas dan pangkatkan 2 (ût ) dan lakukan pengujian untuk mendeteksi masalah heterokedastisitas 2 dengan Breusch-Pagan test (run ût terhadap ∆unemt ) dan berikan interprerasi anda
. gen error2 = error^2 (1 missing value generated) . reg error2 cunem Source | SS df MS -------------+------------------------------------------+-----------------------------Model | 7.50942413 1 7.50942413 Residual | 77.3669243 44 1.75833919 -------------+------------------------------------------+----------------------------Total | 84.8763484 45 1.88614108
Number of obs F( 1, 44) Prob > F R-squared Adj R-squared Root MSE
= = = = = =
46 4.27 0.0447 0.0885 0.0678 1.326
---------------------------------------------------------------------------------------------------------------------------------------------------------error2 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------cunem | .4521206 .2187773 2.07 0.045 .0112039 .8930373 _cons | 1.16819 .1955208 5.97 0.000 .774144 1.562237 --------------------------------------------------------------------------------------------------------------------------------------------------------. quietly reg pcrgdp cunem
[email protected] || http://www.scribd.com/akbar_suwardi ||
6
. hettest Breusch-Pagan / Cook-Weisberg test for heteroskedasticity Ho: Constant variance Variables: fitted values of pcrgdp chi2(1) Prob > chi2
= =
2.77 0.0960
Estimasi kembali persaman persaman (4) dengan dengan menggunakan metode WLS WLS dan bandingkan hasil regresinya dengan hasil regresi dengan metode OLS, berikan analisis anda dikaitkan dengan pengujian untuk mendeteksi masalah heteroskedastis di atas.
. reg pcrgdp cunem [w=error2] (analytic weights assumed) (sum of wgt is 5.3556e+01) Source | SS df MS -------------+------------------------------------------+-----------------------------Model | 153.069146 1 153.069146 Residual | 125.24728 44 2.84652908 -------------+------------------------------------------+----------------------------Total | 278.316426 45 6.18480946
Number of obs F( 1, 44) Prob > F R-squared Adj R-squared Root MSE
= = = = = =
46 53.77 0.0000 0.5500 0.5398 1.6872
---------------------------------------------------------------------------------------------------------------------------------------------------------pcrgdp | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+-------------------------------------------------------+----------------------------------------------------------------------------------cunem | -1.740022 .2372842 -7.33 0.000 -2.218237 -1.261807 _cons | 3.334796 .2588378 12.88 0.000 2.813143 3.856449 --------------------------------------------------------------------------------------------------------------------------------------------------------. hettest Breusch-Pagan / Cook-Weisberg test for heteroskedasticity Ho: Constant variance Variables: fitted values of pcrgdp chi2(1) Prob > chi2
= =
0.08 0.7808
[email protected] || http://www.scribd.com/akbar_suwardi ||
7