Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: question about stata and rolling regressions


From   Kit Baum <baum@bc.edu>
To   Bethany.J.Tinlin@clev.frb.org, statalist@hsphsun2.harvard.edu
Subject   st: Re: question about stata and rolling regressions
Date   Wed, 18 Jul 2007 16:22:02 -0400

Bethany,
The current design of -rollreg-, as you probably know, leaves behind timeseries of coefficient estimates and of their standard errors. It does not leave behind the full VCE from each regression. That full VCE (in particular the off-diagonal elements) would be needed to do any test on multiple coefficients such as lincom provides.

As far as I can see the official Stata rolling: prefix will not do this either if the command is regress. You can save _b and _se, but not matrices (matrix operators that return matrices not allowed in this context; error in expression: e(V)).

To circumvent this with rolling: you need to write a 'wrapper' program for regress and lincom, such as

program myregress, rclass
version 9.2
syntax varlist(ts) [if]
regress `varlist' `if'
lincom L.wpi+L2.wpi+L3.wpi+L4.wpi
return scalar sum=`r(estimate)'
return scalar se=`r(se)'
end

and then execute it with

webuse wpi1,clear
rolling sum=r(sum) se=r(se) ,window(30) saving(bethany,replace) : myregress wpi L(1/4).wpi t

The resulting file (bethany.dta) will contain the lincom estimates and their standard errors for each period.

Thanks
Kit


Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html

On Jul 18, 2007, at 11:30 AM, Bethany.J.Tinlin@clev.frb.org wrote:



I have been using your stata program to run rolling regressions. My empiricial model has four lags of the dependent variable and I am interested in the sum of the coefficients and the standard error of this sum. Is there a command to have your program generate the time series of this standard error? I know that the command "lincom" does this in the base stata program. Can this command be used within your program?

Thanks for your time.

_____________________
Bethany Tinlin
Research Department
Federal Reserve Bank of Cleveland
P.O. Box 6387
Cleveland, OH 44101-1387
____________________
Phone: (216) 579-2059
Fax: (216) 579-3050
Email: Bethany.J.Tinlin@clev.frb.org
http://www.clevelandfed.org
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index