Announcement

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

  • #16
    Hi,

    I'm applying asreg command for Fama Mcbeth regressions
    I want to add industry dummy as i.ind but it is giving me error that "factor-variable and time-series operators not allowed"
    Can you please help out on this

    Regards,

    Shafaq

    Comment


    • #17
      You are right, version 3.1 of asreg does not support factor variables in the varlist. As a workaround, you can do the following

      Code:
      tab ind, gen(inddum)
      asreg y x1 x2 x3 inddum*, fmb
      The
      Code:
      tab ind, gen(inddum)
      will create dummy variables for the ind categories. This approach is not memory-efficient as it creates unnecessary variables, however, it is a workaround as mentioned above. Later on, you can drop the dummies by
      Code:
      drop inddum*
      Be careful while using the wildcard * as any variable with the prefix of inddum will be dropped.

      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


      • #18
        Dear Attaullah,
        Thank you so much for helpful suggestion.

        Regards,

        Shafaq

        Comment


        • #19
          asreg version 3.2 is now available for download from SSC (thanks to Kit Baum). This version fixes a minor bug in one of the Mata functions. Mata function ASREG4s0f1() would throw an error if option fit was used on a dataset that did not have enough observations for estimating a regression. To update,
          Code:
          ssc install asreg, replace
          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


          • #20
            Recently used asreg to find rolling window market betas. Extremely useful program that runs quickly and smoothly. As a bonus, Dr. Shah is very responsive to questions about the code, too!

            Comment


            • #21
              Dear Professor Shah, I was wondering how I can export the standard errors and the degrees of freedom from the first stage Fama-Macbeth regression using asreg. You posted the code
              asreg invest mvalue, fmb save(eq1) first but how can we get these additional statistics.

              Comment


              • #22
                Vince Williams I have shown one method of doing so in this blog post.
                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


                • #23
                  Dear Professor Shah,

                  I am using your asreg command combined with the Fama/MacBeth two-step procedure but it seems like the command does not work correctly although I don't get an error message.
                  Can you maybe help detect my error? Note that I use Fama/MacBeth for a different setting as originally used by the authers, that is I use it to analyze determinants of efficiency.

                  asreg EFFICIENCY L1_IO L1_MV L1_LIQU, fmb first

                  where EFFICIENCY is the dependent variable (efficiency measure per firm and month, estimated before) and the independent variables are estimarors for institutional ownership(IO), size(MV), and liquidity(LIQU), each lagged by one period (note that no factor variables are used, I generated the lagged variables beforehand).

                  Problem 1: This regression only displays missing values (.) in the first regressions table but delivers results in the second step (Note that I deleted some rows in between the table to better fit it in here).

                  Click image for larger version

Name:	ASREG_fmb_first_lag.JPG
Views:	2
Size:	87.5 KB
ID:	1475215

                  If I adjust the regression to using contemporaneous independent variables, the first regressions table shows results, but then another problem arises:

                  asreg EFFICIENCY IO MV LIQU, fmb first

                  Problem 2: This regression displays values in the first regressions table, however, not for all time periods (161 time periods, 131 lines) and shows missing rows in between (eg between 6 and 7).

                  Also here I deleted rows in between so it's easier to understand the regression output.

                  Click image for larger version

Name:	ASREG_fmb_first.JPG
Views:	1
Size:	131.6 KB
ID:	1475216


                  Any hint/comment is highly appreciated!


                  Many thanks and kind regards,

                  Jasmin
                  Attached Files

                  Comment


                  • #24
                    Please report an example dataset using dataex(from SSC). Also, please quote the asreg version
                    Code:
                    which asreg
                    Stata version and operating system (Windows, macOS, etc)
                    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


                    • #25
                      Jasmin Hennig You can also read my blog post on how to estimate the first stage regression of Fama and MacBeth (1973) procedure. The blog entry is given at https://fintechprofessor.com/2018/12...dure-in-stata/
                      The blog post shows that the first stage regression can be obtained from the asreg's fmb option or using the cross-sectional regression of asreg. In the latter case, you can also get other regression components. I think this will give you a better idea of where your error is coming from.
                      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


                      • #26
                        Dear Professor Shah,

                        thanks for your quick reply.
                        Can you tell me how to display the first regressions table after running the following command (as speccified in the mentioned blog post)?
                        bys year: asreg invest mvalue kstock, se bys year: keep if n == _N Kind regards, Jasmin

                        Comment


                        • #27
                          Code:
                          webuse grunfeld, clear
                          bys year: asreg invest mvalue kstock, se
                          bys year: keep if _n == _N
                          list _*
                          
                           +------------------------------------------------------------------------------------------------------+
                               | _Nobs         _R2      _adjR2   _b_mvalue    _b_kstock      _b_cons   _se_mv~e   _se_ks~k   _se_cons |
                               |------------------------------------------------------------------------------------------------------|
                            1. |    10   .86526202   .82676546   .10249786   -.00199479    .35603339   .0157931   .2148591   23.82794 |
                            2. |    10   .69639369   .60964903   .08370736   -.05364126    15.218946   .0211982   .4125528   49.72796 |
                            3. |    10    .6637627   .56769491    .0765138    .21772236   -3.3864706   .0218952   .4745161   62.14382 |
                            4. |    10   .70557727   .62145649   .06801777    .26911462   -17.581903   .0220019   .2076121   33.62243 |
                            5. |    10   .82660153   .77705911   .06552194    .19866456   -21.154227   .0131751   .1563955   29.10151 |
                               |------------------------------------------------------------------------------------------------------|
                            6. |    10   .83925512   .79332801     .095399    .20229056   -27.047068   .0171077   .2206074   42.49812 |
                            7. |    10   .85621485   .81513338   .11476375    .17746501   -16.519486   .0197202   .2338307   47.43406 |
                            8. |    10   .85730699   .81653756   .14282513    .07102405   -17.618283   .0246973   .1966943   43.85369 |
                            9. |    10   .84206394   .79693935   .11860951    .10541193   -22.763795   .0207092   .1887016    46.8604 |
                           10. |    10   .87551498   .83994783   .11816422    .07220719   -15.828145   .0169881   .1537212   41.84578 |
                               |------------------------------------------------------------------------------------------------------|
                           11. |    10   .90679731   .88016797    .1084709    .05022083   -10.519677   .0133214   .1254533   35.10524 |
                           12. |    10   .89475165    .8646807   .13794817    .00541339   -5.9906571    .018637   .1600683   45.73243 |
                           13. |    10   .89123943   .86016498   .16392696   -.00370721   -3.7324894   .0280743   .1285463   37.80575 |
                           14. |    10    .7888235   .72848735    .1786673   -.04255555    8.5388099   .0463983   .1661775   52.39133 |
                           15. |    10   .86325678   .82418728   .16159617   -.03696511    5.1782863   .0346516   .1268614   41.07802 |
                               |------------------------------------------------------------------------------------------------------|
                           16. |    10   .85771384   .81706065   .17621675   -.02209565    -12.17468   .0393216   .1361792    46.6222 |
                           17. |    10   .87377295   .83770808   .18314051   -.11205694    26.138157   .0358898   .1486738   53.00348 |
                           18. |    10   .84612242   .80215739   .19892081   -.06749499    7.2928402    .052286   .1906835   67.84544 |
                           19. |    10   .88926056   .85762072   .18267385    .09875335   -50.152546    .058579   .2164437   77.91569 |
                           20. |    10   .89845005   .86943578   .13451162    .33137459   -133.39308   .0704524   .1932826   76.18067 |
                               +------------------------------------------------------------------------------------------------------+
                          
                          * Too see in the data
                          browse _*
                          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


                          • #28
                            Dear Professor Shah,

                            How do I keep the t-test value for each coeficient for regression?

                            Thanks in advance

                            Comment


                            • #29
                              Here is one way one to find t statistics using asreg http://fintechprofessor.com/2018/03/...tics-se-stata/
                              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


                              • #30
                                Hello Mr. Shah,

                                I was wondering how it is possible to calculate adjusted R^2 through asreg? I only receive the average R^2 as output. Thank you kindly.

                                Comment

                                Working...
                                X