Recursive regressions: How to plot the coefficients and CIs?

Econometrics questions and discussions
IRJ
Posts: 48
Joined: Wed Jan 10, 2007 1:15 am

Recursive regressions: How to plot the coefficients and CIs?

Unread post by IRJ »

I am performing recursive (and rolling) regressions in RATS. My aim is to plot the (recursive) slope coefficient of the regression along with its two standard deviation confidence interval. I would also like to compute and plot the p-values of the t- (or Wald) test (testing that the slope coefficient is equal to one) and F-test (testing that the intercept is equal to zero and slope is equal to one) for each recursive sample (each run of the loop). Please find below a snippet of the code (similar to the RATS User Guide's code) that (I think) does most of what is required (if correct):

Code: Select all

compute regstart = 1988:02
clear coef1 coef2 pvaluettest pvalueftest
do regend = 1998:2,2008:2
linreg(noprint) spotret3 regstart regend
#constant prem3{1}
compute coef1(regend) = %beta(1)
compute coef2(regend) = %beta(2)
test 
#2
#1.0
compute pvaluettest(regend) = %signif
test
# 1 2
# 0 1
compute pvalueftest(regend) = %signif
end do


Is the above code correct?
I am not sure how to plot the slope coefficient and how to compute and plot the two standard deviation confidence interval for the slope coefficient. I would also like to plot the p-values (for the t-tests and F-tests) for the recursive sample as done for the coefficients. Please find below a link to a paper by Chinn and Coibion (2010) that does what I'm set out to do (without the recursive p-values for t- and F-test computation and plotting) on pages 35, 36 and 37:

http://www.ssc.wisc.edu/~mchinn/commodityfutures.pdf

Thanks.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Recursive regressions: How to plot the coefficients and CIs?

Unread post by TomDoan »

You can use RLS with that to do all the calculations. Some examples with graphs of coefficients and test statistics are:

constant.prg (standard RATS example)
baltp201.prg (Baltagi text)
diebp235.prg (Diebold text)
johnp121.prg (Johnston and DiNardo text)
Post Reply