Announcement

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

  • #31
    asreg reports both R2 and adjusted R2. See the following example

    Code:
    . webuse grunfeld, clear
    
    . asreg invest mvalue kstock, by(company )
    
    . ed
    
    . sort year
    
    . list _* in 1/10
    
         +--------------------------------------------------------------------+
         | _Nobs         _R2      _adjR2   _b_mvalue   _b_kstock      _b_cons |
         |--------------------------------------------------------------------|
      1. |    20   .68040764   .64280854   .16237772   .00310173    22.707115 |
      2. |    20   .70530671   .67063691   .02655119   .15169387   -9.9563082 |
      3. |    20   .92135403   .91210157   .11928082   .37144481    -149.7824 |
      4. |    20   .91357845   .90341121   .07794781   .31571818   -6.1899547 |
      5. |    20   .66551452   .62616329   .07538795   .08210356   -7.7228397 |
         |--------------------------------------------------------------------|
      6. |    20   .76350084   .73567741   .08752719   .12378141    -4.499533 |
      7. |    20    .7444461   .71438094   .05289412   .09240652   -.50938763 |
      8. |    20   .64315782   .60117638   .00457343    .4373692    .16151866 |
      9. |    20    .9521422   .94651187   .13145485   .08537425   -8.6855436 |
     10. |    20   .47086233   .40861084   .17485601   .38964188   -49.198313 |
         +--------------------------------------------------------------------+
    
    .
    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
      Dear Professor Shah,

      Thank you for your response. However, when I use, for example asreg F_Excess_USD IVOL, fmb newey(6), I only get the average R^2, just as below.

      Fama-MacBeth Two-Step procedure (Newey SE) Number of obs = 51312
      (Newey-West adj. Std. Err. using lags(6)) Num. time periods = 317
      F( 1, 316) = 1.03
      Prob > F = 0.3115
      avg. R-squared = 0.0416
      ------------------------------------------------------------------------------
      | Newey-FMB
      F_Excess_U~w | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      IVOL_w | -.0612065 .0603753 -1.01 0.311 -.1799948 .0575818
      _cons | .0086751 .0016891 5.14 0.000 .0053517 .0119985
      ------------------------------------------------------------------------------

      In addition, tried to compute idiosyncratic volatility on a rolling basis of 24 months with monthly data. I have created a month/year variable called ymdate.

      This has been my code so far:

      bys perm : asreg Excess_USD_w MKT SMB HML, wind(ymdate 24)
      gen residuals = Excess_USD_w - _b_cons - _b_MKT*MKT - _b_SMB*SMB - _b_HML*HML
      bys perm: egen IVOL=sd (residuals)

      In the end, I want to look at each year. However, my min and max values are the same for multiple years, not just for two years as specified by my rolling window. In addition, my mean value just keep on increasing.

      Would you know what I have done wrong? Thank you very much in advance. I sincerely appreciate your help.

      Best regards,
      Kate

      Comment


      • #33
        Dear Professor Shah,

        Somehow, asreg,fmb gives me the same output regardless of what window I am using is this normal?

        Also I am getting high R2's while my coefficients from the in sample tests are mostly insignficant. Any suggestions?

        Kind regards, Julien.


        Comment


        • #34
          Julien Maas
          The window() option is not intended to be used with the fmb option. The window() option is designed for rolling regressions and does not work with the Fama and MacBeth regressions in asreg.
          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


          • #35
            Dear professor Shah,

            Thank you for your swift response! That makes a lot of sense. So if I run;

            asreg yearly_return pastreturn MVlog logBM, newey(16) fmb window(date -120 -1)

            Then I will get slopes of the entire sample?

            Also I was wondering what is the difference between using xtreg then in that case and asreg, as I get some very different results.

            Furthermore as I am trying to perform in and out of sample tests similar to Lewellen's 2015 paper on a cross section of stock returns,

            I was wondering,
            If I first run (without the fmb);

            asreg yearly_return pastreturn MVlog logBM, newey(16) window(date -120 -1)

            And I get the beta's for each date, based on a ten year rolling return window,

            What is then the best way to summarize the average of these ten year FM slopes for each signal. Displaying it's average slope, t-statistic, and R2. (Similar to table 8b of Lewellen's 2015 paper).

            Thank you in advance for your time and consideration,

            Comment


            • #36
              Hi everyone, Im running a loop in Stata and found that asreg is really usefull. However, when I compare the two results, it is different, here are my code:
              Using loop (traditional way):
              forvalues i=1(1) 3 {
              reg return market_ret if id==`i' & estimation_window==1
              predict p if id==`i'
              replace normal_return= p if id ==`i' & event_window==1
              drop p
              }

              Using asreg:
              bys id: asreg return market_ret, w(datenum 100) fit se

              Do you know why the results are different?

              Comment


              • #37
                Originally posted by Attaullah Shah View Post
                Option noconstant was added to asreg version 3.1.1 (26 July, 2018). However, that option works only with rolling window regressions and by-group regressions. I shall consider adding noconstant for option fmb in the next update.
                Dear Prof. Shah,
                Im running a loop in Stata and found that asreg is really usefull. However, when I compare the two results, it is different, here are my code:
                Using loop (traditional way):
                forvalues i=1(1) 3 {
                reg return market_ret if id==`i' & estimation_window==1
                predict p if id==`i'
                replace normal_return= p if id ==`i' & event_window==1
                drop p
                }

                Using asreg:
                bys id: asreg return market_ret, w(datenum 100) fit se

                Do you know why the results are different?
                Thank you a lot for your time and your help!!

                Comment


                • #38
                  Use the if statement with asreg as well. The window option in asreg implies a rolling window.

                  Code:
                  bys id: asreg return market_ret if estimation_window==1,  fit se
                  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
                    Dear Attaullah Shah

                    I was wondering if you had any experience running Fama Macbeth regressions with unbalanced panel data.

                    The data in question is unbalanced as I have firm fundamental information by year over the period 1987 - 2023. Naturally firms IPO at later dates or cease trading at various stages over this period.

                    I am running the following code;

                    logit DivPayer idiosyncratic_volatility M2B Asset_Growth Profitability SIZE

                    estimates store logit_model
                    estimates table logit_model, eform
                    xtset gvkey stata_date

                    newey DivPayer Legislation_Dummy idiosyncratic_volatility M2B Asset_Growth sqrt_profitability SIZE, lag(2)

                    However I get a

                    "year is not regularly spaced
                    r(198);"

                    error when attempting to run the code. Any idea how to resolve this issue?

                    Cheers,
                    Flynn


                    Comment

                    Working...
                    X