Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: re: rollreg module

From   Christopher Baum <>
To   <>
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 Baum   |   Boston College Economics & DIW Berlin   |
                              An Introduction to Stata Programming  |
   An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index