Recursive regressions: How to plot the coefficients and CIs?
Posted: Sun Apr 11, 2010 12:20 pm
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):
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.
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.