Bookmark and Share

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   "Fabian Schönenberger" <sch.f@gmx.ch>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: rollreg - r134
Date   Wed, 02 May 2012 23:15:41 +0200

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?

Kind regards, Fabian



-------- Original-Nachricht --------
> Datum: Wed, 2 May 2012 21:21:15 +0100
> Von: Nick Cox <njcoxstata@gmail.com>
> An: statalist@hsphsun2.harvard.edu
> Betreff: Re: st: rollreg - r134

> -rollreg- is from SSC. Please recall that you are asked to explain
> where user-written programs you refer to come from.
> 
> -rollreg- itself does not ever issue error 134 so far as I can see.
> 
> My guess is this.
> 
> guess {
> 
> You are running -rollreg-, which in turn runs -tsreport-, which in
> turn finds gaps. -tsreport- would use  -tabdisp- for display but you
> hit limits on how much it can display.
> 
> But -rollreg- does not allow gaps any way. So what you are finding is
> that -rollreg- is failing to tell you that you cannot use it because
> your dataset triggers a system limit first.
> 
> }
> 
> Nick
> 
> On Wed, May 2, 2012 at 8:56 PM, "Fabian Schönenberger" <sch.f@gmx.ch>
> wrote:
> > Dear all
> > I have a problem running rollreg regression for my panel data. The
> sample is very large, about 2'400'000 observations. First, I tsset the date:
> >
> > . tsset cusip datemonthly
> >       panel variable:  cusip (unbalanced)
> >        time variable:  datemonthly, 1969m2 to 2012m2, but with gaps
> >                delta:  1 month
> >
> > I want to conduct rolling regressions for my panel date. I tried:
> >
> > rollreg stockpremium marketpremium, move(36) stub(capm)
> >
> > The output is:
> > Observations with preceding time gapstoo many values
> > r(134);
> >
> > I did some internet research and found out that some years ago the same
> problem was discussed among Statalist. However, I did not find a solution
> for the problem. I am not sure if the problem are too many values, or the
> gaps. I dropped all missing observations (monthly stock prices). However, it
> is possible that for some cusips the sequence of months has gaps. The
> reason why I want to conduct rollreg is that I am interested in how the
> explanatory power of marketpremium changes over time.
> >
> > Any advice?
> >
> > Many thanks, Fabian
> > --
> > NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!
> > Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a
> > *
> > *   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/
> 
> *
> *   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/
-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!                                  
Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a
*
*   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/


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