seriesdetiempo.files.wordpress.com€¦  · Web viewname: log: C:\data\poe4stata\chap09.log. log...

32
--------------------------------------------------------------------------------------------------------------------------------- name: <unnamed> log: C:\data\poe4stata\chap09.log log type: text opened on: 29 Oct 2012, 12:57:22 . * file chap09.do for Using Stata for Principles of Econometrics, 4e . . ** cd c:\data\poe4stata . . * Stata Do-file . * copyright C 2011 by Lee C. Adkins and R. Carter Hill . * used for "Using Stata for Principles of Econometrics, 4e" . * by Lee C. Adkins and R. Carter Hill (2011) . * John Wiley and Sons, Inc. . . * setup . * version 11.1 . * capture log close . set more off . . * dates . clear . set obs 100 obs was 0, now 100 . generate date = tq(1961q1) + _n-1 . list date in 1/5 +------+ | date | |------| 1. | 4 | 2. | 5 | 3. | 6 | 4. | 7 | 5. | 8 | +------+ . format %tq date . list date in 1/5 +--------+ | date | |--------| 1. | 1961q1 | 2. | 1961q2 | 3. | 1961q3 | 4. | 1961q4 | 5. | 1962q1 | +--------+ . tsset date time variable: date, 1961q1 to 1985q4 delta: 1 quarter . save new.dta, replace file new.dta saved . . use "C:\data\poe4stata\okun.dta", clear . generate date = tq(1985q2) + _n-1 . list date in 1 +------+ | date | |------| 1. | 101 | +------+ . . format %tq date . list date in 1 +--------+ | date | |--------| 1. | 1985q2 |

Transcript of seriesdetiempo.files.wordpress.com€¦  · Web viewname: log: C:\data\poe4stata\chap09.log. log...

Page 1: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

--------------------------------------------------------------------------------------------------------------------------------- name: <unnamed> log: C:\data\poe4stata\chap09.log log type: text opened on: 29 Oct 2012, 12:57:22

. * file chap09.do for Using Stata for Principles of Econometrics, 4e

.

. ** cd c:\data\poe4stata

.

. * Stata Do-file

. * copyright C 2011 by Lee C. Adkins and R. Carter Hill

. * used for "Using Stata for Principles of Econometrics, 4e"

. * by Lee C. Adkins and R. Carter Hill (2011)

. * John Wiley and Sons, Inc.

.

. * setup

. * version 11.1

. * capture log close

. set more off

.

. * dates

. clear

. set obs 100obs was 0, now 100

. generate date = tq(1961q1) + _n-1

. list date in 1/5

+------+ | date | |------| 1. | 4 | 2. | 5 | 3. | 6 | 4. | 7 | 5. | 8 | +------+

. format %tq date

. list date in 1/5

+--------+ | date | |--------| 1. | 1961q1 | 2. | 1961q2 | 3. | 1961q3 | 4. | 1961q4 | 5. | 1962q1 | +--------+

. tsset date time variable: date, 1961q1 to 1985q4 delta: 1 quarter

. save new.dta, replacefile new.dta saved

.

. use "C:\data\poe4stata\okun.dta", clear

. generate date = tq(1985q2) + _n-1

. list date in 1

+------+ | date | |------| 1. | 101 | +------+

.

. format %tq date

. list date in 1

+--------+ | date | |--------| 1. | 1985q2 | +--------+

.

. tsset date time variable: date, 1985q2 to 2009q3 delta: 1 quarter

.

. label var u "% Unemployed"

. label var g "% GDP growth"

. tsline u g, lpattern(solid dash) saving("C:\data\g9_1.gph",replace)(file C:\data\g9_1.gph saved)

.

. list date u L.u D.u g L1.g L2.g L3.g in 1/5

Page 2: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

+--------------------------------------------------+ | L. D. L. L2. L3.| | date u u u g g g g | |--------------------------------------------------| 1. | 1985q2 7.3 . . 1.4 . . . | 2. | 1985q3 7.2 7.3 -.1 2 1.4 . . | 3. | 1985q4 7 7.2 -.2 1.4 2 1.4 . | 4. | 1986q1 7 7 0 1.5 1.4 2 1.4 | 5. | 1986q2 7.2 7 .2 .9 1.5 1.4 2 | +--------------------------------------------------+

. list date u L.u D.u g L1.g L2.g L3.g in 96/98

+------------------------------------------------------+ | L. D. L. L2. L3.| | date u u u g g g g | |------------------------------------------------------| 96. | 2009q1 8.1 6.9 1.2 -1.2 -1.4 .3 .9 | 97. | 2009q2 9.3 8.1 1.2 -.2 -1.2 -1.4 .3 | 98. | 2009q3 9.6 9.3 .3 .8 -.2 -1.2 -1.4 | +------------------------------------------------------+

.

. regress D.u L(0/3).g

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 4, 90) = 42.23 Model | 5.13367789 4 1.28341947 Prob > F = 0.0000 Residual | 2.73516422 90 .030390714 R-squared = 0.6524-------------+------------------------------ Adj R-squared = 0.6370 Total | 7.86884211 94 .083711086 Root MSE = .17433

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | --. | -.2020526 .0330131 -6.12 0.000 -.267639 -.1364663 L1. | -.1645352 .0358175 -4.59 0.000 -.2356929 -.0933774 L2. | -.071556 .0353043 -2.03 0.046 -.1416941 -.0014179 L3. | .003303 .0362603 0.09 0.928 -.0687345 .0753405 | _cons | .5809746 .0538893 10.78 0.000 .4739142 .688035------------------------------------------------------------------------------

. regress D.u L(0/2).g

Source | SS df MS Number of obs = 96-------------+------------------------------ F( 3, 92) = 57.95 Model | 5.17925206 3 1.72641735 Prob > F = 0.0000 Residual | 2.74074794 92 .029790739 R-squared = 0.6539-------------+------------------------------ Adj R-squared = 0.6427 Total | 7.92 95 .083368421 Root MSE = .1726

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | --. | -.2020216 .0323832 -6.24 0.000 -.2663374 -.1377059 L1. | -.1653269 .0335368 -4.93 0.000 -.2319339 -.0987198 L2. | -.0700135 .0331 -2.12 0.037 -.1357529 -.0042741 | _cons | .5835561 .0472119 12.36 0.000 .4897892 .6773231------------------------------------------------------------------------------

.

. summarize g

Variable | Obs Mean Std. Dev. Min Max-------------+-------------------------------------------------------- g | 98 1.276531 .6469279 -1.4 2.5

. return list

scalars: r(N) = 98 r(sum_w) = 98 r(mean) = 1.276530612244898 r(Var) = .4185156743109615 r(sd) = .6469278741180978 r(min) = -1.4 r(max) = 2.5 r(sum) = 125.1

.

. scatter g L.g, xline(`r(mean)') yline(`r(mean)') saving("C:\data\g9_2.gph",replace)(note: file C:\data\g9_2.gph not found)(file C:\data\g9_2.gph saved)

. ac g, lags(12) generate(ac_g) saving("C:\data\g9_3.gph",replace)(note: file C:\data\g9_3.gph not found)(file C:\data\g9_3.gph saved)

.

. * approximate z scores

. gen z=sqrt(e(N))*ac_g(86 missing values generated)

. list ac_g z in 1/12

+------------------------+ | ac_g z |

Page 3: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

|------------------------| 1. | .49425676 4.842708 | 2. | .4107073 4.024093 | 3. | .1544205 1.513006 | 4. | .20043788 1.963882 | 5. | .09038538 .8855922 | |------------------------| 6. | .02447111 .239767 | 7. | -.03008434 -.2947652 | 8. | -.08231978 -.8065658 | 9. | .04410661 .4321548 | 10. | -.02128483 -.2085479 | |------------------------| 11. | -.08683463 -.8508022 | 12. | -.20404326 -1.999207 | +------------------------+

.

. use "C:\data\poe4stata\phillips_aus.dta", clear

. generate date = tq(1987q1) + _n-1

. format %tq date

. tsset date time variable: date, 1987q1 to 2009q3 delta: 1 quarter

.

. tsline inf, saving("C:\data\g9_4.gph",replace)(note: file C:\data\g9_4.gph not found)(file C:\data\g9_4.gph saved)

. tsline D.u, saving("C:\data\g9_5.gph",replace)(note: file C:\data\g9_5.gph not found)(file C:\data\g9_5.gph saved)

.

. reg inf D.u

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 1, 88) = 5.29 Model | 2.04834633 1 2.04834633 Prob > F = 0.0238 Residual | 34.0445426 88 .386869802 R-squared = 0.0568-------------+------------------------------ Adj R-squared = 0.0460 Total | 36.0928889 89 .405538077 Root MSE = .62199

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.5278638 .2294049 -2.30 0.024 -.9837578 -.0719699 | _cons | .7776213 .0658249 11.81 0.000 .646808 .9084345------------------------------------------------------------------------------

. predict ehat, res(1 missing value generated)

.

. ac ehat, lags(12) generate(rk) saving("C:\data\g9_6.gph",replace)(note: file C:\data\g9_6.gph not found)(file C:\data\g9_6.gph saved)

. list rk in 1/5

+-----------+ | rk | |-----------| 1. | .54865864 | 2. | .45573248 | 3. | .43321579 | 4. | .42049358 | 5. | .33903419 | +-----------+

.

. * --------------------------------------------------

. * Corrgram

. * --------------------------------------------------

. corrgram ehat, lags(5)

-1 0 1 -1 0 1 LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor]-------------------------------------------------------------------------------1 0.5487 0.5498 28.006 0.0000 |---- |---- 2 0.4557 0.2297 47.548 0.0000 |--- |- 3 0.4332 0.1926 65.409 0.0000 |--- |- 4 0.4205 0.1637 82.433 0.0000 |--- |- 5 0.3390 0.0234 93.63 0.0000 |-- |

. di "rho1 = " r(ac1) " rho2 = " r(ac2) " rho3 = " r(ac3)rho1 = .54865864 rho2 = .45573248 rho3 = .43321579

. drop rk ehat

.

. * LM tests for AR(1) and AR(4) alternatives

. reg inf D.u

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 1, 88) = 5.29

Page 4: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

Model | 2.04834633 1 2.04834633 Prob > F = 0.0238 Residual | 34.0445426 88 .386869802 R-squared = 0.0568-------------+------------------------------ Adj R-squared = 0.0460 Total | 36.0928889 89 .405538077 Root MSE = .62199

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.5278638 .2294049 -2.30 0.024 -.9837578 -.0719699 | _cons | .7776213 .0658249 11.81 0.000 .646808 .9084345------------------------------------------------------------------------------

. predict ehat, res(1 missing value generated)

. regress inf D.u L.ehat

Source | SS df MS Number of obs = 89-------------+------------------------------ F( 2, 86) = 23.04 Model | 12.4139234 2 6.20696168 Prob > F = 0.0000 Residual | 23.1707957 86 .269427857 R-squared = 0.3489-------------+------------------------------ Adj R-squared = 0.3337 Total | 35.5847191 88 .404371808 Root MSE = .51906

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.6725037 .1930601 -3.48 0.001 -1.056295 -.2887129 | ehat | L1. | .5583219 .0897784 6.22 0.000 .3798484 .7367955 | _cons | .7682486 .055225 13.91 0.000 .658465 .8780322------------------------------------------------------------------------------

. test L.ehat

( 1) L.ehat = 0

F( 1, 86) = 38.67 Prob > F = 0.0000

. * LM test for AR(1)

. regress ehat D.u L.ehat

Source | SS df MS Number of obs = 89-------------+------------------------------ F( 2, 86) = 19.34 Model | 10.4203553 2 5.21017765 Prob > F = 0.0000 Residual | 23.1707955 86 .269427855 R-squared = 0.3102-------------+------------------------------ Adj R-squared = 0.2942 Total | 33.5911508 88 .381717623 Root MSE = .51906

------------------------------------------------------------------------------ ehat | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.1446399 .1930601 -0.75 0.456 -.5284307 .2391509 | ehat | L1. | .5583219 .0897784 6.22 0.000 .3798484 .7367955 | _cons | -.0093727 .055225 -0.17 0.866 -.1191563 .1004109------------------------------------------------------------------------------

. di "Observations = " e(N) " and TR2 = " e(N)*e(r2)Observations = 89 and TR2 = 27.608808

. * LM test for AR(4)

. regress ehat D.u L(1/4).ehat

Source | SS df MS Number of obs = 86-------------+------------------------------ F( 5, 80) = 10.15 Model | 12.1144592 5 2.42289184 Prob > F = 0.0000 Residual | 19.0922237 80 .238652796 R-squared = 0.3882-------------+------------------------------ Adj R-squared = 0.3500 Total | 31.2066829 85 .367137445 Root MSE = .48852

------------------------------------------------------------------------------ ehat | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.4377617 .2044826 -2.14 0.035 -.844695 -.0308285 | ehat | L1. | .2900815 .1085698 2.67 0.009 .0740207 .5061423 L2. | .1449782 .1124666 1.29 0.201 -.0788375 .3687939 L3. | .1761431 .1132363 1.56 0.124 -.0492044 .4014906 L4. | .2128763 .1101842 1.93 0.057 -.0063972 .4321498 | _cons | -.0346715 .0529554 -0.65 0.515 -.1400561 .0707131------------------------------------------------------------------------------

. di "Observations = " e(N) " and TR2 = " e(N)*e(r2)Observations = 86 and TR2 = 33.385269

. drop ehat

.

. * Using the built-in bgodfrey command to test the

Page 5: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

. * AR(1) and AR(4) alternatives

. regress inf D.u

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 1, 88) = 5.29 Model | 2.04834633 1 2.04834633 Prob > F = 0.0238 Residual | 34.0445426 88 .386869802 R-squared = 0.0568-------------+------------------------------ Adj R-squared = 0.0460 Total | 36.0928889 89 .405538077 Root MSE = .62199

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.5278638 .2294049 -2.30 0.024 -.9837578 -.0719699 | _cons | .7776213 .0658249 11.81 0.000 .646808 .9084345------------------------------------------------------------------------------

. predict ehat, res(1 missing value generated)

. estat bgodfrey, lags(1)

Breusch-Godfrey LM test for autocorrelation--------------------------------------------------------------------------- lags(p) | chi2 df Prob > chi2-------------+------------------------------------------------------------- 1 | 27.592 1 0.0000--------------------------------------------------------------------------- H0: no serial correlation

. estat bgodfrey, lags(4)

Breusch-Godfrey LM test for autocorrelation--------------------------------------------------------------------------- lags(p) | chi2 df Prob > chi2-------------+------------------------------------------------------------- 4 | 36.672 4 0.0000--------------------------------------------------------------------------- H0: no serial correlation

.

. * Replacing ehat(1) with zero and computing LM

. replace ehat = 0 in 1(1 real change made)

. regress inf D.u L.ehat

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 2, 87) = 23.01 Model | 12.4857778 2 6.24288888 Prob > F = 0.0000 Residual | 23.6071111 87 .271346105 R-squared = 0.3459-------------+------------------------------ Adj R-squared = 0.3309 Total | 36.0928889 89 .405538077 Root MSE = .52091

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.6793583 .1936707 -3.51 0.001 -1.0643 -.2944167 | ehat | L1. | .5587839 .0900967 6.20 0.000 .379707 .7378609 | _cons | .7754582 .0551288 14.07 0.000 .6658837 .8850326------------------------------------------------------------------------------

. test L.ehat

( 1) L.ehat = 0

F( 1, 87) = 38.47 Prob > F = 0.0000

. regress ehat D.u L.ehat

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 2, 87) = 19.23 Model | 10.4374315 2 5.21871576 Prob > F = 0.0000 Residual | 23.6071109 87 .271346103 R-squared = 0.3066-------------+------------------------------ Adj R-squared = 0.2906 Total | 34.0445425 89 .382522949 Root MSE = .52091

------------------------------------------------------------------------------ ehat | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.1514944 .1936707 -0.78 0.436 -.536436 .2334471 | ehat | L1. | .5587839 .0900967 6.20 0.000 .379707 .7378609 | _cons | -.0021631 .0551288 -0.04 0.969 -.1117376 .1074114------------------------------------------------------------------------------

. di "Observations = " e(N) " and TR2 = " e(N)*e(r2)Observations = 90 and TR2 = 27.592347

. drop ehat

.

Page 6: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

. * Getting Stata to use 90 observations for the LM test

. reg inf D.u

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 1, 88) = 5.29 Model | 2.04834633 1 2.04834633 Prob > F = 0.0238 Residual | 34.0445426 88 .386869802 R-squared = 0.0568-------------+------------------------------ Adj R-squared = 0.0460 Total | 36.0928889 89 .405538077 Root MSE = .62199

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.5278638 .2294049 -2.30 0.024 -.9837578 -.0719699 | _cons | .7776213 .0658249 11.81 0.000 .646808 .9084345------------------------------------------------------------------------------

. predict ehat, res(1 missing value generated)

.

. * Using all observations for bgodfrey test

. * add 3 observations to data

. set obs 94 obs was 91, now 94

. * moves missing observations to end

. gsort -date

. * creates dates for missing obs

. replace date = date[_n-1] - 1 if missing(date)(3 real changes made)

. * puts zeros in for missing ehats

. replace ehat = 0 if missing(ehat) (4 real changes made)

. * re-sort data into ascending order

. sort date

. regress ehat D.u L(1/4).ehat

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 5, 84) = 11.55 Model | 13.8719775 5 2.77439549 Prob > F = 0.0000 Residual | 20.172565 84 .240149583 R-squared = 0.4075-------------+------------------------------ Adj R-squared = 0.3722 Total | 34.0445425 89 .382522949 Root MSE = .49005

------------------------------------------------------------------------------ ehat | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.4738124 .2013712 -2.35 0.021 -.8742611 -.0733638 | ehat | L1. | .3254696 .1064382 3.06 0.003 .1138055 .5371337 L2. | .1554409 .1118058 1.39 0.168 -.0668973 .3777791 L3. | .1693923 .1128118 1.50 0.137 -.0549465 .393731 L4. | .2013609 .1099353 1.83 0.071 -.0172575 .4199793 | _cons | -.0130019 .0519579 -0.25 0.803 -.1163259 .0903222------------------------------------------------------------------------------

. di "Observations = " e(N) " and TR2 = " e(N)*e(r2)Observations = 90 and TR2 = 36.671898

.

. use "C:\data\poe4stata\phillips_aus.dta", clear

. generate date = tq(1987q1) + _n-1

. format %tq date

. tsset date time variable: date, 1987q1 to 2009q3 delta: 1 quarter

.

. scalar B = round(4*(e(N)/100)^(2/9))

. scalar list B B = 4

.

. regress inf D.u

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 1, 88) = 5.29 Model | 2.04834633 1 2.04834633 Prob > F = 0.0238 Residual | 34.0445426 88 .386869802 R-squared = 0.0568-------------+------------------------------ Adj R-squared = 0.0460 Total | 36.0928889 89 .405538077 Root MSE = .62199

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.5278638 .2294049 -2.30 0.024 -.9837578 -.0719699 |

Page 7: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

_cons | .7776213 .0658249 11.81 0.000 .646808 .9084345------------------------------------------------------------------------------

. estimates store Wrong_SE

. newey inf D.u, lag(4)

Regression with Newey-West standard errors Number of obs = 90maximum lag: 4 F( 1, 88) = 2.76 Prob > F = 0.1001

------------------------------------------------------------------------------ | Newey-West inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.5278638 .3176735 -1.66 0.100 -1.159173 .1034454 | _cons | .7776213 .1116107 6.97 0.000 .5558184 .9994242------------------------------------------------------------------------------

. estimates store HAC_4

.

. esttab Wrong_SE HAC_4, compress se(%12.3f) b(%12.5f) gaps scalars(r2_a rss aic) title("Dependent Variable: inf") mtitles("LS" "> HAC(4)")

Dependent Variable: inf------------------------------------ (1) (2) LS HAC(4) ------------------------------------D.u -0.52786* -0.52786 (0.229) (0.318)

_cons 0.77762*** 0.77762*** (0.066) (0.112) ------------------------------------N 90 90 r2_a 0.04603 rss 34.04454 aic 171.91634 . ------------------------------------Standard errors in parentheses* p<0.05, ** p<0.01, *** p<0.001

.

. * --------------------------------------------------

. * Nonlinear least squares of AR(1) regression model

. * --------------------------------------------------

.

. nl (inf = {b1}*(1-{rho}) + {b2}*D.u + {rho}*L.inf - {rho}*{b2}*(L.D.u)), variables(inf D.u L.inf L.D.u)(obs = 89)

Iteration 0: residual SS = 26.75696Iteration 1: residual SS = 23.21352Iteration 2: residual SS = 23.19868Iteration 3: residual SS = 23.19868Iteration 4: residual SS = 23.19868Iteration 5: residual SS = 23.19868

Source | SS df MS-------------+------------------------------ Number of obs = 89 Model | 12.3860433 2 6.19302165 R-squared = 0.3481 Residual | 23.1986758 86 .269752044 Adj R-squared = 0.3329-------------+------------------------------ Root MSE = .5193766 Total | 35.5847191 88 .404371808 Res. dev. = 132.9069

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- /b1 | .7608716 .1245311 6.11 0.000 .513312 1.008431 /rho | .5573922 .0901546 6.18 0.000 .3781709 .7366136 /b2 | -.694388 .247894 -2.80 0.006 -1.187185 -.201591------------------------------------------------------------------------------ Parameter b1 taken as constant term in model & ANOVA table

. * To see the coefficient legend use coeflegend option

. nl (inf = {b1}*(1-{rho}) + {b2}*D.u + {rho}*L.inf - {rho}*{b2}*(L.D.u)), variables(inf D.u L.inf L.D.u) coeflegend(obs = 89)

Iteration 0: residual SS = 26.75696Iteration 1: residual SS = 23.21352Iteration 2: residual SS = 23.19868Iteration 3: residual SS = 23.19868Iteration 4: residual SS = 23.19868Iteration 5: residual SS = 23.19868

Source | SS df MS-------------+------------------------------ Number of obs = 89 Model | 12.3860433 2 6.19302165 R-squared = 0.3481 Residual | 23.1986758 86 .269752044 Adj R-squared = 0.3329-------------+------------------------------ Root MSE = .5193766 Total | 35.5847191 88 .404371808 Res. dev. = 132.9069

------------------------------------------------------------------------------ inf | Coef. Legend-------------+---------------------------------------------------------------- /b1 | .7608716 _b[b1:_cons] /rho | .5573922 _b[rho:_cons] /b2 | -.694388 _b[b2:_cons]------------------------------------------------------------------------------

Page 8: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

Parameter b1 taken as constant term in model & ANOVA table

. scalar delta = _b[b1:_cons]*(1-_b[rho:_cons])

. scalar delta1 = - _b[rho:_cons]*_b[b2:_cons]

.

. * --------------------------------------------------

. * More general model

. * --------------------------------------------------

.

. regress inf L.inf D.u L.D.u

Source | SS df MS Number of obs = 89-------------+------------------------------ F( 3, 85) = 15.18 Model | 12.4166337 3 4.13887791 Prob > F = 0.0000 Residual | 23.1680854 85 .27256571 R-squared = 0.3489-------------+------------------------------ Adj R-squared = 0.3260 Total | 35.5847191 88 .404371808 Root MSE = .52208

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .5592676 .0907962 6.16 0.000 .3787403 .7397948 | u | D1. | -.6881852 .2498704 -2.75 0.007 -1.184994 -.191376 LD. | .3199526 .257504 1.24 0.217 -.1920343 .8319396 | _cons | .3336325 .0899028 3.71 0.000 .1548817 .5123834------------------------------------------------------------------------------

. estimates store General

. scalar list delta delta1 delta = .33676767 delta1 = .38704645

.

. testnl _b[L.D.u]=-_b[L.inf]*_b[D.u]

(1) _b[L.D.u] = -_b[L.inf]*_b[D.u]

F(1, 85) = 0.11 Prob > F = 0.7384

.

. regress inf L.inf D.u

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 2, 87) = 23.05 Model | 12.5023522 2 6.25117612 Prob > F = 0.0000 Residual | 23.5905366 87 .271155594 R-squared = 0.3464-------------+------------------------------ Adj R-squared = 0.3314 Total | 36.0928889 89 .405538077 Root MSE = .52073

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .5282472 .0850756 6.21 0.000 .3591502 .6973443 | u | D1. | -.4908647 .1921491 -2.55 0.012 -.872782 -.1089475 | _cons | .3547951 .0876023 4.05 0.000 .180676 .5289142------------------------------------------------------------------------------

. estimates store No_LDu

.

. regress inf D.u

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 1, 88) = 5.29 Model | 2.04834633 1 2.04834633 Prob > F = 0.0238 Residual | 34.0445426 88 .386869802 R-squared = 0.0568-------------+------------------------------ Adj R-squared = 0.0460 Total | 36.0928889 89 .405538077 Root MSE = .62199

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.5278638 .2294049 -2.30 0.024 -.9837578 -.0719699 | _cons | .7776213 .0658249 11.81 0.000 .646808 .9084345------------------------------------------------------------------------------

. estimates store Original

. esttab General No_LDu Original, compress se(%12.3f) b(%12.5f) gaps scalars(r2_a rss aic)

------------------------------------------------- (1) (2) (3) inf inf inf -------------------------------------------------L.inf 0.55927*** 0.52825*** (0.091) (0.085)

D.u -0.68819** -0.49086* -0.52786*

Page 9: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

(0.250) (0.192) (0.229)

LD.u 0.31995 (0.258)

_cons 0.33363*** 0.35480*** 0.77762*** (0.090) (0.088) (0.066) -------------------------------------------------N 89 90 90 r2_a 0.32595 0.33137 0.04603 rss 23.16809 23.59054 34.04454 aic 140.78946 140.90217 171.91634 -------------------------------------------------Standard errors in parentheses* p<0.05, ** p<0.01, *** p<0.001

.

. * ARDL

. regress inf L.inf L(0/1).D.u

Source | SS df MS Number of obs = 89-------------+------------------------------ F( 3, 85) = 15.18 Model | 12.4166337 3 4.13887791 Prob > F = 0.0000 Residual | 23.1680854 85 .27256571 R-squared = 0.3489-------------+------------------------------ Adj R-squared = 0.3260 Total | 35.5847191 88 .404371808 Root MSE = .52208

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .5592676 .0907962 6.16 0.000 .3787403 .7397948 | u | D1. | -.6881852 .2498704 -2.75 0.007 -1.184994 -.191376 LD. | .3199526 .257504 1.24 0.217 -.1920343 .8319396 | _cons | .3336325 .0899028 3.71 0.000 .1548817 .5123834------------------------------------------------------------------------------

. estimates store AR1_DL1

. regress inf L.inf D.u

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 2, 87) = 23.05 Model | 12.5023522 2 6.25117612 Prob > F = 0.0000 Residual | 23.5905366 87 .271155594 R-squared = 0.3464-------------+------------------------------ Adj R-squared = 0.3314 Total | 36.0928889 89 .405538077 Root MSE = .52073

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .5282472 .0850756 6.21 0.000 .3591502 .6973443 | u | D1. | -.4908647 .1921491 -2.55 0.012 -.872782 -.1089475 | _cons | .3547951 .0876023 4.05 0.000 .180676 .5289142------------------------------------------------------------------------------

. estimates store AR1_DL0

. esttab AR1_DL1 AR1_DL0, compress se(%12.3f) b(%12.5f) gaps scalars(r2_a rss aic)

------------------------------------ (1) (2) inf inf ------------------------------------L.inf 0.55927*** 0.52825*** (0.091) (0.085)

D.u -0.68819** -0.49086* (0.250) (0.192)

LD.u 0.31995 (0.258)

_cons 0.33363*** 0.35480*** (0.090) (0.088) ------------------------------------N 89 90 r2_a 0.32595 0.33137 rss 23.16809 23.59054 aic 140.78946 140.90217 ------------------------------------Standard errors in parentheses* p<0.05, ** p<0.01, *** p<0.001

.

. * Model selection program computes aic and sc

. * To remove it from memory use:

. * program drop modelsel

. capture program drop modelsel

.

. program modelsel 1. scalar aic = ln(e(rss)/e(N))+2*e(rank)/e(N) 2. scalar sc = ln(e(rss)/e(N))+e(rank)*ln(e(N))/e(N) 3. scalar obs = e(N)

Page 10: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

4. scalar list aic sc obs 5. end

.

. regress inf L.inf L(0/1).D.u

Source | SS df MS Number of obs = 89-------------+------------------------------ F( 3, 85) = 15.18 Model | 12.4166337 3 4.13887791 Prob > F = 0.0000 Residual | 23.1680854 85 .27256571 R-squared = 0.3489-------------+------------------------------ Adj R-squared = 0.3260 Total | 35.5847191 88 .404371808 Root MSE = .52208

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .5592676 .0907962 6.16 0.000 .3787403 .7397948 | u | D1. | -.6881852 .2498704 -2.75 0.007 -1.184994 -.191376 LD. | .3199526 .257504 1.24 0.217 -.1920343 .8319396 | _cons | .3336325 .0899028 3.71 0.000 .1548817 .5123834------------------------------------------------------------------------------

. modelsel aic = -1.255973 sc = -1.1441242 obs = 89

. regress inf L.inf L.D.u

Source | SS df MS Number of obs = 89-------------+------------------------------ F( 2, 86) = 17.63 Model | 10.349101 2 5.17455051 Prob > F = 0.0000 Residual | 25.2356181 86 .293437419 R-squared = 0.2908-------------+------------------------------ Adj R-squared = 0.2743 Total | 35.5847191 88 .404371808 Root MSE = .5417

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .5184424 .0929446 5.58 0.000 .3336747 .7032101 | u | LD. | -.131544 .2060444 -0.64 0.525 -.5411467 .2780587 | _cons | .3706701 .092232 4.02 0.000 .187319 .5540212------------------------------------------------------------------------------

. modelsel aic = -1.1929642 sc = -1.1090776 obs = 89

.

. * --------------------------------------------------

. * Residual correlogram and graph

. * --------------------------------------------------

.

. regress inf L.inf D.u

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 2, 87) = 23.05 Model | 12.5023522 2 6.25117612 Prob > F = 0.0000 Residual | 23.5905366 87 .271155594 R-squared = 0.3464-------------+------------------------------ Adj R-squared = 0.3314 Total | 36.0928889 89 .405538077 Root MSE = .52073

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .5282472 .0850756 6.21 0.000 .3591502 .6973443 | u | D1. | -.4908647 .1921491 -2.55 0.012 -.872782 -.1089475 | _cons | .3547951 .0876023 4.05 0.000 .180676 .5289142------------------------------------------------------------------------------

. predict ehat, res(1 missing value generated)

. corrgram ehat, lags(12)

-1 0 1 -1 0 1 LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor]-------------------------------------------------------------------------------1 -0.1287 -0.1297 1.5407 0.2145 -| -| 2 0.0672 0.0510 1.9657 0.3742 | | 3 0.1129 0.1322 3.1792 0.3648 | |- 4 0.1851 0.2447 6.4797 0.1661 |- |- 5 0.0976 0.1780 7.4084 0.1920 | |- 6 0.1028 0.1300 8.451 0.2069 | |- 7 0.0001 -0.0314 8.451 0.2945 | | 8 0.1730 0.0898 11.475 0.1762 |- | 9 0.0817 0.0896 12.157 0.2046 | | 10 0.0020 -0.0124 12.158 0.2746 | | 11 -0.0588 -0.1355 12.52 0.3259 | -|

Page 11: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

12 0.0025 -0.1286 12.52 0.4048 | -|

. ac ehat, lags(12) saving("C:\data\g9_7.gph",replace)(note: file C:\data\g9_7.gph not found)(file C:\data\g9_7.gph saved)

. estat bgodfrey, lags(1 2 3 4 5)

Breusch-Godfrey LM test for autocorrelation--------------------------------------------------------------------------- lags(p) | chi2 df Prob > chi2-------------+------------------------------------------------------------- 1 | 4.130 1 0.0421 2 | 5.123 2 0.0772 3 | 5.221 3 0.1563 4 | 9.554 4 0.0486 5 | 12.485 5 0.0287--------------------------------------------------------------------------- H0: no serial correlation

. drop ehat

.

. * Table 9.4 AIC and SC Values for Phillips Curve ARDL model

. * Note that regress can be abreviated to reg and quietly to qui

. * Desactivamos quietly para apreciar el proceso numÚrico completo

.

. reg L(0/1).inf D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 2, 82) = 16.01 Model | 8.88975921 2 4.44487961 Prob > F = 0.0000 Residual | 22.7697702 82 .277680124 R-squared = 0.2808-------------+------------------------------ Adj R-squared = 0.2633 Total | 31.6595294 84 .37689916 Root MSE = .52695

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .4789512 .0924225 5.18 0.000 .2950935 .6628089 | u | D1. | -.4571502 .1968927 -2.32 0.023 -.8488324 -.0654679 | _cons | .3723384 .0896425 4.15 0.000 .1940109 .550666------------------------------------------------------------------------------

. di "p=1 q=0"p=1 q=0

. modelsel aic = -1.2466292 sc = -1.160418 obs = 85

. regress L(0/2).inf D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 3, 81) = 13.16 Model | 10.3736638 3 3.45788792 Prob > F = 0.0000 Residual | 21.2858656 81 .262788465 R-squared = 0.3277-------------+------------------------------ Adj R-squared = 0.3028 Total | 31.6595294 84 .37689916 Root MSE = .51263

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .3530932 .1043504 3.38 0.001 .1454686 .5607177 L2. | .2477117 .104243 2.38 0.020 .0403009 .4551225 | u | D1. | -.5455407 .1951187 -2.80 0.006 -.9337657 -.1573157 | _cons | .2761016 .0961508 2.87 0.005 .0847916 .4674115------------------------------------------------------------------------------

. di "p=2 q=0"p=2 q=0

. modelsel aic = -1.2904903 sc = -1.175542 obs = 85

. regress L(0/3).inf D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 4, 80) = 11.85 Model | 11.7782698 4 2.94456744 Prob > F = 0.0000 Residual | 19.8812597 80 .248515746 R-squared = 0.3720-------------+------------------------------ Adj R-squared = 0.3406 Total | 31.6595294 84 .37689916 Root MSE = .49851

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2933075 .1045466 2.81 0.006 .0852531 .5013619 L2. | .1559756 .1084682 1.44 0.154 -.059883 .3718343 L3. | .2507834 .1054869 2.38 0.020 .0408578 .4607089

Page 12: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

| u | D1. | -.665395 .1963292 -3.39 0.001 -1.056103 -.2746874 | _cons | .1925008 .0998971 1.93 0.058 -.0063007 .3913024------------------------------------------------------------------------------

. di "p=3 q=0"p=3 q=0

. modelsel aic = -1.3352266 sc = -1.1915413 obs = 85

. regress L(0/4).inf D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 5, 79) = 11.74 Model | 13.4946058 5 2.69892116 Prob > F = 0.0000 Residual | 18.1649236 79 .229935742 R-squared = 0.4262-------------+------------------------------ Adj R-squared = 0.3899 Total | 31.6595294 84 .37689916 Root MSE = .47952

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2314117 .1030829 2.24 0.028 .0262304 .436593 L2. | .1181601 .1052488 1.12 0.265 -.0913324 .3276526 L3. | .1648647 .1062286 1.55 0.125 -.0465779 .3763074 L4. | .2837305 .1038504 2.73 0.008 .0770215 .4904395 | u | D1. | -.7923313 .1944788 -4.07 0.000 -1.179432 -.405231 | _cons | .1040101 .1014021 1.03 0.308 -.0978258 .305846------------------------------------------------------------------------------

. di "p=4 q=0"p=4 q=0

. modelsel aic = -1.4019823 sc = -1.2295599 obs = 85

. regress L(0/5).inf D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 6, 78) = 10.07 Model | 13.8173625 6 2.30289375 Prob > F = 0.0000 Residual | 17.8421669 78 .22874573 R-squared = 0.4364-------------+------------------------------ Adj R-squared = 0.3931 Total | 31.6595294 84 .37689916 Root MSE = .47827

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2047068 .105245 1.95 0.055 -.0048199 .4142335 L2. | .1044605 .1056077 0.99 0.326 -.1057883 .3147093 L3. | .1528203 .1064374 1.44 0.155 -.0590803 .3647209 L4. | .2448943 .1086187 2.25 0.027 .0286511 .4611375 L5. | .1283451 .1080483 1.19 0.238 -.0867626 .3434527 | u | D1. | -.8569134 .2014503 -4.25 0.000 -1.25797 -.4558566 | _cons | .0701445 .1050809 0.67 0.506 -.1390555 .2793445------------------------------------------------------------------------------

. di "p=5 q=0"p=5 q=0

. modelsel aic = -1.3963808 sc = -1.1952213 obs = 85

. regress L(0/6).inf D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 7, 77) = 8.62 Model | 13.9069253 7 1.98670362 Prob > F = 0.0000 Residual | 17.7526041 77 .2305533 R-squared = 0.4393-------------+------------------------------ Adj R-squared = 0.3883 Total | 31.6595294 84 .37689916 Root MSE = .48016

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2015144 .1057841 1.90 0.061 -.0091286 .4121574 L2. | .0934106 .1074962 0.87 0.388 -.1206417 .3074629 L3. | .1454088 .1075167 1.35 0.180 -.0686843 .3595019 L4. | .2343862 .1103426 2.12 0.037 .014666 .4541064 L5. | .1102475 .1122934 0.98 0.329 -.1133572 .3338521 L6. | .0676507 .108541 0.62 0.535 -.1484821 .2837835 | u | D1. | -.8864439 .2077204 -4.27 0.000 -1.300068 -.4728198

Page 13: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

| _cons | .0542125 .108548 0.50 0.619 -.1619341 .2703591------------------------------------------------------------------------------

. di "p=6 q=0"p=6 q=0

. modelsel aic = -1.3778837 sc = -1.1479872 obs = 85

.

. reg L(0/1).inf L(0/1).D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 3, 81) = 11.28 Model | 9.32634894 3 3.10878298 Prob > F = 0.0000 Residual | 22.3331805 81 .275718277 R-squared = 0.2946-------------+------------------------------ Adj R-squared = 0.2685 Total | 31.6595294 84 .37689916 Root MSE = .52509

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .512828 .0959496 5.34 0.000 .3219184 .7037376 | u | D1. | -.6682839 .2581563 -2.59 0.011 -1.181934 -.1546337 LD. | .3326344 .2643402 1.26 0.212 -.1933197 .8585885 | _cons | .3496058 .0911338 3.84 0.000 .1682782 .5309334------------------------------------------------------------------------------

. di "p=1 q=1"p=1 q=1

. modelsel aic = -1.2424601 sc = -1.1275118 obs = 85

. reg L(0/2).inf L(0/1).D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 4, 80) = 10.32 Model | 10.7757185 4 2.69392962 Prob > F = 0.0000 Residual | 20.8838109 80 .261047637 R-squared = 0.3404-------------+------------------------------ Adj R-squared = 0.3074 Total | 31.6595294 84 .37689916 Root MSE = .51093

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .3870534 .1075439 3.60 0.001 .1730342 .6010725 L2. | .2448716 .1039223 2.36 0.021 .0380596 .4516836 | u | D1. | -.7471876 .2534166 -2.95 0.004 -1.251503 -.2428726 LD. | .3192849 .2572739 1.24 0.218 -.1927064 .8312762 | _cons | .2553847 .0972749 2.63 0.010 .0618015 .4489678------------------------------------------------------------------------------

. di "p=2 q=1"p=2 q=1

. modelsel aic = -1.2860299 sc = -1.1423446 obs = 85

. reg L(0/3).inf L(0/1).D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 5, 79) = 9.65 Model | 12.0081757 5 2.40163514 Prob > F = 0.0000 Residual | 19.6513537 79 .248751313 R-squared = 0.3793-------------+------------------------------ Adj R-squared = 0.3400 Total | 31.6595294 84 .37689916 Root MSE = .49875

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .322495 .1089133 2.96 0.004 .1057085 .5392815 L2. | .1588305 .1085602 1.46 0.147 -.0572532 .3749143 L3. | .2370541 .1064987 2.23 0.029 .0250738 .4490345 | u | D1. | -.8127072 .2491212 -3.26 0.002 -1.308571 -.3168438 LD. | .2436413 .2534303 0.96 0.339 -.2607991 .7480818 | _cons | .1812688 .100625 1.80 0.075 -.0190202 .3815579------------------------------------------------------------------------------

. di "p=3 q=1"p=3 q=1

. modelsel

Page 14: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

aic = -1.3233286 sc = -1.1509061 obs = 85

. reg L(0/4).inf L(0/1).D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 6, 78) = 9.68 Model | 13.5142103 6 2.25236838 Prob > F = 0.0000 Residual | 18.1453191 78 .232632296 R-squared = 0.4269-------------+------------------------------ Adj R-squared = 0.3828 Total | 31.6595294 84 .37689916 Root MSE = .48232

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2420479 .1099687 2.20 0.031 .0231171 .4609787 L2. | .1201253 .1060804 1.13 0.261 -.0910644 .3313151 L3. | .1632114 .1070013 1.53 0.131 -.0498119 .3762346 L4. | .2754685 .1082653 2.54 0.013 .0599287 .4910082 | u | D1. | -.8332202 .2410494 -3.46 0.001 -1.313113 -.3533277 LD. | .0737401 .2540156 0.29 0.772 -.4319662 .5794464 | _cons | .1031874 .1020343 1.01 0.315 -.0999473 .3063222------------------------------------------------------------------------------

. di "p=4 q=1"p=4 q=1

. modelsel aic = -1.3795327 sc = -1.1783732 obs = 85

. reg L(0/5).inf L(0/1).D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 7, 77) = 8.52 Model | 13.8183181 7 1.97404545 Prob > F = 0.0000 Residual | 17.8412113 77 .231704042 R-squared = 0.4365-------------+------------------------------ Adj R-squared = 0.3852 Total | 31.6595294 84 .37689916 Root MSE = .48136

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2073861 .1138431 1.82 0.072 -.0193044 .4340766 L2. | .1050494 .1066832 0.98 0.328 -.1073841 .3174828 L3. | .1525772 .1071903 1.42 0.159 -.060866 .3660204 L4. | .243451 .1116049 2.18 0.032 .0212172 .4656849 L5. | .1269709 .1108299 1.15 0.255 -.0937197 .3476615 | u | D1. | -.8654227 .2422046 -3.57 0.001 -1.347714 -.3831317 LD. | .0165929 .2583694 0.06 0.949 -.4978863 .5310721 | _cons | .070322 .1057943 0.66 0.508 -.1403414 .2809854------------------------------------------------------------------------------

. di "p=5 q=1"p=5 q=1

. modelsel aic = -1.3729049 sc = -1.1430084 obs = 85

. reg L(0/6).inf L(0/1).D.u if date>= tq(1988q3)

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 8, 76) = 7.44 Model | 13.907665 8 1.73845813 Prob > F = 0.0000 Residual | 17.7518644 76 .233577163 R-squared = 0.4393-------------+------------------------------ Adj R-squared = 0.3803 Total | 31.6595294 84 .37689916 Root MSE = .4833

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .1990554 .1150932 1.73 0.088 -.0301727 .4282834 L2. | .0926856 .108963 0.85 0.398 -.1243331 .3097043 L3. | .1454946 .1082302 1.34 0.183 -.0700646 .3610538 L4. | .2354929 .1127915 2.09 0.040 .0108492 .4601367 L5. | .1111569 .1141769 0.97 0.333 -.116246 .3385598 L6. | .0688566 .1113323 0.62 0.538 -.1528808 .290594 | u | D1. | -.8793411 .2442207 -3.60 0.001 -1.365749 -.3929334 LD. | -.0148767 .2643547 -0.06 0.955 -.5413846 .5116313 | _cons | .0537694 .1095408 0.49 0.625 -.1644001 .2719389------------------------------------------------------------------------------

. di "p=6 q=1"p=6 q=1

. modelsel

Page 15: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

aic = -1.354396 sc = -1.0957623 obs = 85

.

. * Table 9.4 AIC and SC Values for Phillips Curve ARDL model

. * Here is the entire thing again, using nested loops

. forvalues q=0/1 { 2. forvalues p=1/6 { 3. regress L(0/`p').inf L(0/`q').D.u if date >= tq(1988q3) 4. display "p=`p' q=`q'" 5. modelsel 6. } 7. }

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 2, 82) = 16.01 Model | 8.88975921 2 4.44487961 Prob > F = 0.0000 Residual | 22.7697702 82 .277680124 R-squared = 0.2808-------------+------------------------------ Adj R-squared = 0.2633 Total | 31.6595294 84 .37689916 Root MSE = .52695

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .4789512 .0924225 5.18 0.000 .2950935 .6628089 | u | D1. | -.4571502 .1968927 -2.32 0.023 -.8488324 -.0654679 | _cons | .3723384 .0896425 4.15 0.000 .1940109 .550666------------------------------------------------------------------------------p=1 q=0 aic = -1.2466292 sc = -1.160418 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 3, 81) = 13.16 Model | 10.3736638 3 3.45788792 Prob > F = 0.0000 Residual | 21.2858656 81 .262788465 R-squared = 0.3277-------------+------------------------------ Adj R-squared = 0.3028 Total | 31.6595294 84 .37689916 Root MSE = .51263

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .3530932 .1043504 3.38 0.001 .1454686 .5607177 L2. | .2477117 .104243 2.38 0.020 .0403009 .4551225 | u | D1. | -.5455407 .1951187 -2.80 0.006 -.9337657 -.1573157 | _cons | .2761016 .0961508 2.87 0.005 .0847916 .4674115------------------------------------------------------------------------------p=2 q=0 aic = -1.2904903 sc = -1.175542 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 4, 80) = 11.85 Model | 11.7782698 4 2.94456744 Prob > F = 0.0000 Residual | 19.8812597 80 .248515746 R-squared = 0.3720-------------+------------------------------ Adj R-squared = 0.3406 Total | 31.6595294 84 .37689916 Root MSE = .49851

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2933075 .1045466 2.81 0.006 .0852531 .5013619 L2. | .1559756 .1084682 1.44 0.154 -.059883 .3718343 L3. | .2507834 .1054869 2.38 0.020 .0408578 .4607089 | u | D1. | -.665395 .1963292 -3.39 0.001 -1.056103 -.2746874 | _cons | .1925008 .0998971 1.93 0.058 -.0063007 .3913024------------------------------------------------------------------------------p=3 q=0 aic = -1.3352266 sc = -1.1915413 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 5, 79) = 11.74 Model | 13.4946058 5 2.69892116 Prob > F = 0.0000 Residual | 18.1649236 79 .229935742 R-squared = 0.4262-------------+------------------------------ Adj R-squared = 0.3899 Total | 31.6595294 84 .37689916 Root MSE = .47952

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2314117 .1030829 2.24 0.028 .0262304 .436593 L2. | .1181601 .1052488 1.12 0.265 -.0913324 .3276526 L3. | .1648647 .1062286 1.55 0.125 -.0465779 .3763074 L4. | .2837305 .1038504 2.73 0.008 .0770215 .4904395

Page 16: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

| u | D1. | -.7923313 .1944788 -4.07 0.000 -1.179432 -.405231 | _cons | .1040101 .1014021 1.03 0.308 -.0978258 .305846------------------------------------------------------------------------------p=4 q=0 aic = -1.4019823 sc = -1.2295599 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 6, 78) = 10.07 Model | 13.8173625 6 2.30289375 Prob > F = 0.0000 Residual | 17.8421669 78 .22874573 R-squared = 0.4364-------------+------------------------------ Adj R-squared = 0.3931 Total | 31.6595294 84 .37689916 Root MSE = .47827

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2047068 .105245 1.95 0.055 -.0048199 .4142335 L2. | .1044605 .1056077 0.99 0.326 -.1057883 .3147093 L3. | .1528203 .1064374 1.44 0.155 -.0590803 .3647209 L4. | .2448943 .1086187 2.25 0.027 .0286511 .4611375 L5. | .1283451 .1080483 1.19 0.238 -.0867626 .3434527 | u | D1. | -.8569134 .2014503 -4.25 0.000 -1.25797 -.4558566 | _cons | .0701445 .1050809 0.67 0.506 -.1390555 .2793445------------------------------------------------------------------------------p=5 q=0 aic = -1.3963808 sc = -1.1952213 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 7, 77) = 8.62 Model | 13.9069253 7 1.98670362 Prob > F = 0.0000 Residual | 17.7526041 77 .2305533 R-squared = 0.4393-------------+------------------------------ Adj R-squared = 0.3883 Total | 31.6595294 84 .37689916 Root MSE = .48016

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2015144 .1057841 1.90 0.061 -.0091286 .4121574 L2. | .0934106 .1074962 0.87 0.388 -.1206417 .3074629 L3. | .1454088 .1075167 1.35 0.180 -.0686843 .3595019 L4. | .2343862 .1103426 2.12 0.037 .014666 .4541064 L5. | .1102475 .1122934 0.98 0.329 -.1133572 .3338521 L6. | .0676507 .108541 0.62 0.535 -.1484821 .2837835 | u | D1. | -.8864439 .2077204 -4.27 0.000 -1.300068 -.4728198 | _cons | .0542125 .108548 0.50 0.619 -.1619341 .2703591------------------------------------------------------------------------------p=6 q=0 aic = -1.3778837 sc = -1.1479872 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 3, 81) = 11.28 Model | 9.32634894 3 3.10878298 Prob > F = 0.0000 Residual | 22.3331805 81 .275718277 R-squared = 0.2946-------------+------------------------------ Adj R-squared = 0.2685 Total | 31.6595294 84 .37689916 Root MSE = .52509

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .512828 .0959496 5.34 0.000 .3219184 .7037376 | u | D1. | -.6682839 .2581563 -2.59 0.011 -1.181934 -.1546337 LD. | .3326344 .2643402 1.26 0.212 -.1933197 .8585885 | _cons | .3496058 .0911338 3.84 0.000 .1682782 .5309334------------------------------------------------------------------------------p=1 q=1 aic = -1.2424601 sc = -1.1275118 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 4, 80) = 10.32 Model | 10.7757185 4 2.69392962 Prob > F = 0.0000 Residual | 20.8838109 80 .261047637 R-squared = 0.3404-------------+------------------------------ Adj R-squared = 0.3074 Total | 31.6595294 84 .37689916 Root MSE = .51093

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .3870534 .1075439 3.60 0.001 .1730342 .6010725

Page 17: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

L2. | .2448716 .1039223 2.36 0.021 .0380596 .4516836 | u | D1. | -.7471876 .2534166 -2.95 0.004 -1.251503 -.2428726 LD. | .3192849 .2572739 1.24 0.218 -.1927064 .8312762 | _cons | .2553847 .0972749 2.63 0.010 .0618015 .4489678------------------------------------------------------------------------------p=2 q=1 aic = -1.2860299 sc = -1.1423446 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 5, 79) = 9.65 Model | 12.0081757 5 2.40163514 Prob > F = 0.0000 Residual | 19.6513537 79 .248751313 R-squared = 0.3793-------------+------------------------------ Adj R-squared = 0.3400 Total | 31.6595294 84 .37689916 Root MSE = .49875

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .322495 .1089133 2.96 0.004 .1057085 .5392815 L2. | .1588305 .1085602 1.46 0.147 -.0572532 .3749143 L3. | .2370541 .1064987 2.23 0.029 .0250738 .4490345 | u | D1. | -.8127072 .2491212 -3.26 0.002 -1.308571 -.3168438 LD. | .2436413 .2534303 0.96 0.339 -.2607991 .7480818 | _cons | .1812688 .100625 1.80 0.075 -.0190202 .3815579------------------------------------------------------------------------------p=3 q=1 aic = -1.3233286 sc = -1.1509061 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 6, 78) = 9.68 Model | 13.5142103 6 2.25236838 Prob > F = 0.0000 Residual | 18.1453191 78 .232632296 R-squared = 0.4269-------------+------------------------------ Adj R-squared = 0.3828 Total | 31.6595294 84 .37689916 Root MSE = .48232

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2420479 .1099687 2.20 0.031 .0231171 .4609787 L2. | .1201253 .1060804 1.13 0.261 -.0910644 .3313151 L3. | .1632114 .1070013 1.53 0.131 -.0498119 .3762346 L4. | .2754685 .1082653 2.54 0.013 .0599287 .4910082 | u | D1. | -.8332202 .2410494 -3.46 0.001 -1.313113 -.3533277 LD. | .0737401 .2540156 0.29 0.772 -.4319662 .5794464 | _cons | .1031874 .1020343 1.01 0.315 -.0999473 .3063222------------------------------------------------------------------------------p=4 q=1 aic = -1.3795327 sc = -1.1783732 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 7, 77) = 8.52 Model | 13.8183181 7 1.97404545 Prob > F = 0.0000 Residual | 17.8412113 77 .231704042 R-squared = 0.4365-------------+------------------------------ Adj R-squared = 0.3852 Total | 31.6595294 84 .37689916 Root MSE = .48136

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .2073861 .1138431 1.82 0.072 -.0193044 .4340766 L2. | .1050494 .1066832 0.98 0.328 -.1073841 .3174828 L3. | .1525772 .1071903 1.42 0.159 -.060866 .3660204 L4. | .243451 .1116049 2.18 0.032 .0212172 .4656849 L5. | .1269709 .1108299 1.15 0.255 -.0937197 .3476615 | u | D1. | -.8654227 .2422046 -3.57 0.001 -1.347714 -.3831317 LD. | .0165929 .2583694 0.06 0.949 -.4978863 .5310721 | _cons | .070322 .1057943 0.66 0.508 -.1403414 .2809854------------------------------------------------------------------------------p=5 q=1 aic = -1.3729049 sc = -1.1430084 obs = 85

Source | SS df MS Number of obs = 85-------------+------------------------------ F( 8, 76) = 7.44 Model | 13.907665 8 1.73845813 Prob > F = 0.0000 Residual | 17.7518644 76 .233577163 R-squared = 0.4393-------------+------------------------------ Adj R-squared = 0.3803 Total | 31.6595294 84 .37689916 Root MSE = .4833

------------------------------------------------------------------------------

Page 18: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- inf | L1. | .1990554 .1150932 1.73 0.088 -.0301727 .4282834 L2. | .0926856 .108963 0.85 0.398 -.1243331 .3097043 L3. | .1454946 .1082302 1.34 0.183 -.0700646 .3610538 L4. | .2354929 .1127915 2.09 0.040 .0108492 .4601367 L5. | .1111569 .1141769 0.97 0.333 -.116246 .3385598 L6. | .0688566 .1113323 0.62 0.538 -.1528808 .290594 | u | D1. | -.8793411 .2442207 -3.60 0.001 -1.365749 -.3929334 LD. | -.0148767 .2643547 -0.06 0.955 -.5413846 .5116313 | _cons | .0537694 .1095408 0.49 0.625 -.1644001 .2719389------------------------------------------------------------------------------p=6 q=1 aic = -1.354396 sc = -1.0957623 obs = 85

.

. * Using var to estimate ARDL

. * Disadvantage: No estat after the procedure

.

. var inf in 7/91, lags(1/3) exog(L(0/1).D.u)

Vector autoregression

Sample: 1988q3 - 2009q3 No. of obs = 85Log likelihood = -58.36831 AIC = 1.514549FPE = .2663102 HQIC = 1.583902Det(Sigma_ml) = .2311924 SBIC = 1.686971

Equation Parms RMSE R-sq chi2 P>chi2----------------------------------------------------------------inf 6 .49875 0.3793 51.94018 0.0000----------------------------------------------------------------

------------------------------------------------------------------------------ inf | Coef. Std. Err. z P>|z| [95% Conf. Interval]-------------+----------------------------------------------------------------inf | inf | L1. | .322495 .1049989 3.07 0.002 .1167009 .5282891 L2. | .1588305 .1046586 1.52 0.129 -.0462965 .3639576 L3. | .2370541 .1026711 2.31 0.021 .0358224 .4382859 | u | D1. | -.8127072 .2401678 -3.38 0.001 -1.283427 -.3419869 LD. | .2436413 .2443221 1.00 0.319 -.2352211 .7225038 | _cons | .1812688 .0970085 1.87 0.062 -.0088644 .3714021------------------------------------------------------------------------------

.

. * ARDL models

. use "C:\data\poe4stata\okun.dta", clear

. generate date = tq(1985q2) + _n-1

. format %tq date

. tsset date time variable: date, 1985q2 to 2009q3 delta: 1 quarter

.

. * Estimate the ARDL(0,2)

. * Generate the correlogram and test for autocorrelation

. reg D.u L(0/2).g

Source | SS df MS Number of obs = 96-------------+------------------------------ F( 3, 92) = 57.95 Model | 5.17925206 3 1.72641735 Prob > F = 0.0000 Residual | 2.74074794 92 .029790739 R-squared = 0.6539-------------+------------------------------ Adj R-squared = 0.6427 Total | 7.92 95 .083368421 Root MSE = .1726

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | --. | -.2020216 .0323832 -6.24 0.000 -.2663374 -.1377059 L1. | -.1653269 .0335368 -4.93 0.000 -.2319339 -.0987198 L2. | -.0700135 .0331 -2.12 0.037 -.1357529 -.0042741 | _cons | .5835561 .0472119 12.36 0.000 .4897892 .6773231------------------------------------------------------------------------------

. predict ehat, res(2 missing values generated)

. ac ehat, lags(12) saving("C:\data\g9_8.gph",replace)(note: file C:\data\g9_8.gph not found)(file C:\data\g9_8.gph saved)

. drop ehat

. estat bgodfrey, lags(1 2 3 4 5)

Breusch-Godfrey LM test for autocorrelation

Page 19: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

--------------------------------------------------------------------------- lags(p) | chi2 df Prob > chi2-------------+------------------------------------------------------------- 1 | 12.364 1 0.0004 2 | 12.894 2 0.0016 3 | 13.754 3 0.0033 4 | 15.228 4 0.0043 5 | 19.648 5 0.0015--------------------------------------------------------------------------- H0: no serial correlation

.

. * Model Selection for Okun's Law model

. forvalues q=1/3 { 2. forvalues p=0/2 { 3. regress L(0/`p').D.u L(0/`q').g if date >= tq(1986q1) 4. display "p=`p' q=`q'" 5. modelsel 6. } 7. }

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 2, 92) = 80.10 Model | 4.99835247 2 2.49917623 Prob > F = 0.0000 Residual | 2.87048964 92 .031200974 R-squared = 0.6352-------------+------------------------------ Adj R-squared = 0.6273 Total | 7.86884211 94 .083711086 Root MSE = .17664

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | --. | -.2189712 .0321922 -6.80 0.000 -.2829077 -.1550347 L1. | -.1894397 .0322743 -5.87 0.000 -.2535392 -.1253402 | _cons | .5457421 .0448312 12.17 0.000 .4567034 .6347808------------------------------------------------------------------------------p=0 q=1 aic = -3.4362364 sc = -3.3555876 obs = 95

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 3, 91) = 68.50 Model | 5.4538893 3 1.8179631 Prob > F = 0.0000 Residual | 2.4149528 91 .026537943 R-squared = 0.6931-------------+------------------------------ Adj R-squared = 0.6830 Total | 7.86884211 94 .083711086 Root MSE = .1629

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | LD. | .3520685 .0849765 4.14 0.000 .183273 .5208639 | g | --. | -.1845561 .0308294 -5.99 0.000 -.245795 -.1233172 L1. | -.0967218 .0372393 -2.60 0.011 -.1706931 -.0227506 | _cons | .3763834 .0581412 6.47 0.000 .2608931 .4918738------------------------------------------------------------------------------p=1 q=1 aic = -3.5879866 sc = -3.480455 obs = 95

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 4, 90) = 50.99 Model | 5.45961416 4 1.36490354 Prob > F = 0.0000 Residual | 2.40922794 90 .026769199 R-squared = 0.6938-------------+------------------------------ Adj R-squared = 0.6802 Total | 7.86884211 94 .083711086 Root MSE = .16361

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | LD. | .3229714 .1060321 3.05 0.003 .1123201 .5336226 L2D. | .0457905 .0990172 0.46 0.645 -.1509244 .2425054 | g | --. | -.1822659 .031357 -5.81 0.000 -.2445621 -.1199697 L1. | -.0970512 .037408 -2.59 0.011 -.1713686 -.0227337 | _cons | .37416 .0585916 6.39 0.000 .2577576 .4905623------------------------------------------------------------------------------p=2 q=1 aic = -3.5693074 sc = -3.4348928 obs = 95

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 3, 91) = 56.93 Model | 5.13342571 3 1.7111419 Prob > F = 0.0000 Residual | 2.73541639 91 .030059521 R-squared = 0.6524-------------+------------------------------ Adj R-squared = 0.6409 Total | 7.86884211 94 .083711086 Root MSE = .17338

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g |

Page 20: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

--. | -.20245 .0325448 -6.22 0.000 -.2670964 -.1378037 L1. | -.1635478 .0339516 -4.82 0.000 -.2309885 -.0961071 L2. | -.0705286 .0332714 -2.12 0.037 -.1366182 -.004439 | _cons | .5832604 .0474296 12.30 0.000 .4890473 .6774735------------------------------------------------------------------------------p=0 q=2 aic = -3.4633827 sc = -3.355851 obs = 95

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 4, 90) = 50.86 Model | 5.45537588 4 1.36384397 Prob > F = 0.0000 Residual | 2.41346622 90 .026816291 R-squared = 0.6933-------------+------------------------------ Adj R-squared = 0.6797 Total | 7.86884211 94 .083711086 Root MSE = .16376

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | LD. | .3406141 .0983032 3.46 0.001 .1453176 .5359105 | g | --. | -.1836812 .0312127 -5.88 0.000 -.2456906 -.1216718 L1. | -.0966125 .0374369 -2.58 0.011 -.1709875 -.0222375 L2. | -.0085149 .0361645 -0.24 0.814 -.080362 .0633323 | _cons | .386423 .0723467 5.34 0.000 .2426936 .5301525------------------------------------------------------------------------------p=1 q=2 aic = -3.5675498 sc = -3.4331352 obs = 95

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 5, 89) = 40.34 Model | 5.45977032 5 1.09195406 Prob > F = 0.0000 Residual | 2.40907179 89 .027068222 R-squared = 0.6938-------------+------------------------------ Adj R-squared = 0.6766 Total | 7.86884211 94 .083711086 Root MSE = .16452

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | LD. | .320826 .1103007 2.91 0.005 .1016609 .539991 L2D. | .042917 .1065141 0.40 0.688 -.1687244 .2545583 | g | --. | -.1821063 .0316016 -5.76 0.000 -.244898 -.1193145 L1. | -.0969926 .0376242 -2.58 0.012 -.1717511 -.0222341 L2. | -.0029522 .0388685 -0.08 0.940 -.0801831 .0742787 | _cons | .3777804 .0757847 4.98 0.000 .2271977 .528363------------------------------------------------------------------------------p=2 q=2 aic = -3.5483196 sc = -3.3870221 obs = 95

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 4, 90) = 42.23 Model | 5.13367789 4 1.28341947 Prob > F = 0.0000 Residual | 2.73516422 90 .030390714 R-squared = 0.6524-------------+------------------------------ Adj R-squared = 0.6370 Total | 7.86884211 94 .083711086 Root MSE = .17433

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | --. | -.2020526 .0330131 -6.12 0.000 -.267639 -.1364663 L1. | -.1645352 .0358175 -4.59 0.000 -.2356929 -.0933774 L2. | -.071556 .0353043 -2.03 0.046 -.1416941 -.0014179 L3. | .003303 .0362603 0.09 0.928 -.0687345 .0753405 | _cons | .5809746 .0538893 10.78 0.000 .4739142 .688035------------------------------------------------------------------------------p=0 q=3 aic = -3.4424223 sc = -3.3080077 obs = 95

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 5, 89) = 41.09 Model | 5.49050472 5 1.09810094 Prob > F = 0.0000 Residual | 2.37833738 89 .026722892 R-squared = 0.6978-------------+------------------------------ Adj R-squared = 0.6808 Total | 7.86884211 94 .083711086 Root MSE = .16347

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | LD. | .3744909 .1024836 3.65 0.000 .1708582 .5781235 | g | --. | -.1769163 .031712 -5.58 0.000 -.2399273 -.1139052 L1. | -.1021252 .0376797 -2.71 0.008 -.1769941 -.0272564 L2. | -.0150108 .0365434 -0.41 0.682 -.0876217 .0576001

Page 21: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

L3. | .0407134 .0355097 1.15 0.255 -.0298437 .1112705 | _cons | .3386704 .0833695 4.06 0.000 .173017 .5043239------------------------------------------------------------------------------p=1 q=3 aic = -3.5611594 sc = -3.3998619 obs = 95

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 6, 88) = 34.30 Model | 5.5117894 6 .918631567 Prob > F = 0.0000 Residual | 2.3570527 88 .02678469 R-squared = 0.7005-------------+------------------------------ Adj R-squared = 0.6800 Total | 7.86884211 94 .083711086 Root MSE = .16366

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | LD. | .3381112 .1104203 3.06 0.003 .118674 .5575483 L2D. | .1016494 .1140288 0.89 0.375 -.1249589 .3282578 | g | --. | -.1710914 .0324141 -5.28 0.000 -.2355076 -.1066752 L1. | -.1047324 .0378365 -2.77 0.007 -.1799244 -.0295404 L2. | -.0038468 .0386697 -0.10 0.921 -.0806948 .0730012 L3. | .0533189 .0382598 1.39 0.167 -.0227145 .1293522 | _cons | .3034152 .0923615 3.29 0.001 .1198661 .4869644------------------------------------------------------------------------------p=2 q=3 aic = -3.5490965 sc = -3.3609161 obs = 95

.

. reg D.u L.D.u L(0/1).g

Source | SS df MS Number of obs = 96-------------+------------------------------ F( 3, 92) = 69.58 Model | 5.49727601 3 1.83242534 Prob > F = 0.0000 Residual | 2.42272399 92 .026333956 R-squared = 0.6941-------------+------------------------------ Adj R-squared = 0.6841 Total | 7.92 95 .083368421 Root MSE = .16228

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | LD. | .3501158 .084573 4.14 0.000 .1821466 .518085 | g | --. | -.1840843 .0306984 -6.00 0.000 -.245054 -.1231146 L1. | -.0991552 .0368244 -2.69 0.008 -.1722917 -.0260187 | _cons | .3780104 .0578398 6.54 0.000 .2631356 .4928853------------------------------------------------------------------------------

. estat bgodfrey

Breusch-Godfrey LM test for autocorrelation--------------------------------------------------------------------------- lags(p) | chi2 df Prob > chi2-------------+------------------------------------------------------------- 1 | 0.170 1 0.6804--------------------------------------------------------------------------- H0: no serial correlation

.

. * Figure 9.11

. reg g L(1/2).g

Source | SS df MS Number of obs = 96-------------+------------------------------ F( 2, 93) = 19.06 Model | 11.6417916 2 5.82089582 Prob > F = 0.0000 Residual | 28.4081042 93 .305463486 R-squared = 0.2907-------------+------------------------------ Adj R-squared = 0.2754 Total | 40.0498958 95 .421577851 Root MSE = .55269

------------------------------------------------------------------------------ g | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | L1. | .3770015 .100021 3.77 0.000 .1783797 .5756233 L2. | .2462394 .1028688 2.39 0.019 .0419623 .4505165 | _cons | .4657262 .1432576 3.25 0.002 .181245 .7502073------------------------------------------------------------------------------

. predict ehat, res(2 missing values generated)

. ac ehat, lags(12) saving("C:\data\g9_9.gph",replace)(note: file C:\data\g9_9.gph not found)(file C:\data\g9_9.gph saved)

.

. * Table 9.6

. forvalues p=1/5 { 2. reg L(0/`p').g if date> tq(1986q2) 3. display "p=`p'"

Page 22: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

4. modelsel 5. }

Source | SS df MS Number of obs = 93-------------+------------------------------ F( 1, 91) = 30.48 Model | 9.9966399 1 9.9966399 Prob > F = 0.0000 Residual | 29.8465859 91 .32798446 R-squared = 0.2509-------------+------------------------------ Adj R-squared = 0.2427 Total | 39.8432258 92 .433078541 Root MSE = .5727

------------------------------------------------------------------------------ g | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | L1. | .5014252 .0908251 5.52 0.000 .3210124 .6818381 | _cons | .631525 .1296421 4.87 0.000 .3740069 .889043------------------------------------------------------------------------------p=1 aic = -1.0935183 sc = -1.0390538 obs = 93

Source | SS df MS Number of obs = 93-------------+------------------------------ F( 2, 90) = 18.70 Model | 11.6945199 2 5.84725993 Prob > F = 0.0000 Residual | 28.1487059 90 .312763399 R-squared = 0.2935-------------+------------------------------ Adj R-squared = 0.2778 Total | 39.8432258 92 .433078541 Root MSE = .55925

------------------------------------------------------------------------------ g | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | L1. | .3835584 .1021053 3.76 0.000 .1807084 .5864084 L2. | .2445565 .1049624 2.33 0.022 .0360304 .4530827 | _cons | .4663085 .1451045 3.21 0.002 .178033 .754584------------------------------------------------------------------------------p=2 aic = -1.130582 sc = -1.0488852 obs = 93

Source | SS df MS Number of obs = 93-------------+------------------------------ F( 3, 89) = 12.97 Model | 12.1170904 3 4.03903012 Prob > F = 0.0000 Residual | 27.7261354 89 .311529612 R-squared = 0.3041-------------+------------------------------ Adj R-squared = 0.2807 Total | 39.8432258 92 .433078541 Root MSE = .55815

------------------------------------------------------------------------------ g | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | L1. | .4171339 .105903 3.94 0.000 .2067068 .6275609 L2. | .2830717 .1098511 2.58 0.012 .0647999 .5013434 L3. | -.1351043 .116003 -1.16 0.247 -.3655999 .0953912 | _cons | .5518042 .1623608 3.40 0.001 .2291968 .8744116------------------------------------------------------------------------------p=3 aic = -1.1242025 sc = -1.0152735 obs = 93

Source | SS df MS Number of obs = 93-------------+------------------------------ F( 4, 88) = 10.59 Model | 12.948938 4 3.23723449 Prob > F = 0.0000 Residual | 26.8942878 88 .305616907 R-squared = 0.3250-------------+------------------------------ Adj R-squared = 0.2943 Total | 39.8432258 92 .433078541 Root MSE = .55283

------------------------------------------------------------------------------ g | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | L1. | .4318378 .1052712 4.10 0.000 .2226334 .6410421 L2. | .2288531 .1136584 2.01 0.047 .0029809 .4547254 L3. | -.1720787 .1170623 -1.47 0.145 -.4047154 .0605579 L4. | .2035326 .1233675 1.65 0.103 -.0416344 .4486997 | _cons | .3764581 .1927608 1.95 0.054 -.0066135 .7595297------------------------------------------------------------------------------p=4 aic = -1.1331587 sc = -.99699743 obs = 93

Source | SS df MS Number of obs = 93-------------+------------------------------ F( 5, 87) = 8.38 Model | 12.9491776 5 2.58983551 Prob > F = 0.0000 Residual | 26.8940483 87 .309126991 R-squared = 0.3250-------------+------------------------------ Adj R-squared = 0.2862 Total | 39.8432258 92 .433078541 Root MSE = .55599

------------------------------------------------------------------------------ g | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | L1. | .4323626 .107539 4.02 0.000 .2186171 .646108 L2. | .2283849 .1155399 1.98 0.051 -.0012631 .458033

Page 23: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

L3. | -.1713081 .1209435 -1.42 0.160 -.4116963 .0690802 L4. | .2042122 .1264524 1.61 0.110 -.0471256 .45555 L5. | -.0035078 .1260009 -0.03 0.978 -.2539483 .2469326 | _cons | .3792456 .2181943 1.74 0.086 -.0544392 .8129303------------------------------------------------------------------------------p=5 aic = -1.1116622 sc = -.94826871 obs = 93

.

.

. * Forecasting using -arima- instead of -regress-

. * which, of course, yields different predictions

. arima g, ar(1/2)

(setting optimization to BHHH)Iteration 0: log likelihood = -79.347105 Iteration 1: log likelihood = -79.343314 Iteration 2: log likelihood = -79.342729 Iteration 3: log likelihood = -79.342613 Iteration 4: log likelihood = -79.342579 (switching optimization to BFGS)Iteration 5: log likelihood = -79.342566 Iteration 6: log likelihood = -79.342558

ARIMA regression

Sample: 1985q2 - 2009q3 Number of obs = 98 Wald chi2(2) = 44.93Log likelihood = -79.34256 Prob > chi2 = 0.0000

------------------------------------------------------------------------------ | OPG g | Coef. Std. Err. z P>|z| [95% Conf. Interval]-------------+----------------------------------------------------------------g | _cons | 1.266199 .1569143 8.07 0.000 .9586523 1.573745-------------+----------------------------------------------------------------ARMA | ar | L1. | .3744832 .084683 4.42 0.000 .2085075 .5404588 L2. | .2438629 .1011975 2.41 0.016 .0455194 .4422063-------------+---------------------------------------------------------------- /sigma | .5426093 .0332773 16.31 0.000 .4773869 .6078316------------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero.

. tsappend, add(3)

. * for the point estimates

. predict ghat, y

. * for the standard error of prediction

. predict ghatse, mse

.

. * Forecasting with an AR model

.

. reg g L(1/2).g

Source | SS df MS Number of obs = 96-------------+------------------------------ F( 2, 93) = 19.06 Model | 11.6417916 2 5.82089582 Prob > F = 0.0000 Residual | 28.4081042 93 .305463486 R-squared = 0.2907-------------+------------------------------ Adj R-squared = 0.2754 Total | 40.0498958 95 .421577851 Root MSE = .55269

------------------------------------------------------------------------------ g | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- g | L1. | .3770015 .100021 3.77 0.000 .1783797 .5756233 L2. | .2462394 .1028688 2.39 0.019 .0419623 .4505165 | _cons | .4657262 .1432576 3.25 0.002 .181245 .7502073------------------------------------------------------------------------------

. scalar ghat1 = _b[_cons]+_b[L1.g]*g[98]+ _b[L2.g]*g[97]

. scalar ghat2 = _b[_cons]+_b[L1.g]*ghat1+ _b[L2.g]*g[98]

. scalar ghat3 = _b[_cons]+_b[L1.g]*ghat2+ _b[L2.g]*ghat1

. scalar list ghat1 ghat2 ghat3 ghat1 = .71807948 ghat2 = .93343472 ghat3 = .99445191

.

. scalar var = e(rmse)^2

. scalar se1 = sqrt(var)

. scalar se2 = sqrt(var*(1+(_b[L1.g])^2))

. scalar se3 = sqrt(var*((_b[L1.g]^2+_b[L2.g])^2+1+_b[L1.g]^2))

. scalar list se1 se2 se3 se1 = .55268751 se2 = .59065984

Page 24: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

se3 = .62845236

.

. scalar f1L = ghat1 - invttail(e(df_r),.025)*se1

. scalar f1U = ghat1 + invttail(e(df_r),.025)*se1

.

. scalar f2L = ghat2 - invttail(e(df_r),.025)*se2

. scalar f2U = ghat2 + invttail(e(df_r),.025)*se2

.

. scalar f3L = ghat3 - invttail(e(df_r),.025)*se3

. scalar f3U = ghat3 + invttail(e(df_r),.025)*se3

.

. scalar list f1L f1U f2L f2U f3L f3U f1L = -.37944839 f1U = 1.8156073 f2L = -.23949866 f2U = 2.1063681 f3L = -.25352994 f3U = 2.2424338

.

. * --------------------------------------------------

. * Impact and Delay Multipliers from Okun's ARDL(1,1) model

. * --------------------------------------------------

.

. regress D.u L.D.u L(0/1).g

Source | SS df MS Number of obs = 96-------------+------------------------------ F( 3, 92) = 69.58 Model | 5.49727601 3 1.83242534 Prob > F = 0.0000 Residual | 2.42272399 92 .026333956 R-squared = 0.6941-------------+------------------------------ Adj R-squared = 0.6841 Total | 7.92 95 .083368421 Root MSE = .16228

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | LD. | .3501158 .084573 4.14 0.000 .1821466 .518085 | g | --. | -.1840843 .0306984 -6.00 0.000 -.245054 -.1231146 L1. | -.0991552 .0368244 -2.69 0.008 -.1722917 -.0260187 | _cons | .3780104 .0578398 6.54 0.000 .2631356 .4928853------------------------------------------------------------------------------

.

. scalar b0 = _b[g]

. scalar b1 = _b[L1.D.u]*b0+_b[L1.g]

. scalar b2 = b1*_b[L1.D.u]

. scalar list b0 b1 b2 b0 = -.18408429 b1 = -.16360601 b2 = -.05728104

.

. * An alternative method: Exploiting variable creation

. regress D.u L.D.u L(0/1).g

Source | SS df MS Number of obs = 96-------------+------------------------------ F( 3, 92) = 69.58 Model | 5.49727601 3 1.83242534 Prob > F = 0.0000 Residual | 2.42272399 92 .026333956 R-squared = 0.6941-------------+------------------------------ Adj R-squared = 0.6841 Total | 7.92 95 .083368421 Root MSE = .16228

------------------------------------------------------------------------------ D.u | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | LD. | .3501158 .084573 4.14 0.000 .1821466 .518085 | g | --. | -.1840843 .0306984 -6.00 0.000 -.245054 -.1231146 L1. | -.0991552 .0368244 -2.69 0.008 -.1722917 -.0260187 | _cons | .3780104 .0578398 6.54 0.000 .2631356 .4928853------------------------------------------------------------------------------

. gen mult = _b[g] in 1(100 missing values generated)

. replace mult = L.mult*_b[L1.D.u]+_b[L1.g] in 2(1 real change made)

. replace mult = L.mult*_b[L1.D.u] in 3/8(6 real changes made)

. list mult in 1/8

+-----------+ | mult |

Page 25: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

|-----------| 1. | -.1840843 | 2. | -.163606 | 3. | -.057281 | 4. | -.020055 | 5. | -.0070216 | |-----------| 6. | -.0024584 | 7. | -.0008607 | 8. | -.0003013 | +-----------+

. gen lag = _n-1 in 1/8(93 missing values generated)

. line mult lag in 1/8, saving("C:\data\g9_10.gph",replace)(note: file C:\data\g9_10.gph not found)(file C:\data\g9_10.gph saved)

.

. * --------------------------------------------------

. * Exponential Smoothing

. * --------------------------------------------------

.

. use "C:\data\poe4stata\okun.dta", clear

. generate date = tq(1985q2) + _n-1

. format %tq date

. tsset date time variable: date, 1985q2 to 2009q3 delta: 1 quarter

.

. tsappend, add(1)

. tssmooth exponential sm1=g, parms(.38)

exponential coefficient = 0.3800sum-of-squared residuals = 31.122root mean squared error = .56354

. tsline sm1 g, legend(lab (1 "G") lab(2 "Ghat")) title(alpha=0.38) lpattern(solid dash) saving("C:\data\g9_11.gph",replace)(note: file C:\data\g9_11.gph not found)(file C:\data\g9_11.gph saved)

. scalar f1 = .38*g[98]+(1-.38)*sm1[98]

. scalar list f1 f1 = .05356533

. list sm1 in 99

+----------+ | sm1 | |----------| 99. | .0535653 | +----------+

.

. tssmooth exponential sm2=g, parms(.8)

exponential coefficient = 0.8000sum-of-squared residuals = 35.452root mean squared error = .60146

. tsline sm2 g, legend(lab (1 "G") lab(2 "Ghat")) title(alpha=0.8) lpattern(solid dash) saving("C:\data\g9_12.gph",replace)(note: file C:\data\g9_12.gph not found)(file C:\data\g9_12.gph saved)

. scalar f2 = .8*g[98]+(1-.8)*sm2[98]

. scalar list f2 f2 = .56128444

.

. tssmooth exponential sm3=g

computing optimal exponential coefficient (0,1)

optimal exponential coefficient = 0.3803sum-of-squared residuals = 31.122043root mean squared error = .56353515

. scalar f3 = r(alpha)*g[98]+(1-r(alpha))*sm3[98]

. scalar list f3 f3 = .05367152

. list sm3 in 99

+----------+ | sm3 | |----------| 99. | .0536715 | +----------+

.

. program drop modelsel

. drop sm1 sm2 sm3

Page 26: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

.

. * appendix

. * Durbin Watson test

. use "C:\data\poe4stata\phillips_aus.dta", clear

. generate date = tq(1987q1) + _n-1

. format %tq date

. tsset date time variable: date, 1987q1 to 2009q3 delta: 1 quarter

.

. regress inf D.u

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 1, 88) = 5.29 Model | 2.04834633 1 2.04834633 Prob > F = 0.0238 Residual | 34.0445426 88 .386869802 R-squared = 0.0568-------------+------------------------------ Adj R-squared = 0.0460 Total | 36.0928889 89 .405538077 Root MSE = .62199

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.5278638 .2294049 -2.30 0.024 -.9837578 -.0719699 | _cons | .7776213 .0658249 11.81 0.000 .646808 .9084345------------------------------------------------------------------------------

. estat dwatson

Durbin-Watson d-statistic( 2, 90) = .8872891

.

. * Prais-Winsten FGLS estimator

. prais inf D.u, twostep

Iteration 0: rho = 0.0000Iteration 1: rho = 0.5499

Prais-Winsten AR(1) regression -- twostep estimates

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 1, 88) = 10.00 Model | 2.67143323 1 2.67143323 Prob > F = 0.0021 Residual | 23.5015724 88 .267063323 R-squared = 0.1021-------------+------------------------------ Adj R-squared = 0.0919 Total | 26.1730056 89 .294078715 Root MSE = .51678

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.6994269 .2428048 -2.88 0.005 -1.18195 -.2169034 | _cons | .7858377 .1195633 6.57 0.000 .5482309 1.023445-------------+---------------------------------------------------------------- rho | .5498816------------------------------------------------------------------------------Durbin-Watson statistic (original) 0.887289Durbin-Watson statistic (transformed) 2.226467

. estimates store _2step

. prais inf D.u

Iteration 0: rho = 0.0000Iteration 1: rho = 0.5499Iteration 2: rho = 0.5581Iteration 3: rho = 0.5582Iteration 4: rho = 0.5583Iteration 5: rho = 0.5583

Prais-Winsten AR(1) regression -- iterated estimates

Source | SS df MS Number of obs = 90-------------+------------------------------ F( 1, 88) = 10.07 Model | 2.68739201 1 2.68739201 Prob > F = 0.0021 Residual | 23.4953766 88 .266992916 R-squared = 0.1026-------------+------------------------------ Adj R-squared = 0.0924 Total | 26.1827686 89 .294188411 Root MSE = .51671

------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- u | D1. | -.702358 .243006 -2.89 0.005 -1.185281 -.2194345 | _cons | .7861872 .1217517 6.46 0.000 .5442313 1.028143-------------+---------------------------------------------------------------- rho | .5582519------------------------------------------------------------------------------Durbin-Watson statistic (original) 0.887289Durbin-Watson statistic (transformed) 2.247467

. estimates store Iterate

. esttab _2step Iterate, compress se(%12.3f) b(%12.5f) gaps scalars(rss rho) mtitle("2-step" "Iterated") title("Dependent Variabl

Page 27: seriesdetiempo.files.wordpress.com€¦  · Web viewname:  log: C:\data\poe4stata\chap09.log. log type: text

> e: inf")

Dependent Variable: inf------------------------------------ (1) (2) 2-step Iterated ------------------------------------D.u -0.69943** -0.70236** (0.243) (0.243)

_cons 0.78584*** 0.78619*** (0.120) (0.122) ------------------------------------N 90 90 rss 23.50157 23.49538 rho 0.54988 0.55825 ------------------------------------Standard errors in parentheses* p<0.05, ** p<0.01, *** p<0.001

.

. * AR(1) using arima

. arima inf D.u, ar(1)

(setting optimization to BHHH)Iteration 0: log likelihood = -67.721343 Iteration 1: log likelihood = -67.684617 Iteration 2: log likelihood = -67.638447 Iteration 3: log likelihood = -67.617363 Iteration 4: log likelihood = -67.591967 (switching optimization to BFGS)Iteration 5: log likelihood = -67.580103 Iteration 6: log likelihood = -67.45729 Iteration 7: log likelihood = -67.456548 Iteration 8: log likelihood = -67.455947 Iteration 9: log likelihood = -67.455908 Iteration 10: log likelihood = -67.455902

ARIMA regression

Sample: 1987q2 - 2009q3 Number of obs = 90 Wald chi2(2) = 44.96Log likelihood = -67.4559 Prob > chi2 = 0.0000

------------------------------------------------------------------------------ | OPG inf | Coef. Std. Err. z P>|z| [95% Conf. Interval]-------------+----------------------------------------------------------------inf | u | D1. | -.7025681 .3167053 -2.22 0.027 -1.323299 -.0818371 | _cons | .7861493 .1398032 5.62 0.000 .51214 1.060159-------------+----------------------------------------------------------------ARMA | ar | L1. | .5588218 .0873961 6.39 0.000 .3875285 .7301151-------------+---------------------------------------------------------------- /sigma | .5109273 .0277513 18.41 0.000 .4565358 .5653188------------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero.

. log close name: <unnamed> log: C:\data\poe4stata\chap09.log log type: text closed on: 29 Oct 2012, 12:57:55---------------------------------------------------------------------------------------------------------------------------------