* Time Series ARIMA Models in Stata * Copyright 2013 by Ani Katchova clear all set more off use C:\Econometrics\Data\timeseries_ppi global global global global

ylist ppi dylist d.ppi time t lags 40

describe $time $ylist summarize $time $ylist * Set data as time series tset $time *tset $time, quarterly *gen time=_n * Plotting the data twoway (tsline $ylist) twoway (tsline d.$ylist) *twoway line $ylist $time *twoway line d.$ylist $time * Dickey-Fuller test for variable dfuller $ylist, drift regress lags(0) regress d.$ylist l.$ylist dfuller $ylist, trend regress lags(0) * dfuller $ylist, regress lags(2) * Dickey-Fuller test for differenced variable dfuller d.$ylist, drift regress lags(0) regress d.$dylist l.$dylist

* Correlogram, ACF, and PACF corrgram $ylist ac $ylist pac $ylist * pac d.$ylist, xscale(range(0 $lags)) yscale(range(-1 1)) corrgram d.$ylist ac d.$ylist pac d.$ylist

* ARIMA models * ARIMA(1,0,0) or AR(1) arima $ylist, arima(1,0,0) * ARIMA(2,0,0) or AR(2) arima $ylist, arima(2,0,0) * ARIMA(0,0,1) or MA(1) arima $ylist, arima(0,0,1) * ARIMA(1,0,1) or AR(1) MA(1) arima $ylist, arima(1,0,1)

* ARIMA on differenced variable arima $ylist, arima(1,1,0) arima $ylist, arima(0,1,1) arima $ylist, arima(1,1,1) arima $ylist, arima(1,1,3) arima $ylist, arima(2,1,3) *arima d.$ylist, ar(1/2) ma(1/3) *arima d.$ylist, ar(1 2) ma(1 2 3) * AIC arima estat arima estat

and BIC for model fit $ylist, arima(1,1,1) ic $ylist, arima(2,1,3) ic

* Detrending reg $ylist $time predict et, resid twoway line et $time dfuller et, drift regress lags(0) ac et pac et

___ ____ ____ ____ ____ (R) /__ / ____/ / ____/ ___/ / /___/ / /___/ 13.1 Statistics/Data Analysis

Copyright 1985-2013 StataCorp LP StataCorp 4905 Lakeway Drive College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 [email protected] 979-696-4601 (fax)

Single-user Stata perpetual license: Serial number: 301306233362 Licensed to: Ani Katchova University of Kentucky Notes: . doedit "C:\Econometrics\Programs\Time Series ARIMA Models in Stata.do" . do "C:\Econometrics\Programs\Time Series ARIMA Models in Stata.do" . * Time Series ARIMA Models in Stata . * Copyright 2013 by Ani Katchova . . clear all . set more off . . use C:\Econometrics\Data\timeseries_ppi . . global ylist ppi . global dylist d.ppi . global time t . global lags 40 . . describe $time $ylist storage display value variable name type format label variable label -----------------------------------------------------------------------------------------------t float %tq time in quarters ppi float %9.0g producer price index . summarize $time $ylist Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------t | 169 85 48.93022 1 169 ppi | 169 64.68154 30.26595 25.24 110.43 . . * Set data as time series . tset $time time variable: t, 1960q2 to 2002q2 delta: 1 quarter

. . . . .

*tset $time, quarterly *gen time=_n * Plotting the data twoway (tsline $ylist)

. twoway (tsline d.$ylist) . . . . .

*twoway line $ylist $time *twoway line d.$ylist $time * Dickey-Fuller test for variable dfuller $ylist, drift regress lags(0)

Dickey-Fuller test for unit root

Number of obs

=

168

----------- Z(t) has t-distribution ----------Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value -----------------------------------------------------------------------------Z(t) -0.258 -2.349 -1.654 -1.287 -----------------------------------------------------------------------------p-value for Z(t) = 0.3985 -----------------------------------------------------------------------------D.ppi | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | L1. | -.0006095 .0023653 -0.26 0.797 -.0052795 .0040604 | _cons | .5035691 .1682689 2.99 0.003 .1713461 .8357921 -----------------------------------------------------------------------------. regress d.$ylist l.$ylist Source | SS df MS -------------+-----------------------------Model | .056610774 1 .056610774 Residual | 141.521177 166 .852537211 -------------+-----------------------------Total | 141.577788 167 .847771184

Number of obs F( 1, 166) Prob > F R-squared Adj R-squared Root MSE

= 168 = 0.07 = 0.7970 = 0.0004 = -0.0056 = .92333

-----------------------------------------------------------------------------D.ppi | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | L1. | -.0006095 .0023653 -0.26 0.797 -.0052795 .0040604 | _cons | .5035691 .1682689 2.99 0.003 .1713461 .8357921 -----------------------------------------------------------------------------. . dfuller $ylist, trend regress lags(0) Dickey-Fuller test for unit root

Number of obs

=

168

---------- Interpolated Dickey-Fuller --------Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value -----------------------------------------------------------------------------Z(t) -0.793 -4.017 -3.441 -3.141 ------------------------------------------------------------------------------

MacKinnon approximate p-value for Z(t) = 0.9663 -----------------------------------------------------------------------------D.ppi | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | L1. | -.0083892 .0105782 -0.79 0.429 -.0292753 .012497 _trend | .0049572 .0065693 0.75 0.452 -.0080135 .0179279 _cons | .5860966 .2008708 2.92 0.004 .1894882 .9827051 -----------------------------------------------------------------------------. * dfuller $ylist, regress lags(2) . . * Dickey-Fuller test for differenced variable . dfuller d.$ylist, drift regress lags(0) Dickey-Fuller test for unit root

Number of obs

=

167

----------- Z(t) has t-distribution ----------Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value -----------------------------------------------------------------------------Z(t) -6.860 -2.349 -1.654 -1.287 -----------------------------------------------------------------------------p-value for Z(t) = 0.0000 -----------------------------------------------------------------------------D2.ppi | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | LD. | -.4452414 .0649017 -6.86 0.000 -.5733862 -.3170965 | _cons | .2067542 .0669501 3.09 0.002 .0745649 .3389435 -----------------------------------------------------------------------------. regress d.$dylist l.$dylist Source | SS df MS -------------+-----------------------------Model | 27.9528983 1 27.9528983 Residual | 98.0012621 165 .593947043 -------------+-----------------------------Total | 125.95416 166 .758760002

Number of obs F( 1, 165) Prob > F R-squared Adj R-squared Root MSE

= = = = = =

167 47.06 0.0000 0.2219 0.2172 .77068

-----------------------------------------------------------------------------D2.ppi | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | LD. | -.4452414 .0649017 -6.86 0.000 -.5733862 -.3170965 | _cons | .2067542 .0669501 3.09 0.002 .0745649 .3389435 -----------------------------------------------------------------------------. . . * Correlogram, ACF, and PACF . corrgram $ylist -1 0 1 -1 0 1 LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor] ------------------------------------------------------------------------------1 0.9895 0.9994 168.44 0.0000 |------|------2 0.9783 -0.5553 334.05 0.0000 |----------|

3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

0.9656 0.9518 0.9373 0.9228 0.9083 0.8939 0.8797 0.8657 0.8517 0.8379 0.8243 0.8101 0.7954 0.7804 0.7650 0.7489 0.7324 0.7156 0.6983 0.6808 0.6631 0.6451 0.6272 0.6092 0.5911 0.5728 0.5544 0.5362 0.5178 0.4993 0.4808 0.4623 0.4435 0.4245 0.4056 0.3867 0.3676 0.3485

-0.0692 -0.2094 0.0234 0.1250 -0.1527 0.1135 0.2102 0.0490 -0.1685 -0.0579 -0.0363 -0.2178 -0.0198 -0.0877 0.1742 -0.1198 -0.0597 0.0365 -0.0314 0.0198 -0.1010 0.0294 -0.1114 0.0968 -0.0414 0.0342 -0.2174 0.1715 -0.0602 -0.1370 0.0286 0.1751 0.0050 -0.1556 0.0645 -0.1011 0.0269 -0.0546

496.37 655.05 809.87 960.86 1108 1251.5 1391.2 1527.5 1660.1 1789.4 1915.2 2037.6 2156.3 2271.4 2382.6 2490 2593.3 2692.6 2787.9 2879 2966 3048.9 3127.9 3202.9 3274 3341.2 3404.7 3464.4 3520.6 3573.2 3622.3 3668.1 3710.5 3749.6 3785.7 3818.6 3848.7 3875.9

0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000

|------|------|------|------|------|------|------|-----|-----|-----|-----|-----|-----|-----|-----|----|----|----|----|----|----|----|----|---|---|---|---|---|---|--|--|--|--|--|--|--|-|--

| -| | | -| | || -| | | -| | | || | | | | | | | | | | -| || -| | || -| | | | |

. ac $ylist . pac $ylist . * pac d.$ylist, xscale(range(0 $lags)) yscale(range(-1 1)) . . corrgram d.$ylist -1 0 1 -1 0 1 LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor] ------------------------------------------------------------------------------1 0.5525 0.5548 52.21 0.0000 |---|---2 0.3355 0.0655 71.571 0.0000 |-| 3 0.3194 0.2030 89.228 0.0000 |-|4 0.2165 -0.0311 97.389 0.0000 || 5 0.0859 -0.1299 98.682 0.0000 | -| 6 0.1533 0.1487 102.82 0.0000 ||7 0.0821 -0.1177 104.02 0.0000 | | 8 -0.0778 -0.2129 105.1 0.0000 | -| 9 -0.0795 -0.0509 106.23 0.0000 | | 10 0.0232 0.1663 106.33 0.0000 | |11 -0.0078 0.0545 106.34 0.0000 | | 12 -0.0061 0.0323 106.35 0.0000 | | 13 0.1122 0.2109 108.67 0.0000 | |-

14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

0.0691 0.0479 0.0386 0.0836 0.0771 0.0763 0.0849 0.0486 0.0330 0.0473 0.0891 0.0226 0.0149 0.0043 0.0763 -0.0228 0.0022 0.0535 0.0229 -0.0838 -0.0343 -0.0288 -0.0940 -0.0228 -0.0025 -0.0735 -0.0360

0.0086 0.0745 -0.1857 0.1063 0.0449 -0.0512 0.0160 -0.0344 0.0851 -0.0460 0.0962 -0.1151 0.0246 -0.0531 0.1986 -0.1934 0.0418 0.1147 -0.0540 -0.1975 -0.0243 0.1301 -0.0917 0.0748 -0.0584 0.0244 0.0704

109.56 109.99 110.27 111.59 112.72 113.84 115.23 115.69 115.9 116.34 117.91 118.01 118.06 118.06 119.25 119.36 119.36 119.96 120.07 121.55 121.8 121.98 123.9 124.01 124.01 125.21 125.49

0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000

| | | | | | | | | | | | | | | | | | | | | | | | | | |

| | -| | | | | | | | | | | | |-| | | | -| | || | | | |

. ac d.$ylist . pac d.$ylist . . . * ARIMA models . . * ARIMA(1,0,0) or AR(1) . arima $ylist, arima(1,0,0) (setting optimization to BHHH) Iteration 0: log likelihood = -491.20599 Iteration 1: log likelihood = -310.90254 Iteration 2: log likelihood = -263.61577 Iteration 3: log likelihood = -257.6946 Iteration 4: log likelihood = -251.94673 (switching optimization to BFGS) BFGS stepping has contracted, resetting BFGS Hessian (0) Iteration 5: log likelihood = -250.18651 Iteration 6: log likelihood = -248.50278 (backed up) Iteration 7: log likelihood = -248.43811 (backed up) Iteration 8: log likelihood = -248.28376 Iteration 9: log likelihood = -248.23395 Iteration 10: log likelihood = -248.2033 Iteration 11: log likelihood = -248.20233 Iteration 12: log likelihood = -248.20219 Iteration 13: log likelihood = -248.20219 ARIMA regression Sample:

1960q2 - 2002q2

Log likelihood = -248.2022

Number of obs Wald chi2(1) Prob > chi2

= 169 = 114472.46 = 0.0000

-----------------------------------------------------------------------------| OPG ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | 64.37178 37.6672 1.71 0.087 -9.454583 138.1981 -------------+---------------------------------------------------------------ARMA | ar | L1. | .999644 .0029546 338.34 0.000 .9938531 1.005435 -------------+---------------------------------------------------------------/sigma | 1.028674 .0465222 22.11 0.000 .9374919 1.119856 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . . * ARIMA(2,0,0) or AR(2) . arima $ylist, arima(2,0,0) (setting optimization to BHHH) Iteration 0: log likelihood = -540.01439 Iteration 1: log likelihood = -269.19218 Iteration 2: log likelihood = -213.48945 Iteration 3: log likelihood = -205.56464 Iteration 4: log likelihood = -205.08471 (switching optimization to BFGS) Iteration 5: log likelihood = -205.06581 BFGS stepping has contracted, resetting BFGS Hessian (0) Iteration 6: log likelihood = -203.35251 Iteration 7: log likelihood = -203.31839 (backed up) Iteration 8: log likelihood = -203.23379 (backed up) Iteration 9: log likelihood = -203.19227 (backed up) Iteration 10: log likelihood = -203.08655 Iteration 11: log likelihood = -203.08341 Iteration 12: log likelihood = -203.08335 Iteration 13: log likelihood = -203.08311 Iteration 14: log likelihood = -203.07929 (switching optimization to BHHH) Iteration 15: log likelihood = -203.07434 Iteration 16: log likelihood = -203.07423 Iteration 17: log likelihood = -203.07417 Iteration 18: log likelihood = -203.07413 Iteration 19: log likelihood = -203.0741 (switching optimization to BFGS) Iteration 20: log likelihood = -203.0741 Iteration 21: log likelihood = -203.07405 Iteration 22: log likelihood = -203.07404 ARIMA regression Sample:

1960q2 - 2002q2

Log likelihood =

-203.074

Number of obs Wald chi2(2) Prob > chi2

= 169 = 215776.39 = 0.0000

-----------------------------------------------------------------------------| OPG ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | 64.1898 33.4097 1.92 0.055 -1.292012 129.6716 -------------+----------------------------------------------------------------

ARMA

| ar | L1. | 1.64239 .0423243 38.80 0.000 1.559436 1.725344 L2. | -.643024 .042334 -15.19 0.000 -.7259971 -.560051 -------------+---------------------------------------------------------------/sigma | .7852491 .0315236 24.91 0.000 .723464 .8470342 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . . * ARIMA(0,0,1) or MA(1) . arima $ylist, arima(0,0,1) (setting optimization to BHHH) Iteration 0: log likelihood = -746.78704 Iteration 1: log likelihood = -741.87198 Iteration 2: log likelihood = -711.48185 Iteration 3: log likelihood = -705.1604 Iteration 4: log likelihood = -704.58739 (switching optimization to BFGS) Iteration 5: log likelihood = -703.17035 Iteration 6: log likelihood = -703.02592 Iteration 7: log likelihood = -702.48345 Iteration 8: log likelihood = -702.48125 Iteration 9: log likelihood = -702.48107 Iteration 10: log likelihood = -702.48107 ARIMA regression Sample:

1960q2 - 2002q2

Log likelihood = -702.4811

Number of obs Wald chi2(1) Prob > chi2

= = =

169 0.00 0.9982

-----------------------------------------------------------------------------| OPG ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | 64.69614 2.372253 27.27 0.000 60.04661 69.34567 -------------+---------------------------------------------------------------ARMA | ma | L1. | 1.000001 454.6842 0.00 0.998 -890.1648 892.1648 -------------+---------------------------------------------------------------/sigma | 15.21932 3459.994 0.00 0.498 0 6796.683 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . . * ARIMA(1,0,1) or AR(1) MA(1) . arima $ylist, arima(1,0,1) (setting optimization to BHHH) Iteration 0: log likelihood = -314.922 Iteration 1: log likelihood = -221.91078 Iteration 2: log likelihood = -218.06832 Iteration 3: log likelihood = -217.3549 Iteration 4: log likelihood = -216.97856 (switching optimization to BFGS)

Iteration 5: log likelihood = -216.55112 Iteration 6: log likelihood = -216.53921 Iteration 7: log likelihood = -216.46466 Iteration 8: log likelihood = -216.43792 Iteration 9: log likelihood = -216.41851 BFGS stepping has contracted, resetting BFGS Hessian (0) Iteration 10: log likelihood = -216.40975 Iteration 11: log likelihood = -216.40969 (backed up) Iteration 12: log likelihood = -216.40937 (backed up) Iteration 13: log likelihood = -216.40936 (backed up) Iteration 14: log likelihood = -216.40908 (switching optimization to BHHH) Iteration 15: log likelihood = -216.40907 Iteration 16: log likelihood = -216.40902 Iteration 17: log likelihood = -216.40902 Iteration 18: log likelihood = -216.40902 Iteration 19: log likelihood = -216.40902 (switching optimization to BFGS) Iteration 20: log likelihood = -216.40902 Iteration 21: log likelihood = -216.40902 ARIMA regression Sample:

1960q2 - 2002q2

Log likelihood =

Number of obs Wald chi2(2) Prob > chi2

-216.409

= = =

169 71769.40 0.0000

-----------------------------------------------------------------------------| OPG ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | 64.66698 37.08724 1.74 0.081 -8.022682 137.3566 -------------+---------------------------------------------------------------ARMA | ar | L1. | .9994282 .0037574 265.99 0.000 .9920638 1.006793 | ma | L1. | .5337269 .0646546 8.26 0.000 .4070062 .6604477 -------------+---------------------------------------------------------------/sigma | .8504691 .0357356 23.80 0.000 .7804286 .9205096 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . . * ARIMA on differenced variable . arima $ylist, arima(1,1,0) (setting optimization to BHHH) Iteration 0: log likelihood = Iteration 1: log likelihood = Iteration 2: log likelihood = Iteration 3: log likelihood = Iteration 4: log likelihood =

-193.39863 -193.39512 -193.3948 -193.39477 -193.39476

ARIMA regression Sample:

1960q3 - 2002q2

Log likelihood = -193.3948

Number of obs Wald chi2(1) Prob > chi2

= = =

168 158.00 0.0000

-----------------------------------------------------------------------------| OPG D.ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | .455886 .1389951 3.28 0.001 .1834606 .7283114 -------------+---------------------------------------------------------------ARMA | ar | L1. | .5522606 .0439362 12.57 0.000 .4661473 .638374 -------------+---------------------------------------------------------------/sigma | .7642335 .0268682 28.44 0.000 .7115728 .8168942 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . arima $ylist, arima(0,1,1) (setting optimization to BHHH) Iteration 0: log likelihood = -203.90039 Iteration 1: log likelihood = -201.06213 Iteration 2: log likelihood = -199.55602 Iteration 3: log likelihood = -199.51215 Iteration 4: log likelihood = -199.50049 (switching optimization to BFGS) Iteration 5: log likelihood = -199.49738 Iteration 6: log likelihood = -199.4962 Iteration 7: log likelihood = -199.49618 Iteration 8: log likelihood = -199.49618 ARIMA regression Sample:

1960q3 - 2002q2

Number of obs Wald chi2(1) Prob > chi2

Log likelihood = -199.4962

= = =

168 59.27 0.0000

-----------------------------------------------------------------------------| OPG D.ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | .4653579 .0925199 5.03 0.000 .2840221 .6466936 -------------+---------------------------------------------------------------ARMA | ma | L1. | .4871653 .0632792 7.70 0.000 .3631404 .6111903 -------------+---------------------------------------------------------------/sigma | .792734 .0282909 28.02 0.000 .7372848 .8481831 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . arima $ylist, arima(1,1,1) (setting optimization to BHHH) Iteration 0: log likelihood = Iteration 1: log likelihood = Iteration 2: log likelihood = Iteration 3: log likelihood = Iteration 4: log likelihood =

-195.30794 -193.57513 -192.85506 -192.63975 -192.60361

(switching optimization to BFGS) Iteration 5: log likelihood = -192.59217 Iteration 6: log likelihood = -192.58683 Iteration 7: log likelihood = -192.58666 Iteration 8: log likelihood = -192.58662 Iteration 9: log likelihood = -192.58661 ARIMA regression Sample:

1960q3 - 2002q2

Log likelihood = -192.5866

Number of obs Wald chi2(2) Prob > chi2

= = =

168 223.58 0.0000

-----------------------------------------------------------------------------| OPG D.ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | .4396062 .1784286 2.46 0.014 .0898926 .7893198 -------------+---------------------------------------------------------------ARMA | ar | L1. | .7244549 .0843673 8.59 0.000 .559098 .8898118 | ma | L1. | -.2547127 .1049892 -2.43 0.015 -.4604877 -.0489377 -------------+---------------------------------------------------------------/sigma | .7604755 .0271034 28.06 0.000 .7073538 .8135971 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . arima $ylist, arima(1,1,3) (setting optimization to BHHH) Iteration 0: log likelihood = -194.26907 Iteration 1: log likelihood = -191.72288 Iteration 2: log likelihood = -191.26547 Iteration 3: log likelihood = -190.63246 Iteration 4: log likelihood = -190.57906 (switching optimization to BFGS) Iteration 5: log likelihood = -190.51825 Iteration 6: log likelihood = -190.48829 Iteration 7: log likelihood = -190.48325 Iteration 8: log likelihood = -190.48277 Iteration 9: log likelihood = -190.48263 Iteration 10: log likelihood = -190.48262 ARIMA regression Sample:

1960q3 - 2002q2

Log likelihood = -190.4826

Number of obs Wald chi2(4) Prob > chi2

= = =

168 232.96 0.0000

-----------------------------------------------------------------------------| OPG D.ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | .4322576 .1995924 2.17 0.030 .0410637 .8234516 -------------+---------------------------------------------------------------ARMA |

ar | L1. | .7333678 .1649844 4.45 0.000 .4100044 1.056731 | ma | L1. | -.2410375 .152068 -1.59 0.113 -.5390852 .0570102 L2. | -.1082348 .120398 -0.90 0.369 -.3442106 .1277411 L3. | .1217198 .0982355 1.24 0.215 -.0708182 .3142578 -------------+---------------------------------------------------------------/sigma | .7508351 .0270494 27.76 0.000 .6978193 .8038509 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . arima $ylist, arima(2,1,3) (setting optimization to BHHH) Iteration 0: log likelihood = -194.25963 Iteration 1: log likelihood = -192.39214 Iteration 2: log likelihood = -189.95567 Iteration 3: log likelihood = -188.65375 Iteration 4: log likelihood = -188.54886 (switching optimization to BFGS) Iteration 5: log likelihood = -188.32605 Iteration 6: log likelihood = -188.24463 Iteration 7: log likelihood = -188.22156 Iteration 8: log likelihood = -188.22014 Iteration 9: log likelihood = -188.21983 Iteration 10: log likelihood = -188.21968 Iteration 11: log likelihood = -188.21966 Iteration 12: log likelihood = -188.21966 ARIMA regression Sample:

1960q3 - 2002q2

Log likelihood = -188.2197

Number of obs Wald chi2(5) Prob > chi2

= = =

168 1184.64 0.0000

-----------------------------------------------------------------------------| OPG D.ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | .440504 .1610542 2.74 0.006 .1248436 .7561645 -------------+---------------------------------------------------------------ARMA | ar | L1. | 1.518925 .1653175 9.19 0.000 1.194909 1.842942 L2. | -.7083138 .1550126 -4.57 0.000 -1.012133 -.4044948 | ma | L1. | -1.05002 .1913142 -5.49 0.000 -1.424989 -.6750514 L2. | .2100205 .1401272 1.50 0.134 -.0646237 .4846648 L3. | .3180096 .0809085 3.93 0.000 .1594318 .4765873 -------------+---------------------------------------------------------------/sigma | .7398845 .0283695 26.08 0.000 .6842813 .7954877 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . . *arima d.$ylist, ar(1/2) ma(1/3)

. *arima d.$ylist, ar(1 2) ma(1 2 3) . . * AIC and BIC for model fit . arima $ylist, arima(1,1,1) (setting optimization to BHHH) Iteration 0: log likelihood = -195.30794 Iteration 1: log likelihood = -193.57513 Iteration 2: log likelihood = -192.85506 Iteration 3: log likelihood = -192.63975 Iteration 4: log likelihood = -192.60361 (switching optimization to BFGS) Iteration 5: log likelihood = -192.59217 Iteration 6: log likelihood = -192.58683 Iteration 7: log likelihood = -192.58666 Iteration 8: log likelihood = -192.58662 Iteration 9: log likelihood = -192.58661 ARIMA regression Sample:

1960q3 - 2002q2

Number of obs Wald chi2(2) Prob > chi2

Log likelihood = -192.5866

= = =

168 223.58 0.0000

-----------------------------------------------------------------------------| OPG D.ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | .4396062 .1784286 2.46 0.014 .0898926 .7893198 -------------+---------------------------------------------------------------ARMA | ar | L1. | .7244549 .0843673 8.59 0.000 .559098 .8898118 | ma | L1. | -.2547127 .1049892 -2.43 0.015 -.4604877 -.0489377 -------------+---------------------------------------------------------------/sigma | .7604755 .0271034 28.06 0.000 .7073538 .8135971 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . estat ic Akaike's information criterion and Bayesian information criterion ----------------------------------------------------------------------------Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------. | 168 . -192.5866 4 393.1732 405.6691 ----------------------------------------------------------------------------Note: N=Obs used in calculating BIC; see [R] BIC note . arima $ylist, arima(2,1,3) (setting optimization to BHHH) Iteration 0: log likelihood = Iteration 1: log likelihood = Iteration 2: log likelihood = Iteration 3: log likelihood = Iteration 4: log likelihood =

-194.25963 -192.39214 -189.95567 -188.65375 -188.54886

(switching optimization to BFGS) Iteration 5: log likelihood = -188.32605 Iteration 6: log likelihood = -188.24463 Iteration 7: log likelihood = -188.22156 Iteration 8: log likelihood = -188.22014 Iteration 9: log likelihood = -188.21983 Iteration 10: log likelihood = -188.21968 Iteration 11: log likelihood = -188.21966 Iteration 12: log likelihood = -188.21966 ARIMA regression Sample:

1960q3 - 2002q2

Log likelihood = -188.2197

Number of obs Wald chi2(5) Prob > chi2

= = =

168 1184.64 0.0000

-----------------------------------------------------------------------------| OPG D.ppi | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------ppi | _cons | .440504 .1610542 2.74 0.006 .1248436 .7561645 -------------+---------------------------------------------------------------ARMA | ar | L1. | 1.518925 .1653175 9.19 0.000 1.194909 1.842942 L2. | -.7083138 .1550126 -4.57 0.000 -1.012133 -.4044948 | ma | L1. | -1.05002 .1913142 -5.49 0.000 -1.424989 -.6750514 L2. | .2100205 .1401272 1.50 0.134 -.0646237 .4846648 L3. | .3180096 .0809085 3.93 0.000 .1594318 .4765873 -------------+---------------------------------------------------------------/sigma | .7398845 .0283695 26.08 0.000 .6842813 .7954877 -----------------------------------------------------------------------------Note: The test of the variance against zero is one sided, and the two-sided confidence interval is truncated at zero. . estat ic Akaike's information criterion and Bayesian information criterion ----------------------------------------------------------------------------Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------. | 168 . -188.2197 7 390.4393 412.3071 ----------------------------------------------------------------------------Note: N=Obs used in calculating BIC; see [R] BIC note . . * Detrending . reg $ylist $time Source | SS df MS -------------+-----------------------------Model | 146108.864 1 146108.864 Residual | 7783.84083 167 46.6098253 -------------+-----------------------------Total | 153892.705 168 916.028007

Number of obs F( 1, 167) Prob > F R-squared Adj R-squared Root MSE

= 169 = 3134.72 = 0.0000 = 0.9494 = 0.9491 = 6.8271

-----------------------------------------------------------------------------ppi | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+---------------------------------------------------------------t | .6027073 .0107648 55.99 0.000 .5814546 .62396 _cons | 13.45142 1.055008 12.75 0.000 11.36855 15.53429 -----------------------------------------------------------------------------. predict et, resid . twoway line et $time . dfuller et, drift regress lags(0) Dickey-Fuller test for unit root

Number of obs

=

168

----------- Z(t) has t-distribution ----------Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value -----------------------------------------------------------------------------Z(t) -0.797 -2.349 -1.654 -1.287 -----------------------------------------------------------------------------p-value for Z(t) = 0.2133 -----------------------------------------------------------------------------D.et | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------et | L1. | -.0084022 .0105447 -0.80 0.427 -.0292212 .0124168 | _cons | -.137826 .0711187 -1.94 0.054 -.2782398 .0025878 -----------------------------------------------------------------------------. ac et . pac et

1960q1

-4

20

40

-2

producer price index 60 80

producer price index, D 0 2

100

4

120

. . end of do-file

1970q1

1980q1 time in quarters

1990q1

2000q1

1960q1

1970q1

1980q1 time in quarters

1990q1

2000q1

1.00

1.00

-0.50

Partial autocorrelations of ppi 0.00 0.50

Autocorrelations of ppi -0.50 0.00 0.50 -1.00 0

10

20 Lag

30

40

0

Bartlett's formula for MA(q) 95% confidence bands

10

20 Lag

30

40

0

10

20 Lag

30

-0.20

-0.20

Partial autocorrelations of D.ppi 0.00 0.20 0.40

Autocorrelations of D.ppi 0.00 0.20 0.40

0.60

0.60

95% Confidence bands [se = 1/sqrt(n)]

40

0

Bartlett's formula for MA(q) 95% confidence bands

20 Lag

30

40

Autocorrelations of et -0.50 0.00 0.50

1.00

20 10 Residuals 0

-1.00

-10

0

1960q1

10

95% Confidence bands [se = 1/sqrt(n)]

1970q1

1980q1 time in quarters

1990q1

2000q1

10

20 Lag

Bartlett's formula for MA(q) 95% confidence bands

30

40

1.00 Partial autocorrelations of et 0.00 0.50 -0.50 0

10

95% Confidence bands [se = 1/sqrt(n)]

20 Lag

30

40

Time Series ARIMA Models Stata Program and Output.pdf ...

Set data as time series . tset $time. time variable: t, 1960q2 to 2002q2. delta: 1 quarter. Page 3 of 18. Time Series ARIMA Models Stata Program and Output.pdf.

42KB Sizes 4 Downloads 273 Views

Recommend Documents

Time Series ARIMA Models SAS Program and Output.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Time Series ARIMA Models SAS Program and Output.pdf. Time Series ARIMA Models SAS Program and Output.pdf. Op

Time Series ARIMA Models R Program and Output.pdf
Page 2 of 11. arima(d.Y, order = c(1,0,1)). # ARIMA(1,1,3). arima(d.Y, order = c(1,0,3)). # ARIMA(2,1,3). arima(d.Y, order = c(2,0,3)). # ARIMA(1,0,1) forecasting. mydata.arima101

Time Series ARIMA Models SAS Program and Output.pdf
Retrying... Time Series ARIMA Models SAS Program and Output.pdf. Time Series ARIMA Models SAS Program and Output.pdf. Open. Extract. Open with. Sign In.

Time Series ARIMA Models R Program and Output.pdf
Time Series ARIMA Models R Program and Output.pdf. Time Series ARIMA Models R Program and Output.pdf. Open. Extract. Open with. Sign In. Main menu.

Time Series ARIMA Models Example.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Time Series ...

Bivariate Probit and Logit Models Stata Program and Output.pdf ...
use C:\Econometrics\Data\bivariate_health. global y1list ... storage display value. variable ... Bivariate Probit and Logit Models Stata Program and Output.pdf.

Time Series ARIMA Models.pdf
Autoregressive (AR) and moving average (MA) models correct for violations of this white. noise assumption. -4 -2. 0. 2. white_noise. 0 10 20 30 40 50. _t. Page 4 of 22. Time Series ARIMA Models.pdf. Time Series ARIMA Models.pdf. Open. Extract. Open w

The Bootstrap for Regression and Time-Series Models
Corresponding to a bootstrap resample χ∗ is a bootstrap replication ...... univariate bootstrap estimation of bias and variance for an arbitrary statistic, theta. It.

pdf-0699\time-series-and-dynamic-models-themes-in-modern ...
... EBOOK : TIME SERIES AND DYNAMIC MODELS (THEMES IN. MODERN ECONOMETRICS) BY CHRISTIAN GOURIEROUX, ALAIN. MONFORT PDF. Page 1 ...

Time Series with State Space Models - R/Finance conference
1 Introduction to state space models and the dlm package. 2 DLM estimation and ... Time Series Analysis by State Space Methods. Oxford University Press, 2001 ...

Time Series with State Space Models - R/Finance conference
Time Series with State Space Models. R/Finance 2012. 2 / 90 ...... http://moderntoolmaking.blogspot.com/2011/11/time-series-cross-validation-2.html. Ability to ...

Estimating panel time series models with ...
... xit are correlated with (from the econometrician's perspective) unobserved .... Nation Industrial Development Organisation's Industrial Statistics database ( ...

Time series
Time series. Exercise session: 2. June 2, 2017 keywords: Autocovariance functions, autocorrelation function, partial autocorrelation func- tion. Estimation of the ...

Probit and Logit Models Program and Output.pdf
Coefficientsa. Page 3 of 7. Probit and Logit Models Program and Output.pdf. Probit and Logit Models Program and Output.pdf. Open. Extract. Open with. Sign In.

Bivariate Probit and Logit Models SAS Program and Output.pdf ...
Variable N Mean Std Dev Minimum Maximum. hlthe. dmdu. age. linc. ndisease. 5574. 5574. 5574. 5574. 5574. 0.5412630. 0.6713312. 25.5761339. 8.6969290. 11.2052651. 0.4983392. 0.4697715. 16.7301105. 1.2205920. 6.7889585. 0. 0. 0.0253251. 0. 0. 1.0000000

economic time series
certain non-linear systems is discussed in Wiener (1958), while the statistical theory ...... Price Series for International Telephone and Telegraph. 1r/2 l2. - 02748.