Home Forums ASREG : Rolling window and Fama-MacBeth Regressions CAPM with ASREG in Stata using Hourly Data

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Messir Maz
    Guest
    Post count: 118

    I came across your extremely helpful ASREG stata module . I would like to use it to estimate CAPM beta using the hourly data in 17,520 hour windows (2 years) for 155 groups. However, once implemented, I noticed that the number of observations reaches 17,500 (as captured by the variable _Nobs) and then it does no grow beyond that number even though in the dataset there is more than 17500 observations per group. Do you think this is the programming error? Why, according to you, I have come across this type of limitation?

    Thank you very much in advance for your invaluable input.
    Messir
    Associate Professor of Finance

    Attaullah Shah
    Keymaster
    Post count: 69

    Thanks for your feedback. Can you please share some data (real or fake) so that I can reproduce the error. There is no internal limitation on maximum number of observations in asreg.

    Attaullah Shah
    Keymaster
    Post count: 69

    The following statistics show that there are gaps in your range variable – hours. Due to these gaps, you never achieve the maximum number of observations in your regression. The max goes to 17508. And in some cases, the gap is 191 periods.

    bys group: asreg ret btcret, wind (hours 17520)
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
           _Nobs |     55,984    14057.27    4615.921          3      17508
             _R2 |     55,984     .286359      .16784   4.19e-06   .6340864
          _adjR2 |     55,984    .2861602    .1681217   -.441666   .6340654
       _b_btcret |     55,984    .8394192    .3598068  -1.821103   69.31989
         _b_cons |     55,984    .0003909    .0014452  -.2672959   .0135633
    
    . bys group (hours ) : gen dif = hours - hours[_n-1]
    (1 missing value generated)
    
    . sum dif
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
             dif |     56,001    1.101266    1.175469          1        191
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.