Announcement

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

  • grstest output into excel

    Hello everybody,

    Do you know how I can extract the results from a GRS-test into a table?

    My current code looks as follows:
    Code:
    * GRS CAPM
    grstest er*, flist(rm) ret(r)
    grstest2 er*, flist(rm) alphas
    
    *GRS 3-factor model
    grstest er*, flist(rm SMB HML) ret(r)
    grstest2 er*, flist(rm SMB HML) alphas
    
    *GRS 4-factor model
    grstest er*, flist(rm SMB HML UMD) ret(r)
    grstest2 er*, flist(rm SMB HML UMD) alphas
    
    *GRS 5-factor model
    grstest er*, flist(rm SMB HML CMA RMW) ret(r)
    grstest2 er*, flist(rm SMB HML CMA RMW) alphas
    
    *GRS 6-factor model
    grstest er*, flist(rm SMB HML CMA RMW UMD) ret(r)
    grstest2 er*, flist(rm SMB HML CMA RMW UMD) alphas
    clear
    I would like to extract the GRS-test statistic (from the code grstest) and the average absolut value of intercept (from the code grstest2).

    Thanks in advance!

    Pascal


  • #2
    You can use asdoc to export it to Word or asdocx (to Excel etc). Here is an example
    Code:
    ssc install asdoc
    
    sysuse auto
    grstest2 price mpg rep78 headroom trunk , flist( turn ) alphas
    asdoc wmat, mat(R) replace
    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	37.4 KB
ID:	1578372


    with asdocx https://fintechprofessor.com/asdocx/

    Code:
    asdocx wmat, mat(R) replace save(grs.xlsx)
    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	77.5 KB
ID:	1578373
    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


    • #3
      Thank you very much - the asdoc code worked.

      Comment


      • #4
        One additional feature of asdoc, that I have not yet documented it, is to use customized decimal points for each column. So for the p-value column, that is column 4, you may use four decimal places with option c4_dec(4) along with the tzok option. tzok is used to report trailing zeros.
        Code:
        asdoc wmat, mat(R) replace c4_dec(4) tzok
        Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	14.6 KB
ID:	1578575


        Acknowledgement:
        Prof Eric Melse ericmelse supported the addition of this feature to asdoc.
        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


        • #5
          Thanks again. I assume the results from

          Code:
          grstest er*, flist(rm) ret(r)
          cannot be extracted into a table since the output is given as a sentence.

          Therefore, my question: Is there another code, which returns the same GRS test results? I tried to use grstest2 and grsftest but the results are different.

          Thank you very much for your help.

          Comment

          Working...
          X