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   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: rollreg - r134
Date   Thu, 3 May 2012 08:27:34 +0100

I won't encourage or support your doing this. It's at best a fudge. I
think you need to write a loop from first principles.

Nick

On Wed, May 2, 2012 at 10:15 PM, "Fabian Schönenberger" <[email protected]> wrote:
> 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?

Von: Nick Cox <[email protected]>
>
>> -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" <[email protected]>
>> 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.
>> >

*
*   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