econ 300 econometrics problem set 6 - dennis … · econ 300 econometrics problem set 6 ... use an...

11
ECON 300 Econometrics Problem Set 6 Dennis C. Plott * University of Illinois at Chicago Department of Economics Fall 2014 * Email: [email protected] 1

Upload: phunghuong

Post on 26-Aug-2018

264 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

ECON 300

Econometrics

Problem Set 6

Dennis C. Plott∗

University of Illinois at Chicago

Department of Economics

Fall 2014

∗Email: [email protected]

1

Page 2: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

Name: Dennis C. Plott

General Instructions

1. Due: Wednesday 19rd November 2014 by 4:00 p.m.

2. Read and follow all instructions/directions carefully; an inability to do as such will result in points beingdeducted.

3. Only problem sets submitted in person will be accepted.

4. Do not copy.

• Be very careful when using sources outside of the recommended materials.

• Use your own words; this will better prepare you for the exams.

• Although not trivial, the problem sets are a relatively small portion of your final grade and areintended to help prepare you for the exams. If you are struggling with particular questions and/ortopics, then you are made aware of what you need to study.

5. All problems sets submitted must be stapled, typed, and well formatted. Note: non-Stata graphs, ifrequired, may be drawn, but must be done so neatly. Do not use white out or similar products.

6. Show all of your work. Support your answers as thoroughly as possible; i.e., graphically, conceptually,and mathematically. Note: this may not be feasible for all questions asked. State and define any conceptutilized and list and name any equation used. If required, label all graphs fully and completely; i.e., axes,intersections, curves, etc.

• Provide a complete Stata do-file (i.e., not a log file and not the output) at the end of the problem seton a separate page using the lstlisting environment.

Original Score (%)

Adjustment (%)

Actual Score (%)

2

Page 3: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

1. The first reported case in the recent Ebola outbreak ravaging west Africa dates back to December 2013in a forested area of Guinea near the border with Liberia and Sierra Leone. However, Ebola is not justa medical emergency, but an economic one. Sick people cannot work; fear of sickness keeps others fromcoming to work. Transportation and travel is disrupted. The Economist1 reports on how mobile phonerecords should be used as a tool to fight the spread of Ebola. However, even without “big data”, modelscan be constructed to uncover the dynamics of the disease and forecast potential outcomes. The datasetebola.csv reports the number of deaths in Liberia and comes from the World Health Organization (WHO),the public health arm of the United Nations.

(a) [5 points] Load the .csv file into Stata. As always, use the summarize command to ensure the dataloaded correctly.

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------

obs | 68 52.5 19.77372 19 86

deaths | 68 1277.941 881.8167 34 2770

(b) [5 points] Set the variable obs as the time variable in Stata.

time variable: obs, 19 to 86

delta: 1 unit

(c) [20 points] Plot and label the time series graph of deaths in Stata. Plot the sample ACF of thedeaths series. Explain what it means for a series to be stationary. What are the potential consequencesof using non-stationary data. Does the series deaths look stationary? Explain.

1The Economist “Ebola and Big Data: Call for Help” 25 October 2014

3

Page 4: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

(d) [20 points] Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths.What is the purpose of differencing a series? Explain. If required, difference the deaths series theappropriate number of times to achieve stationarity. Report the results of the augmented Dickey-Fullertests.

Selection-order criteria

Sample: 23 - 86 Number of obs = 64

+---------------------------------------------------------------------------+

|lag | LL LR df p FPE AIC HQIC SBIC |

|----+----------------------------------------------------------------------|

| 0 | -522.161 737408 16.3488 16.3621 16.3825 |

| 1 | -323.091 398.14* 1 0.000 1512.06* 10.1591* 10.1857* 10.2265* |

| 2 | -323.028 .1262 1 0.722 1557.06 10.1884 10.2282 10.2896 |

| 3 | -323.018 .01985 1 0.888 1606.14 10.2193 10.2725 10.3542 |

| 4 | -322.867 .30158 1 0.583 1649.59 10.2458 10.3123 10.4145 |

+---------------------------------------------------------------------------+

4

Page 5: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

Endogenous: deaths

Exogenous: _cons

Augmented Dickey-Fuller test for unit root Number of obs = 66

---------- Interpolated Dickey-Fuller ---------

Test 1% Critical 5% Critical 10% Critical

Statistic Value Value Value

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

Z(t) 1.024 -3.558 -2.917 -2.594

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

MacKinnon approximate p-value for Z(t) = 0.9945

Selection-order criteria

Sample: 24 - 86 Number of obs = 63

+---------------------------------------------------------------------------+

|lag | LL LR df p FPE AIC HQIC SBIC |

|----+----------------------------------------------------------------------|

| 0 | -318.442 1484.95* 10.141* 10.1544* 10.175* |

| 1 | -318.392 .09991 1 0.752 1530.45 10.1712 10.1979 10.2392 |

| 2 | -318.391 .00257 1 0.960 1579.83 10.2029 10.243 10.3049 |

| 3 | -318.302 .1781 1 0.673 1626.35 10.2318 10.2853 10.3679 |

| 4 | -318.264 .07592 1 0.783 1677.06 10.2623 10.3292 10.4324 |

+---------------------------------------------------------------------------+

Endogenous: D.deaths

Exogenous: _cons

Dickey-Fuller test for unit root Number of obs = 66

---------- Interpolated Dickey-Fuller ---------

Test 1% Critical 5% Critical 10% Critical

Statistic Value Value Value

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

Z(t) -8.135 -3.558 -2.917 -2.594

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

MacKinnon approximate p-value for Z(t) = 0.0000

Selection-order criteria

Sample: 25 - 86 Number of obs = 62

+---------------------------------------------------------------------------+

|lag | LL LR df p FPE AIC HQIC SBIC |

|----+----------------------------------------------------------------------|

| 0 | -336.752 3156.89 10.8952 10.9087 10.9295 |

| 1 | -327.22 19.063 1 0.000 2397.44 10.62 10.647 10.6886 |

| 2 | -324.056 6.3281 1 0.012 2235.9 10.5502 10.5906 10.6531 |

| 3 | -321.1 5.9128 1 0.015 2099.38 10.4871 10.541 10.6243 |

| 4 | -313.722 14.756* 1 0.000 1709.28* 10.2814* 10.3487* 10.4529* |

+---------------------------------------------------------------------------+

Endogenous: D2.deaths

Exogenous: _cons

Augmented Dickey-Fuller test for unit root Number of obs = 61

---------- Interpolated Dickey-Fuller ---------

Test 1% Critical 5% Critical 10% Critical

Statistic Value Value Value

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

Z(t) -5.885 -3.565 -2.921 -2.596

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

MacKinnon approximate p-value for Z(t) = 0.0000

(e) [20 points] True, False, or Uncertain: a time series variable should always be differenced. Explain.

False.

5

Page 6: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

(f) [30 points] Model the deaths series with at least two ARIMA models. Use the AIC and BICsummary measures to determine the “better” model. Report your results, including the diagnosticpost-estimation tests; i.e., check to see if the residuals are white noise, etc. Explain, step-by-step howyou modeled the series with ARIMA. Provide/Show all of your work.

ARIMA regression

Sample: 20 - 86 Number of obs = 67

Wald chi2(1) = 22.62

Log likelihood = -333.5369 Prob > chi2 = 0.0000

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

| OPG

D.deaths | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

deaths |

6

Page 7: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

_cons | 39.79707 8.269928 4.81 0.000 23.58831 56.00583

-------------+----------------------------------------------------------------

ARMA |

ma |

L5. | .4110598 .086426 4.76 0.000 .2416678 .5804517

-------------+----------------------------------------------------------------

/sigma | 34.89419 2.474219 14.10 0.000 30.04481 39.74357

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

Note: The test of the variance against zero is one sided, and the two-sided

confidence interval is truncated at zero.

Akaike’s information criterion and Bayesian information criterion

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

Model | Obs ll(null) ll(model) df AIC BIC

-------------+---------------------------------------------------------------

. | 67 . -333.5369 3 673.0739 679.6879

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

Note: N=Obs used in calculating BIC; see [R] BIC note

ARIMA regression

Sample: 20 - 86 Number of obs = 67

Wald chi2(1) = 14.95

Log likelihood = -334.6324 Prob > chi2 = 0.0001

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

| OPG

D.deaths | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

deaths |

_cons | 39.34149 8.731067 4.51 0.000 22.22892 56.45407

-------------+----------------------------------------------------------------

ARMA |

ar |

L5. | .3037407 .078566 3.87 0.000 .1497541 .4577272

-------------+----------------------------------------------------------------

/sigma | 35.58659 2.624864 13.56 0.000 30.44195 40.73123

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

Note: The test of the variance against zero is one sided, and the two-sided

confidence interval is truncated at zero.

Akaike’s information criterion and Bayesian information criterion

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

Model | Obs ll(null) ll(model) df AIC BIC

-------------+---------------------------------------------------------------

. | 67 . -334.6324 3 675.2649 681.879

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

Note: N=Obs used in calculating BIC; see [R] BIC note

ARIMA regression

Sample: 20 - 86 Number of obs = 67

Wald chi2(2) = 20.00

Log likelihood = -333.1831 Prob > chi2 = 0.0000

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

| OPG

D.deaths | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

deaths |

7

Page 8: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

_cons | 40.37338 7.690992 5.25 0.000 25.29931 55.44745

-------------+----------------------------------------------------------------

ARMA |

ar |

L5. | -.2684758 .3665006 -0.73 0.464 -.9868038 .4498523

|

ma |

L5. | .6463172 .3691646 1.75 0.080 -.0772322 1.369867

-------------+----------------------------------------------------------------

/sigma | 34.64662 2.814768 12.31 0.000 29.12977 40.16346

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

Note: The test of the variance against zero is one sided, and the two-sided

confidence interval is truncated at zero.

Akaike’s information criterion and Bayesian information criterion

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

Model | Obs ll(null) ll(model) df AIC BIC

-------------+---------------------------------------------------------------

. | 67 . -333.1831 4 674.3662 683.185

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

Note: N=Obs used in calculating BIC; see [R] BIC note

8

Page 9: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

-1 0 1 -1 0 1

LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor]

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

1 -0.0609 -0.0609 .26007 0.6101 | |

2 0.0439 0.0403 .39688 0.8200 | |

3 -0.0450 -0.0402 .54316 0.9093 | |

4 0.0875 0.0814 1.1055 0.8934 | |

5 0.0232 0.0365 1.1457 0.9500 | |

6 0.0607 0.0566 1.4251 0.9643 | |

7 -0.0565 -0.0461 1.6708 0.9758 | |

8 -0.0480 -0.0641 1.8517 0.9852 | |

9 -0.0738 -0.0794 2.286 0.9861 | |

10 -0.0005 -0.0207 2.286 0.9936 | |

11 -0.1070 -0.1048 3.2305 0.9873 | |

12 -0.0353 -0.0451 3.3354 0.9927 | |

13 -0.1088 -0.0895 4.3481 0.9869 | |

14 -0.0604 -0.0714 4.6667 0.9899 | |

15 0.0144 0.0290 4.6851 0.9945 | |

16 0.0544 0.0620 4.9532 0.9960 | |

17 0.0249 0.0531 5.0107 0.9977 | |

18 -0.0136 -0.0009 5.0281 0.9988 | |

19 0.0293 0.0284 5.1106 0.9993 | |

20 0.0409 0.0183 5.2748 0.9996 | |

21 0.0276 -0.0081 5.3516 0.9998 | |

22 0.0063 -0.0335 5.3557 0.9999 | |

23 -0.1001 -0.1327 6.4079 0.9997 | -|

24 0.1442 0.1145 8.6427 0.9983 |- |

9

Page 10: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

10

Page 11: ECON 300 Econometrics Problem Set 6 - DENNIS … · ECON 300 Econometrics Problem Set 6 ... Use an augmented Dickey-Fuller test to formally determine the stationarity of deaths

1 c l e a r a l l2

3 pwd4

5 l og us ing ” ebo la ar ima . smcl ” , r ep l a c e6

7 c l e a r a l l8

9 /∗ −−−−−−−−−−−−−−−−−−−−−−(a )−−−−−−−−−−−−−−−−−−−−−− ∗/10 import de l im i t ed ” ebo la . csv ” , c l e a r11 su12

13 /∗ −−−−−−−−−−−−−−−−−−−−−−(b)−−−−−−−−−−−−−−−−−−−−−− ∗/14 t s s e t obs15

16 /∗ −−−−−−−−−−−−−−−−−−−−−−(c )−−−−−−−−−−−−−−−−−−−−−− ∗/17 t s l i n e deaths18 graph save ” deaths . gph” , r ep l a c e19 graph export ” deaths . png ” , r ep l a c e20

21 ac deaths , l a g s (17)22 graph save ” deaths ac . gph” , r ep l a c e23 graph export ” deaths ac . png ” , r ep l a c e24

25 /∗ −−−−−−−−−−−−−−−−−−−−−−(d)−−−−−−−−−−−−−−−−−−−−−− ∗/26 varsoc deaths27 d f u l l e r deaths , l a g s (1 )28 varsoc D. deaths29 d f u l l e r D. deaths , l a g s (0 )30 varsoc D2 . deaths31 d f u l l e r D2 . deaths , l a g s (4 )32

33 /∗ −−−−−−−−−−−−−−−−−−−−−−(f )−−−−−−−−−−−−−−−−−−−−−− ∗/34 t s l i n e D. deaths35 graph save ” d e a t h s d i f f . gph” , r ep l a c e36 graph export ” d e a t h s d i f f . png ” , r ep l a c e37

38 ac D. deaths , l a g s (17) name( ac1 )39 graph save ” deaths ac1 . gph” , r ep l a c e40 graph export ” deaths ac1 . png ” , r ep l a c e41

42 pac D. deaths , l a g s (17) name( pac1 )43 graph save ” deaths pac1 . gph” , r ep l a c e44 graph export ” deaths pac1 . png ” , r ep l a c e45

46 graph combine ac1 pac147 graph save ” deaths ac1pac1 . gph” , r ep l a c e48 graph export ” deaths ac1pac1 . png ” , r ep l a c e49

50 arima D. deaths , ar (5 ) ma(5)51 e s t a t i c52 arima D. deaths , ar (5 )53 e s t a t i c54 arima D. deaths , ma(5)55 e s t a t i c56 p r ed i c t res015 , r e s i d u a l s57 t s l i n e re s01558 graph save ” r e s 0 1 5 t s . gph” , r ep l a c e59 graph export ” r e s 0 1 5 t s . png ” , r ep l a c e60

61 s c a t t e r deaths re s01562 graph save ” res015 . gph” , r ep l a c e63 graph export ” res015 . png ” , r ep l a c e64

65 corrgram res015 , l a g s (24) yw66

67 p r ed i c t deaths1 , y68

69 t s l i n e deaths deaths170 graph save ” p r ed i c t . gph” , r ep l a c e71 graph export ” p r ed i c t . png ” , r ep l a c e72 l og c l o s e

11