Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: re: rollreg module
From
Christopher Baum <[email protected]>
To
<[email protected]>
Subject
st: re: rollreg module
Date
Sat, 5 Feb 2011 15:34:54 -0500
<>
I have a panel dataset and I am trying to use the rollreg module to run
rolling regressions for each unit in the sample.
Unfortunately my sample has gaps in time for many units. The program requires
that there are no gaps and I get an error message. If I fill the gaps by using
the tsfill command (so by setting the gaps to be missing observations) the
command still doesn't work.
Do you know if there is a way to run the rollreg command without dropping the
units with gaps?
I also tried the rolling prefix to regress, but in this case the computation
time is too long with a very large dataset.
No. rollreg, a routine of mine from SSC, does not function when there are gaps, implicit or explicit, in time-series data. Neither do a large number of official Stata commands that work with time series data. If there are one-period gaps you could try filling with averages of adjacent observations as an alternative to dropping those units. Do you have any understanding of why the missing values occur? Do they represent just non-reported values, or a lack of activity (e.g. no trading in that interval)? Could you use Stata's -mi- logic to deal with this?
As both -rollreg- and the -rolling- prefix are ado code, I don't know why -rolling- would be faster. But you could always split the task up into handling the first half of the panel units separately from the second half, or split it into quarters, etc. as with -rolling- you get a separate dataset.
Kit
Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/