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]
re: st: rollreg - r134
From
Christopher Baum <[email protected]>
To
"[email protected]" <[email protected]>
Subject
re: st: rollreg - r134
Date
Wed, 2 May 2012 20:36:17 -0400
<>
> Oh, yes, rollreg from SSC.
>
> OK. So I have to get rid off the gaps. I have generated a new variable:
> by cusip: generate datecontrol=datemonthly[_n]-datemonthly[_n-1]
>
> If the variable is larger than 1 there is a gap in the monthly time series. Instead of dropping a cusip completely if there is datecontrol>1, I would like to keep either the observations befor or after the gap depending on the length of the time series without a datecontrol>1. The longer the better.
>
> How do I have to proceed or is there a more elegant way?
my -onespell- routine on SSC does exactly that.
Kit
author of -rollreg-
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/