Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Since your window is 15, you should use the option min(15) to suppress the regression coefficients arising out of less than 15 observations.
    Code:
     . webuse grunfeld, clear
     
     . bys company: asreg invest mvalue kstock, wind(year 10) min(10)
    
         +--------------------------------------------------------------------+
         | _Nobs         _R2      _adjR2   _b_mvalue   _b_kstock      _b_cons |
         |--------------------------------------------------------------------|
      1. |     .           .           .           .           .            . |
      2. |     .           .           .           .           .            . |
      3. |     .           .           .           .           .            . |
      4. |     .           .           .           .           .            . |
      5. |     .           .           .           .           .            . |
         |--------------------------------------------------------------------|
      6. |     .           .           .           .           .            . |
      7. |     .           .           .           .           .            . |
      8. |     .           .           .           .           .            . |
      9. |     .           .           .           .           .            . |
     10. |    10   .46011588   .30586328   .05693085   .46800615    96.771625 |
         |--------------------------------------------------------------------|
     11. |    10    .5614129    .4361023   .08887698   .88729908   -126.96142 |
     12. |    10   .78380282   .72203219   .08872388   1.2292866   -214.23699 |
     13. |    10   .71488429   .63342265   .12516278   .42876425   -160.50868 |
     14. |    10   .45098464   .29412311   .11227122   .29657166   -65.906213 |
     15. |    10   .52009389   .38297786    .0912647   .16681578     85.23875 |
         |--------------------------------------------------------------------|
     16. |    10   .72287646    .6436983   .10511862   .17118093    38.538037 |
     17. |    10   .88167177    .8478637   .11069522   .16073767    27.814834 |
     18. |    10   .91376003   .88912004   .13377585   .20041587   -91.965695 |
     19. |    10   .95105686    .9370731    .1749349   .25069983   -299.34944 |
     20. |    10   .94840015   .93365733   .17671561   .34521899   -390.57569 |
         +--------------------------------------------------------------------+
    You can explore more about asreg here https://fintechprofessor.com/2017/12...ions-in-stata/
    Last edited by Attaullah Shah; 29 Apr 2022, 05:21.
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #32
      On running the following example mentioned in the help document, I am getting an error. Could someone please guide me.

      webuse grunfeld, clear
      bys company: asreg invest mvalue kstock, wind(year 10)

      =0 invalid name
      r(198);

      Comment


      • #33
        The recent update to asreg has this bug. I have fixed it and sent it to the SSC. Hopefully, it will be updated in a few days. In the meanwhile, you can download it from my site using the following code
        Code:
        net install asreg, from(http://fintechprofessor.com) replace
        After installation, check the latest version with:
        Code:
        . which asreg
        
        *! Attaullah Shah ;  Email: [email protected] ; * Support website: www.FinTechProfessor.com
        *!Version 4.8 : Dec 27, 2022 : Option newey(0) would default to standard errors. This is has been fixed.
        Regards
        --------------------------------------------------
        Attaullah Shah, PhD.
        Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
        FinTechProfessor.com
        https://asdocx.com
        Check out my asdoc program, which sends outputs to MS Word.
        For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

        Comment


        • #34
          Hi! Could someone help me with an issue?

          I'm trying to do a two stage fama mcbeth regression on stata by running this code:

          ado uninstall asreg
          ssc install asreg

          xtset ret ym

          sort id ym

          *First step command

          bys id: asreg ret mktrf smb hml rmw cma pvs

          drop _R2 _adjR2

          *Second step command

          asreg ret _b_mktrf _b_smb _b_hml _b_rmw _b_cma _b_pvs _b_cons, fmp

          I keep geting the error "option fmp not allowed" at the second step. I tried the uninstall and install again command but doesn't change a thing. The only thing that comes to mind is that I am using a small number of id's (portfolios in this case), only 6. Could this be the problem?

          Thank you in advance.

          Comment


          • #35
            The option is not
            Code:
            fmp
            It is
            Code:
            fmb
            To read more about asreg and its options, visit the main page of asreg . For Fama and MacBeth regressions, visit this page.
            Last edited by Attaullah Shah; 07 Sep 2023, 02:36.
            Regards
            --------------------------------------------------
            Attaullah Shah, PhD.
            Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
            FinTechProfessor.com
            https://asdocx.com
            Check out my asdoc program, which sends outputs to MS Word.
            For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

            Comment


            • #36
              Indeed! Sorry for the rookie mistake still getting used to the package... But thank you very much, I successfully ran the regression!

              The only thing that is puzzling me now is that even though I use the Fama-French 5 factor model, plus a new factor I am testing the signficance, I still get a significant and very high constant (around 1% monthly), which It's certainly too high. Any tips on how to deal with this? Thank you in advace!

              Comment


              • #37
                Hi,

                I'm wondering is there a way to output standard errors of the residuals for each regression when apply asreg?

                Thank you in advance.

                Comment


                • #38
                  Use the option fit to report residuals with each regression, then you may calculate the standard errors in a usual manner.
                  Code:
                  . webuse grunfeld, clear
                  
                  bys company: asreg invest mvalue kstock, wind(year 10) fit
                  
                       +-----------------------------------------+
                       | company   year     _fitted   _residuals |
                       |-----------------------------------------|
                    1. |       1   1935           .            . |
                    2. |       1   1936           .            . |
                    3. |       1   1937           .            . |
                    4. |       1   1938   257.91024   -.21023193 |
                    5. |       1   1939    337.5661   -6.7661144 |
                       |-----------------------------------------|
                    6. |       1   1940   387.80812    73.391895 |
                    7. |       1   1941   423.96115    88.038848 |
                    8. |       1   1942   395.00509    52.994906 |
                    9. |       1   1943   437.38193    62.218072 |
                   10. |       1   1944   440.43891    107.06109 |
                       +-----------------------------------------+
                  Regards
                  --------------------------------------------------
                  Attaullah Shah, PhD.
                  Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
                  FinTechProfessor.com
                  https://asdocx.com
                  Check out my asdoc program, which sends outputs to MS Word.
                  For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

                  Comment


                  • #39
                    Hi Dr. Attaullah,

                    Thank you for your prompt reply. I apologize for any confusion in my previous message. To clarify, I am seeking to obtain the standard errors of residuals for each rolling regression, similar to how we have an R^2 for each rolling regression. From my understanding, the fit option only provides the residual of the last observation in each rolling regression, which does not fulfill my requirement. I would greatly appreciate any suggestions on how to achieve this.

                    Thanks,
                    Jie

                    Comment

                    Working...
                    X