ECON Introductory Econometrics Seminar 9

Size: px
Start display at page:

Download "ECON Introductory Econometrics Seminar 9"

Transcription

1 ECON Introductory Econometrics Seminar 9 Stock and Watson EE13.1 May 4, 2015 Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

2 Empirical exercise E13.1: Data us macro quarterly.xlsx: quarterly data on several macroeconomic variables from 1957:Q1 2013:Q4 All data series are from the Federal Reserve Economic Data (FRED) database maintained by the Federal Reserve Bank of St. Louis We will use data on CPI to construct inflation series Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

3 Empirical exercise E11.2: Data Variable PCECTPI description Personal Consumption Expenditures: Chain-type Price Index Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

4 import from excel clear all set more off cap log close log using EE14_1.log, replace cd M:\pc\Desktop\courses\introductory_econometrics\seminar_10 /* import data from excel, create t variable and declare time series quarterly data starting from 1957 q1 */ import excel us_macro_quarterly.xlsx, firstrow gen t=_n gen quarters= tq(1957q1) + t - 1 tsset quarters, quarterly time variable: quarters, 1957q1 to 2013q4 delta: 1 quarter Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

5 A) // **************************** A **************************** gen infl= 400 * (ln(pcectpi)-ln(l1.pcectpi)) /* we multiply the quarterly inflation at percentage points by 4, then the quarterly inflation infl is express as percentage points at annual rate */ Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

6 A) tsline infl if tin(1963q1,2012q4), lwidth(medthick) lpattern(solid) scheme(s1color) /// lcolor(black) yline(0, lstyle(grid) lcolor(black)) infl q1 1970q1 1980q1 1990q1 2000q1 2010q1 quarters /* there is an upward trend for the first 20 years, then inflation declined for a decade and in the last period it remains quite stable around 2%. It appears to have a stochastic trend. */ Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

7 B) i) // **************************** B **************************** //i corrgram D.infl if tin(1963q1, 2012q4), lags(4) LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor] // the first 4 autocorrelation are: -0.25, -0.18, 0.13, and Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

8 B) ii) tslined. infl if tin(1963q1,2012q4), lwidth(medthick) lpattern(solid) scheme(s1color) /// lcolor(black) yline(0, lstyle(grid) lcolor(black)) D.infl q1 1970q1 1980q1 1990q1 2000q1 2010q1 quarters /* the first autocorralation is -0.25, so the change in inflation is characterized by a negative serial correlation. The behavior in the plot is consistent with this negative autocorrelation as values above (belove) the mean tend to be followed by values below (above) the mean. */ Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

9 C) i regress D.infl L.D.infl if tin(1963q1,2012q4), robust Linear regression Number of obs = 200 F( 1, 198) = Prob > F = R-squared = Root MSE = Robust D.infl Coef. Std. Err. t P> t [95% Conf. Interval] infl LD _cons /* The coefficient on lagged change in inflation is statistically significant, so that lagged change in inflation helps predict current inflation. */ Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

10 C) ii regress D.infl L(1/2).D.infl if tin(1963q1,2012q4), robust Linear regression Number of obs = 200 F( 2, 197) = Prob > F = R-squared = Root MSE = Robust D.infl Coef. Std. Err. t P> t [95% Conf. Interval] infl LD L2D _cons /* > coefficient on L.D.inlf is statistically significant, so the AR(2) model is > preferred to the AR(1) model > */ Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

11 C) iii foreach p of numlist 0/8 { if p == 0 { regress D.infl if tin(1963q1,2012q4), robust scalar BIC_ p =ln(e(rss)/e(n))+e(rank)*(ln(e(n))/e(n)) scalar AIC_ p =ln(e(rss)/e(n))+e(rank)*(2/e(n)) } else { quietly regress D.infl L(1/ p ).D.infl if tin(1963q1,2012q4), robust scalar BIC_ p =ln(e(rss)/e(n))+e(rank)*(ln(e(n))/e(n)) scalar AIC_ p =ln(e(rss)/e(n))+e(rank)*(2/e(n)) } } foreach p of numlist 0/8 { if p == 0 { noisily display _column(1) "p" _column(15)"bic(p)" _column(30)"aic(p) " } noisily display _column(1) " p " _column(17) string(round( BIC_ p,0.001)) \\\ _column(32) string(round(aic_ p,0.001)) } Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

12 C) iii p BIC(p) AIC(p) /// Both AIC and BIC select p = 2 lags. Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

13 C) iii, iv quietly regress D.infl L(1/2).D.infl if tin(1963q1,2012q4), robust predict forecast if tin(2013q1,2013q1) sum forecast Variable Obs Mean Std. Dev. Min Max forecast // The predicted change in inflation is sum infl_forecast Variable Obs Mean Std. Dev. Min Max infl_forec~t // The predicted level of inflation is 1.47 Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

14 D) i regress D.infl L.infl L(1/2).D.infl if tin(1963q1,2012q4) Source SS df MS Number of obs = F( 3, 196) = Model Prob > F = Residual R-squared = Adj R-squared = Total Root MSE = D.infl Coef. Std. Err. t P> t [95% Conf. Interval] infl L LD L2D _cons /* the augmented Dicky fueller t test is % critical value: and the 5% critical value: the unit root null hypothesis can be rejected at the 10% but not the 5% significance level. */ Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

15 D) ii //ii) /* from the graph it seems that inflation does not exhibit a liner trend, so the specification without it should be more appropiate */ Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

16 D) iii) // both AIC and BIC choose 2 lags, so we should not include less or more lags Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

17 D) iv) Inflation is highly persistent. It has a largest autoregressive root that is close to 1.0 null hypothesis that the value is 1.0 cannot be rejected at the 5% significance level this suggests that the true value is close to 1.0 If a series is nonstationary, then convential hypothesis tests, confidence intervals and forecasts can be unreliable. Methods for construction for confidence intervals in this case go beyond this introductory course. Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18

18 GOOD LUCK WITH THE EXAM! Stock and Watson EE13.1 ECON Introductory Econometrics Seminar 9 May 4, / 18