ps10sol

21
Department of Economics Economics 1123 Harvard University Fall 2013 1 Problem Set #10 Solutions Political Distress, the Arab Spring and Financial Markets (Due: Dec. 3) On January 14 th 2011 Tunisian protestors forced the Tunisian leader Ben Ali from power. In this problem set you use Egyptian CDS (Credit Default Swap) price data to investigate how investors responded to this and other events. The seller of the CDS agrees to compensate the buyer in the event of a loan default or other credit event. The buyer of the CDS makes a series of payments (the CDS "fee" or "spread") to the seller and, in exchange, receives a payoff if the loan defaults. If the price of the CDS goes up, it implies that the market is pricing in a higher probability of default (non-payment) on the underlying asset. In the dataset posted on the class website, the price is the (slightly modified) closing price of the Egyptian CDS on 10-year Egyptian sovereign debt in dollars. The other two variables are self-explanatory aside from unrest which is described in part 3 below. (N.B. You may want to use excel to do parts of the problem set. For STATA hints see the lecture slides and the TFs). 1. Does the CDS price series have a unit root? a) The variable date is given in calendar format. In other words, the 30 th of August 2010 is denoted by 8/30/2010. Generate a new variable tdate so that this data can be used by STATA. b) Provide a graph of the price of the CDS price against time. Mark with a vertical line the departure of Ben Ali and briefly discuss this graph. The Egyptian CDS price climbed following Ben Ali’s departure. This means that it became more expensive to insure Egyptian debt after this event. In other words, the market seems to have viewed the departure of Ben Ali as increasing Egypt’s probability of default.

Upload: rmwarora

Post on 17-Jan-2016

24 views

Category:

Documents


0 download

DESCRIPTION

ps10sol

TRANSCRIPT

Page 1: PS10sol

Department of Economics Economics 1123 Harvard University Fall 2013

1

Problem Set #10 Solutions Political Distress, the Arab Spring and Financial Markets

(Due: Dec. 3) On January 14th 2011 Tunisian protestors forced the Tunisian leader Ben Ali from power. In this problem set you use Egyptian CDS (Credit Default Swap) price data to investigate how investors responded to this and other events. The seller of the CDS agrees to compensate the buyer in the event of a loan default or other credit event. The buyer of the CDS makes a series of payments (the CDS "fee" or "spread") to the seller and, in exchange, receives a payoff if the loan defaults. If the price of the CDS goes up, it implies that the market is pricing in a higher probability of default (non-payment) on the underlying asset. In the dataset posted on the class website, the price is the (slightly modified) closing price of the Egyptian CDS on 10-year Egyptian sovereign debt in dollars. The other two variables are self-explanatory aside from unrest which is described in part 3 below. (N.B. You may want to use excel to do parts of the problem set. For STATA hints see the lecture slides and the TFs).

1. Does the CDS price series have a unit root? a) The variable date is given in calendar format. In other words, the 30th of August 2010

is denoted by 8/30/2010. Generate a new variable tdate so that this data can be used by STATA.

b) Provide a graph of the price of the CDS price against time. Mark with a vertical line the departure of Ben Ali and briefly discuss this graph. The  Egyptian  CDS  price  climbed  following  Ben  Ali’s  departure.  This  means  that  it  became more expensive to insure Egyptian debt after this event. In other words, the market seems  to  have  viewed  the  departure  of  Ben  Ali  as  increasing  Egypt’s  probability of default.

Page 2: PS10sol

Department of Economics Economics 1123 Harvard University Fall 2013

2

c) Generate lprice equal to the natural logarithm of the CDS price and estimate an AR(3)

using this variable. 𝑌 =-0.01+0.50𝑌 +0.32𝑌 +0.18𝑌

This regression was estimated with 103 observations. d) Why do you lose so many observations?

Since there was not trading on the weekends many of the relevant lags are not defined.

e) Define a new time index t to deal with this problem. Here I sort the data by tdate and then generate a new index t equal to the observation number. This deals with the problem of missing days since now I treat Mondays as directly following Fridays.

f) Using the Dickey-Fuller statistic, test the null hypothesis that the lprice series has a unit root against the alternative that it is stationary. This requires estimating the equation:

𝛥𝑌 = 𝛽 + 𝛿𝑌 + 𝑢 Which yields the test statistic of -3.68 this is less than the 1% cutoff of -3.43 so we reject the null-hypothesis of a unit root at the 1% level.

g) Using the ADF statistic, test the null hypothesis that the lprice series has a unit root against the alternative that it is stationary (hint use the AIC to determine lag length in this question setting the maximum number of lags equal to 5).

200

300

400

500

Pric

e

Aug10 Dec10 Mar11 Jun11 Sep11Date

Page 3: PS10sol

Department of Economics Economics 1123 Harvard University Fall 2013

3

The AIC chooses 4 lags and the relevant ADF statistic is the coefficient on 𝑌 in the equation:

𝛥𝑌 = 𝛽 + 𝛿𝑌 + 𝛾 𝛥𝑌 + 𝛾 𝛥𝑌 + 𝛾 𝛥𝑌 + 𝛾 𝛥𝑌 + 𝑢 And yields the test statistic of -1.45>-2.57  so  we  don’t  reject  the  null  hypothesis of a unit root at the 10% level.

h) Using the ADF statistic, test the null hypothesis that the lprice series has a unit root against the alternative that it is trend stationary (use the same number of lags that you used in 1. g).

𝛥𝑌 = 𝛽 + 𝛼𝑡 + 𝛿𝑌 + 𝛾 𝛥𝑌 + 𝛾 𝛥𝑌 + 𝛾 𝛥𝑌 + 𝛾 𝛥𝑌 + 𝑢 This yields the test statistic of -2.25>-3.12  so  we  don’t  reject  the  null  hypothesis  of  a  unit root at the 10% level.

2. Is there a trend break in the CDS price series (use robust standard errors for this question)? a) Using a Chow test, suggest a regression to estimate whether there was a break in the

level of the logarithm of the Egyptian CDS price after  Ben  Ali’s  departure.  Estimate  this regression, interpret, and plot your results.

𝑙𝑝𝑟𝑖𝑐𝑒 = 𝛽 + 𝛽 𝐷 (𝑡 > January  14th  2011) + 𝑢 𝑙𝑝𝑟𝚤𝑐𝑒 = 5.54 + 0.39𝐷 (𝑡 > January  14th  2011)

So the mean level of the Egyptian CDS increased by approximately 39% following Ben  Ali’s  departure.

Page 4: PS10sol

Department of Economics Economics 1123 Harvard University Fall 2013

4

b) Using the QLR algorithm described in class, calculate the break date for the

specification in a) using 15% trimming. Plot both the F-stat against time and the fitted values and compare the fitted values to those in question a).

5.4

5.6

5.8

66.

2

Aug10 Dec10 Mar11 Jun11 Sep11Date

lprice Fitted values

Page 5: PS10sol

Department of Economics Economics 1123 Harvard University Fall 2013

5

The estimated break date is only a few days before the removal of Ben Ali, so my results are very similar to those in part a).

0

200

400

600

800

1000

q1

Aug10 Dec10 Mar11 Jun11 Sep11Date

Page 6: PS10sol

Department of Economics Economics 1123 Harvard University Fall 2013

6

c) Some scholars have argued that many time series that appear to have unit roots

actually are stationary series with periodic mean changes. Repeat your analysis in questions 1. f)-h) on both sides of your estimated break date in part 2 b). Do your results provide support for this view (again use the same number of lags you estimated in question 1 where relevant)? *f: both t-stats are well below -3.43 so the data reject the null hypothesis of a unit root on both sides of the break *g: to the left of the cutoff the test-stat is -3.31<-2.86 so we can reject the null at the 5% level, to the right of the cutoff it is -2.82 so we can only reject the null at the 10% level *h: to the left of the cutoff we can reject the null at the 5% level since -3.83<-3.41 To the right of the  cutoff  we  can’t  even  reject  the  null  at  the  10%  level. In sum, the data provide some support for the view that once we take into account the break, the CDS price series is stationary on both sides of the break.

3. Calculating the Effect Political Unrest on Egyptian CDS prices (use Newey-West

standard errors for this question) a) Generate a new variable dlprice equal to the difference in the logarithm of prices. b) A political scientist has identified days in which Egypt suffered from political unrest

during the period covered by the data. These days are denoted by the dummy variable

5.4

5.6

5.8

66.

2

Aug10 Dec10 Mar11 Jun11 Sep11Date

lprice Fitted values

Page 7: PS10sol

Department of Economics Economics 1123 Harvard University Fall 2013

7

unrest. Using dlprice as the dependent variable, provide an estimates of all dynamic multiplier up to the 5th period dynamic multiplier on the unrest variable. 𝛥ln(𝑝𝑟𝚤𝑐𝑒) = −0.01 + 0.17𝑢𝑛𝑟𝑒𝑠𝑡 -0.05𝑢𝑛𝑟𝑒𝑠𝑡 +0.01𝑢𝑛𝑟𝑒𝑠𝑡 -0.01𝑢𝑛𝑟𝑒𝑠𝑡 -0.02𝑢𝑛𝑟𝑒𝑠𝑡 -0.01𝑢𝑛𝑟𝑒𝑠𝑡

c) Estimate the cumulative dynamic multipliers. Graph the results with the corresponding 95% interval. What was the cumulative effect of a day of unrest on Egyptian CDS price 5 days after the unrest occurred?

The cumulative effect over this period was to increase the change in price by 9 percentage points.

d) Include in the regression you estimated in 3 b) five leads of the unrest variable. Test the null hypothesis that the coefficients on these leads are jointly equal to zero. Do your results support the claim that periods of unrest can be considered exogenous? The F-stat is 8.22 and the corresponding p-value is 0.00. This is worrying because it is difficult to see how unrest should affect the price of the CDS before it happens (unless market participants are successfully predicting unrest). So it may be the case that at least part of our results are spurious.

.05

.1.1

5.2

0 1 2 3 4 5n

b upper95lower95

Page 8: PS10sol

ps10answers------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- name: <unnamed> log: ps10answers.log log type: text opened on: 6 Nov 2013, 14:17:21

.

. *1 a)

. gen tdate=date(date,"MDY")

.

. *1 b)

. tsset tdate time variable: tdate, 18504 to 18864, but with gaps delta: 1 unit

. tsline price, tline(14jan2011) tlabel(, format(%tdmy)) ttitle("Date")

.

. *1 c)

. gen lprice=ln(price)

. reg lprice l(1/3).lprice

Source | SS df MS Number of obs = 103-------------+------------------------------ F( 3, 99) = 207.98 Model | 4.20127075 3 1.40042358 Prob > F = 0.0000 Residual | .666598151 99 .006733315 R-squared = 0.8631-------------+------------------------------ Adj R-squared = 0.8589 Total | 4.8678689 102 .047724205 Root MSE = .08206

------------------------------------------------------------------------------ lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | .499704 .104323 4.79 0.000 .2927045 .7067035 L2. | .3246668 .1117242 2.91 0.005 .1029817 .5463519 L3. | .1776426 .0879182 2.02 0.046 .0031938 .3520913 | _cons | -.0096913 .2355313 -0.04 0.967 -.4770365 .4576539------------------------------------------------------------------------------

.

. *1 e)

. sort tdate

. gen newtime=_n

. tsset newtime time variable: newtime, 1 to 259 delta: 1 unit

.

. *1 f)

. reg d.lprice l.lprice

Source | SS df MS Number of obs = 258-------------+------------------------------ F( 1, 256) = 13.52 Model | .129194704 1 .129194704 Prob > F = 0.0003 Residual | 2.44698776 256 .009558546 R-squared = 0.0501-------------+------------------------------ Adj R-squared = 0.0464

Page 1

Page 9: PS10sol

ps10answers Total | 2.57618247 257 .010024056 Root MSE = .09777

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.1034836 .0281478 -3.68 0.000 -.1589143 -.0480528 | _cons | .6003883 .1627273 3.69 0.000 .2799338 .9208429------------------------------------------------------------------------------

.

. *1 g)

. *how many lags of delta y should I include? Use the AIC, make sure do so on the same sample. reg d.lprice l.lprice l(1/5).d.lprice if n>6

Source | SS df MS Number of obs = 253-------------+------------------------------ F( 6, 246) = 15.91 Model | .715964753 6 .119327459 Prob > F = 0.0000 Residual | 1.84505495 246 .007500223 R-squared = 0.2796-------------+------------------------------ Adj R-squared = 0.2620 Total | 2.56101971 252 .010162777 Root MSE = .0866

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.0408296 .0269201 -1.52 0.131 -.093853 .0121937 LD. | -.5748105 .0667996 -8.61 0.000 -.7063826 -.4432384 L2D. | -.355263 .075388 -4.71 0.000 -.5037512 -.2067747 L3D. | -.1968132 .0771405 -2.55 0.011 -.3487532 -.0448731 L4D. | -.1112146 .0740996 -1.50 0.135 -.2571651 .0347359 L5D. | .0077695 .0635837 0.12 0.903 -.1174684 .1330074 | _cons | .2425167 .1556122 1.56 0.120 -.0639854 .5490188------------------------------------------------------------------------------

. gen AIC5=ln(e(rss)/253)+6*2/253

.

. reg d.lprice l.lprice l(1/4).d.lprice if n>6

Source | SS df MS Number of obs = 253-------------+------------------------------ F( 5, 247) = 19.17 Model | .715852766 5 .143170553 Prob > F = 0.0000 Residual | 1.84516694 247 .007470311 R-squared = 0.2795-------------+------------------------------ Adj R-squared = 0.2649 Total | 2.56101971 252 .010162777 Root MSE = .08643

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.0405278 .0267531 -1.51 0.131 -.0932211 .0121654 LD. | -.5760284 .0659199 -8.74 0.000 -.7058653 -.4461916 L2D. | -.3571187 .073695 -4.85 0.000 -.5022694 -.2119681 L3D. | -.1998438 .0728988 -2.74 0.007 -.3434263 -.0562613 L4D. | -.1159576 .0629935 -1.84 0.067 -.2400306 .0081154 | _cons | .2408129 .1546768 1.56 0.121 -.0638409 .5454667------------------------------------------------------------------------------

Page 2

Page 10: PS10sol

ps10answers. gen AIC4=ln(e(rss)/253)+5*2/253

.

. reg d.lprice l.lprice l(1/3).d.lprice if n>6

Source | SS df MS Number of obs = 253-------------+------------------------------ F( 4, 248) = 22.89 Model | .690539668 4 .172634917 Prob > F = 0.0000 Residual | 1.87048004 248 .007542258 R-squared = 0.2696-------------+------------------------------ Adj R-squared = 0.2579 Total | 2.56101971 252 .010162777 Root MSE = .08685

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.0457302 .0267312 -1.71 0.088 -.0983793 .0069189 LD. | -.5556186 .0652929 -8.51 0.000 -.6842179 -.4270192 L2D. | -.3159866 .0705631 -4.48 0.000 -.4549659 -.1770072 L3D. | -.1308455 .0628244 -2.08 0.038 -.2545829 -.0071081 | _cons | .2703159 .1545833 1.75 0.082 -.0341476 .5747794------------------------------------------------------------------------------

. gen AIC3=ln(e(rss)/253)+4*2/253

.

. reg d.lprice l.lprice l(1/2).d.lprice if n>6

Source | SS df MS Number of obs = 253-------------+------------------------------ F( 3, 249) = 28.69 Model | .657823499 3 .2192745 Prob > F = 0.0000 Residual | 1.90319621 249 .007643358 R-squared = 0.2569-------------+------------------------------ Adj R-squared = 0.2479 Total | 2.56101971 252 .010162777 Root MSE = .08743

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.0523513 .0267188 -1.96 0.051 -.1049749 .0002724 LD. | -.5175246 .0630974 -8.20 0.000 -.6417973 -.3932519 L2D. | -.2419289 .061356 -3.94 0.000 -.3627718 -.121086 | _cons | .3079597 .1545485 1.99 0.047 .0035707 .6123488------------------------------------------------------------------------------

. gen AIC2=ln(e(rss)/253)+3*2/253

.

. reg d.lprice l.lprice l.d.lprice if n>6

Source | SS df MS Number of obs = 253-------------+------------------------------ F( 2, 250) = 33.32 Model | .538988182 2 .269494091 Prob > F = 0.0000 Residual | 2.02203152 250 .008088126 R-squared = 0.2105-------------+------------------------------ Adj R-squared = 0.2041 Total | 2.56101971 252 .010162777 Root MSE = .08993

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

Page 3

Page 11: PS10sol

ps10answers L1. | -.068002 .0271802 -2.50 0.013 -.1215333 -.0144706 LD. | -.4041171 .0577719 -7.00 0.000 -.5178989 -.2903354 | _cons | .3975245 .1572551 2.53 0.012 .087811 .7072381------------------------------------------------------------------------------

. gen AIC1=ln(e(rss)/253)+2*2/253

.

. reg d.lprice l.lprice if n>6

Source | SS df MS Number of obs = 253-------------+------------------------------ F( 1, 251) = 14.87 Model | .14323129 1 .14323129 Prob > F = 0.0001 Residual | 2.41778842 251 .009632623 R-squared = 0.0559-------------+------------------------------ Adj R-squared = 0.0522 Total | 2.56101971 252 .010162777 Root MSE = .09815

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.1113648 .0288803 -3.86 0.000 -.1682433 -.0544862 | _cons | .6471399 .1671372 3.87 0.000 .3179698 .9763099------------------------------------------------------------------------------

. gen AIC0=ln(e(rss)/253)+1*2/253

.

. *Minimized with 4 lags, so the ADF test statistic is the relevant coefficient in

. reg d.lprice l.lprice l(1/4).d.lprice

Source | SS df MS Number of obs = 254-------------+------------------------------ F( 5, 248) = 19.09 Model | .71197933 5 .142395866 Prob > F = 0.0000 Residual | 1.84946086 248 .007457503 R-squared = 0.2780-------------+------------------------------ Adj R-squared = 0.2634 Total | 2.56144019 253 .01012427 Root MSE = .08636

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.0385522 .026603 -1.45 0.149 -.0909489 .0138445 LD. | -.573339 .0657679 -8.72 0.000 -.7028739 -.4438041 L2D. | -.3544606 .0735484 -4.82 0.000 -.4993197 -.2096015 L3D. | -.1965597 .0727076 -2.70 0.007 -.3397628 -.0533567 L4D. | -.1151163 .0629297 -1.83 0.069 -.2390611 .0088286 | _cons | .2291062 .1537722 1.49 0.138 -.0737598 .5319722------------------------------------------------------------------------------

.

. *1 h)

. reg d.lprice newtime l.lprice l(1/4).d.lprice

Source | SS df MS Number of obs = 254-------------+------------------------------ F( 6, 247) = 16.53 Model | .733774649 6 .122295775 Prob > F = 0.0000 Residual | 1.82766554 247 .007399456 R-squared = 0.2865-------------+------------------------------ Adj R-squared = 0.2691 Total | 2.56144019 253 .01012427 Root MSE = .08602

Page 4

Page 12: PS10sol

ps10answers

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- newtime | .0001969 .0001147 1.72 0.087 -.0000291 .0004229 | lprice | L1. | -.092917 .041299 -2.25 0.025 -.1742602 -.0115738 LD. | -.5323465 .0697297 -7.63 0.000 -.6696872 -.3950058 L2D. | -.3233168 .0754755 -4.28 0.000 -.4719745 -.1746592 L3D. | -.174481 .0735577 -2.37 0.018 -.3193613 -.0296006 L4D. | -.1022478 .0631312 -1.62 0.107 -.2265919 .0220963 | _cons | .5170736 .2271888 2.28 0.024 .0695992 .9645479------------------------------------------------------------------------------

.

. *2 a)

. gen afterbenali=(tdate>18641)

.

. reg lprice afterbenali, r

Linear regression Number of obs = 259 F( 1, 257) = 871.08 Prob > F = 0.0000 R-squared = 0.7702 Root MSE = .10452

------------------------------------------------------------------------------ | Robust lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- afterbenali | .3914832 .0132643 29.51 0.000 .3653627 .4176038 _cons | 5.538297 .0102913 538.15 0.000 5.518031 5.558563------------------------------------------------------------------------------

. predict fitted(option xb assumed; fitted values)

. preserve

. tsset tdate time variable: tdate, 18504 to 18864, but with gaps delta: 1 unit

. tsline lprice fitted, tline(14jan2011) tlabel(, format(%tdmy)) ttitle("Date")

.

. *2 b)

. /*QLR with 15% trimming: 259*0.15=39 */

.

. gen q1=.(259 missing values generated)

. local i=39

. while `i'<220 { 2. gen di=(_n>`i') 3. qui reg lprice di, r 4. qui test di 5. replace q1=r(F) in `i' 6. drop di

Page 5

Page 13: PS10sol

ps10answers 7. local i=`i'+1 8. }(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)

Page 6

Page 14: PS10sol

ps10answers(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)

Page 7

Page 15: PS10sol

ps10answers(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)

.

.

. tsline q1, tline(14jan2011) tlabel(, format(%tdmy)) ttitle("Date")

. Page 8

Page 16: PS10sol

ps10answers. gen estimatedbreak=(tdate>18637)

. reg lprice estimatedbreak, r

Linear regression Number of obs = 259 F( 1, 257) = 896.15 Prob > F = 0.0000 R-squared = 0.7666 Root MSE = .10533

-------------------------------------------------------------------------------- | Robust lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------------+----------------------------------------------------------------estimatedbreak | .3937072 .0131517 29.94 0.000 .3678084 .419606 _cons | 5.530851 .0099617 555.21 0.000 5.511234 5.550468--------------------------------------------------------------------------------

. predict fittedbreak(option xb assumed; fitted values)

. tsline lprice fittedbreak, tline(14jan2011) tlabel(, format(%tdmy)) ttitle("Date")

. restore

.

. *2 c)

. **f

. reg d.lprice l.lprice if tdate<=18637

Source | SS df MS Number of obs = 95-------------+------------------------------ F( 1, 93) = 55.71 Model | .512370351 1 .512370351 Prob > F = 0.0000 Residual | .855403854 93 .009197891 R-squared = 0.3746-------------+------------------------------ Adj R-squared = 0.3679 Total | 1.3677742 94 .014550789 Root MSE = .09591

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.7590397 .101699 -7.46 0.000 -.9609938 -.5570857 | _cons | 4.198701 .5624244 7.47 0.000 3.081838 5.315565------------------------------------------------------------------------------

. reg d.lprice l.lprice if tdate>18637

Source | SS df MS Number of obs = 163-------------+------------------------------ F( 1, 161) = 29.89 Model | .189199026 1 .189199026 Prob > F = 0.0000 Residual | 1.01908355 161 .006329711 R-squared = 0.1566-------------+------------------------------ Adj R-squared = 0.1513 Total | 1.20828257 162 .007458534 Root MSE = .07956

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.3114478 .0569663 -5.47 0.000 -.4239452 -.1989503 | _cons | 1.847314 .3373818 5.48 0.000 1.18105 2.513578------------------------------------------------------------------------------

Page 9

Page 17: PS10sol

ps10answers

.

. **g

. reg d.lprice l.lprice l(1/4).d.lprice if tdate<=18637

Source | SS df MS Number of obs = 91-------------+------------------------------ F( 5, 85) = 12.10 Model | .562670949 5 .11253419 Prob > F = 0.0000 Residual | .790483719 85 .009299808 R-squared = 0.4158-------------+------------------------------ Adj R-squared = 0.3815 Total | 1.35315467 90 .015035052 Root MSE = .09644

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.6544451 .1975169 -3.31 0.001 -1.047162 -.2617286 LD. | -.1292757 .1793548 -0.72 0.473 -.4858812 .2273297 L2D. | -.0298267 .1588348 -0.19 0.851 -.3456328 .2859795 L3D. | -.0864248 .1386928 -0.62 0.535 -.3621833 .1893337 L4D. | -.1725131 .1077977 -1.60 0.113 -.3868438 .0418175 | _cons | 3.623684 1.091862 3.32 0.001 1.452771 5.794598------------------------------------------------------------------------------

. reg d.lprice l.lprice l(1/4).d.lprice if tdate>18637

Source | SS df MS Number of obs = 163-------------+------------------------------ F( 5, 157) = 14.33 Model | .378638783 5 .075727757 Prob > F = 0.0000 Residual | .829643788 157 .005284355 R-squared = 0.3134-------------+------------------------------ Adj R-squared = 0.2915 Total | 1.20828257 162 .007458534 Root MSE = .07269

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- lprice | L1. | -.1674718 .0594417 -2.82 0.005 -.2848804 -.0500633 LD. | -.4644256 .0883868 -5.25 0.000 -.6390063 -.2898449 L2D. | -.2428132 .0940718 -2.58 0.011 -.4286228 -.0570036 L3D. | .0210677 .091324 0.23 0.818 -.1593145 .20145 L4D. | .1315505 .0774056 1.70 0.091 -.0213402 .2844411 | _cons | .996139 .3517512 2.83 0.005 .3013639 1.690914------------------------------------------------------------------------------

. **h

. reg d.lprice newtime l.lprice l(1/4).d.lprice if tdate<=18637

Source | SS df MS Number of obs = 91-------------+------------------------------ F( 6, 84) = 10.94 Model | .593650455 6 .098941743 Prob > F = 0.0000 Residual | .759504212 84 .009041717 R-squared = 0.4387-------------+------------------------------ Adj R-squared = 0.3986 Total | 1.35315467 90 .015035052 Root MSE = .09509

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- newtime | .0007892 .0004263 1.85 0.068 -.0000587 .001637 | lprice |

Page 10

Page 18: PS10sol

ps10answers L1. | -.8386063 .2186979 -3.83 0.000 -1.273511 -.4037014 LD. | .0074957 .191664 0.04 0.969 -.3736492 .3886407 L2D. | .0730173 .1661786 0.44 0.662 -.2574471 .4034816 L3D. | -.011959 .1425492 -0.08 0.933 -.2954338 .2715158 L4D. | -.1294931 .1088026 -1.19 0.237 -.345859 .0868727 | _cons | 4.601453 1.19921 3.84 0.000 2.216692 6.986214------------------------------------------------------------------------------

. reg d.lprice newtime l.lprice l(1/4).d.lprice if tdate>18637

Source | SS df MS Number of obs = 163-------------+------------------------------ F( 6, 156) = 11.88 Model | .378868973 6 .063144829 Prob > F = 0.0000 Residual | .829413598 156 .005316754 R-squared = 0.3136-------------+------------------------------ Adj R-squared = 0.2872 Total | 1.20828257 162 .007458534 Root MSE = .07292

------------------------------------------------------------------------------ D.lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- newtime | -.0000253 .0001217 -0.21 0.835 -.0002656 .000215 | lprice | L1. | -.167937 .0596655 -2.81 0.006 -.2857935 -.0500805 LD. | -.4644881 .0886579 -5.24 0.000 -.6396129 -.2893633 L2D. | -.2433592 .0943962 -2.58 0.011 -.4298189 -.0568995 L3D. | .0203958 .0916605 0.22 0.824 -.16066 .2014515 L4D. | .1308267 .0777204 1.68 0.094 -.0226934 .2843468 | _cons | 1.003406 .354552 2.83 0.005 .3030635 1.703748------------------------------------------------------------------------------

.

. *3 a)

. gen dlprice=d.lprice(1 missing value generated)

.

. *3 b)

. *here use newey west, truncation parameter: 0.75*259^(1/3), round up to 5

. newey dlprice l(0/5).unrest, lag(5)

Regression with Newey-West standard errors Number of obs = 254maximum lag: 5 F( 6, 247) = 86.79 Prob > F = 0.0000

------------------------------------------------------------------------------ | Newey-West dlprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- unrest | --. | .1743814 .0098692 17.67 0.000 .154943 .1938199 L1. | -.0453184 .0163791 -2.77 0.006 -.0775789 -.0130578 L2. | .0055858 .0142687 0.39 0.696 -.022518 .0336896 L3. | -.0108249 .0141715 -0.76 0.446 -.0387374 .0170876 L4. | -.0214413 .0178703 -1.20 0.231 -.056639 .0137563 L5. | -.0102675 .0138257 -0.74 0.458 -.0374988 .0169637 | _cons | -.0106162 .0049914 -2.13 0.034 -.0204474 -.000785------------------------------------------------------------------------------

. Page 11

Page 19: PS10sol

ps10answers. *3 c). newey dlprice d.l(0/4).unrest l5.unrest, lag(5)

Regression with Newey-West standard errors Number of obs = 254maximum lag: 5 F( 6, 247) = 86.79 Prob > F = 0.0000

------------------------------------------------------------------------------ | Newey-West dlprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- unrest | D1. | .1743814 .0098692 17.67 0.000 .154943 .1938199 LD. | .1290631 .0225295 5.73 0.000 .0846887 .1734375 L2D. | .1346488 .022438 6.00 0.000 .0904546 .1788431 L3D. | .123824 .0230717 5.37 0.000 .0783816 .1692663 L4D. | .1023826 .0242122 4.23 0.000 .0546938 .1500714 L5. | .0921151 .0246738 3.73 0.000 .0435173 .1407129 | _cons | -.0106162 .0049914 -2.13 0.034 -.0204474 -.000785------------------------------------------------------------------------------

.

. /*one can easily copy and paste the output to make the graph. Here, I detail a somewhat more complicated algorithm*/. preserve

. mat beta=e(b)

. svmat beta

. newey dlprice d.l(0/4).unrest l5.unrest, lag(5)

Regression with Newey-West standard errors Number of obs = 254maximum lag: 5 F( 6, 247) = 86.79 Prob > F = 0.0000

------------------------------------------------------------------------------ | Newey-West dlprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- unrest | D1. | .1743814 .0098692 17.67 0.000 .154943 .1938199 LD. | .1290631 .0225295 5.73 0.000 .0846887 .1734375 L2D. | .1346488 .022438 6.00 0.000 .0904546 .1788431 L3D. | .123824 .0230717 5.37 0.000 .0783816 .1692663 L4D. | .1023826 .0242122 4.23 0.000 .0546938 .1500714 L5. | .0921151 .0246738 3.73 0.000 .0435173 .1407129 | _cons | -.0106162 .0049914 -2.13 0.034 -.0204474 -.000785------------------------------------------------------------------------------

. mat var=e(V)

. mat var=vecdiag(var)

. svmat var

. local list "var1 var2 var3 var4 var5 var6 var7"

. foreach x of local list { 2. replace `x'=`x'^0.5 3. }

Page 12

Page 20: PS10sol

ps10answers(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)(1 real change made)

. drop if beta1==.(258 observations deleted)

. stack beta1 var1 beta2 var2 beta3 var3 beta4 var4 beta5 var5 beta6 var6 beta7 var7, into(b se) clear

. gen n=_n-1

. /*dropping the constant term*/

. drop if n==6(1 observation deleted)

. gen upper95=b+se*1.96

. gen lower95=b-se*1.96

. line b upper95 lower95 n

. restore

.

. *3 d)

. newey dlprice l(-5/5).unrest, lag(5)

Regression with Newey-West standard errors Number of obs = 249maximum lag: 5 F( 11, 237) = 73.85 Prob > F = 0.0000

------------------------------------------------------------------------------ | Newey-West dlprice | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- unrest | F5. | .0096682 .0124639 0.78 0.439 -.014886 .0342224 F4. | -.0068581 .0136115 -0.50 0.615 -.033673 .0199568 F3. | .023098 .0109816 2.10 0.036 .001464 .044732 F2. | -.0101823 .0138971 -0.73 0.464 -.0375598 .0171952 F1. | -.0797075 .0133263 -5.98 0.000 -.1059607 -.0534544 --. | .1634954 .0092479 17.68 0.000 .1452767 .181714 L1. | -.0384772 .0163961 -2.35 0.020 -.0707779 -.0061766 L2. | .005792 .0123609 0.47 0.640 -.0185592 .0301432 L3. | -.0101742 .0135264 -0.75 0.453 -.0368215 .0164731 L4. | -.0151749 .0158382 -0.96 0.339 -.0463766 .0160268 L5. | -.0122217 .0142445 -0.86 0.392 -.0402836 .0158402 | _cons | -.0018198 .004554 -0.40 0.690 -.0107914 .0071517------------------------------------------------------------------------------

. testparm F(1/5).unrest

( 1) F5.unrest = 0 ( 2) F4.unrest = 0 ( 3) F3.unrest = 0 ( 4) F2.unrest = 0 ( 5) F.unrest = 0

Page 13

Page 21: PS10sol

ps10answers

F( 5, 237) = 8.22 Prob > F = 0.0000

.

. log close name: <unnamed> log: ps10answers.log log type: text closed on: 6 Nov 2013, 14:17:24-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 14