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]

R: st: re: rollreg module

From   "" <>
To   <>
Subject   R: st: re: rollreg module
Date   Sun, 6 Feb 2011 20:22:56 +0100 (CET)

Thanks a lot for the feedback, Kit. I think the best strategy should be to 
split the data as you suggested.


>----Messaggio originale----
>Data: 5-feb-2011 21.34
>A: <>
>Ogg: st: re: rollreg module
>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 
>that there are no gaps and I get an error message. If I fill the gaps by 
>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 
>units with gaps?
>I also tried the rolling prefix to regress, but in this case the 
>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   |   http://ideas.repec.
>                              An Introduction to Stata Programming  |   http:
>   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-
>*   For searches and help try:

*   For searches and help try:

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