Announcement

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

  • asdoc on stata for logit regression

    When I write

    logit X Y
    asdoc logit, or

    I get the word print out version of the coefficients table. I want the second line of code (logit, or) which produces the odds ratio to be printed not the logit X Y. How can I do that?

    Thanks in advance


  • #2
    I am not sure whether I understood your question correctly. When you try to output tables from Stata commands with asdoc, you need to add asdoc to the begining of the Stata command. So instead of
    logit y x, try asdoc logit y x. Here is one example with the odds ratio

    Code:
    sysuse auto, clear
    asdoc logit foreign gear_ratio mpg rep78 headroom trunk , or replace
    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	105.5 KB
ID:	1590513


    If the problem still exists, try updating to the latest version
    The new version of asdoc can be installed from my site. Copy and paste the following line in Stata and press enter.
    Code:
    net install asdoc, from(http://fintechprofessor.com) replace
    Please note that the above line has to be copied in full. After installation of the new version, then restart Stata.

    asdocx is now available
    A more powerful and flexible version of asdoc is now available. I call it asdocx. You may like to check the details here

    https://fintechprofessor.com/asdocx


    Please do remember to cite asdoc. To cite:

    In-text citation
    Tables were created using asdoc, a Stata program written by Shah (2018).

    Bibliography
    Shah, A. (2018). ASDOC: Stata module to create high-quality tables in MS Word from Stata output. Statistical Software Components S458466, Boston College Department of Economics.

    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 so much for this, but my problem was rather on getting a table of the odds ratio, I do get a table similar to the one you posted here. But then i perform logit, or to find the odds ratio table, and when i do asdoc for that it keeps printing the table with the coefficients (like shows above), how do I tell it to print the one with the odds ratio instead.

      Comment


      • #4
        Yes, the text "Coef." should be odd ratio. However, please note that the values reported in the above table are actually odd ratios. I shall change the text in the next update. Here is the output without using asdoc
        Code:
        sysuse auto, clear
        logit foreign gear_ratio mpg rep78 headroom trunk , or
        Logistic regression                             Number of obs     =         69
                                                        LR chi2(5)        =      64.70
                                                        Prob > chi2       =     0.0000
        Log likelihood = -10.049049                     Pseudo R2         =     0.7630
        
        ------------------------------------------------------------------------------
             foreign | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
          gear_ratio |    8962.06    26195.7     3.11   0.002     29.13292     2756968
                 mpg |   .7684603   .1235569    -1.64   0.101     .5607394     1.05313
               rep78 |   14.99899   14.76176     2.75   0.006     2.179332    103.2287
            headroom |   1.505806   1.655924     0.37   0.710     .1744651    12.99659
               trunk |   .9047981   .1997435    -0.45   0.650     .5870028    1.394644
               _cons |   1.83e-15   2.27e-14    -2.74   0.006     5.40e-26    .0000621
        ------------------------------------------------------------------------------
        Note: _cons estimates baseline odds.
        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
          Thank you so much!

          Comment


          • #6
            Dear professor Shah,

            Is it possible to add the Prob > chi2 to a nested table in word using asdoc? I have output of a survival analysis that I would like to convert into a word table. My code is currently:

            Code:
            asdoc stcox SIZE ROA CASH LEV DEP PB Market_Sentiment Preference_shares Preference_shares_t Certificates Priority_shares ,cluster(ISIN) nohr  save(Analysis2) replace fs(8) add(Chi2, `e(chi2)', Industry Dummy, YES) dec(3) nest replace dec(3)
            Many thanks in advance!

            Comment


            • #7
              I have not used stcox regression before and hence cannot comment on how to find Prob>chi2. As a general comment, I can guide you to the asdoc help file. In Section 4.10 of the help file, it reads that option stat() can be used to report additional statistics when using option nest. The text from that section is preproduced below.
              Code:
              4.10 stat(stats from e()) (used only with option nest)
                      stat() can be used to report additional regression statistics that are stored in macro
              e(). For example  stat(rmse, rss). Please note that each statistic should be separated by
              the character comma. Some of the most commonly used e()
                      statistics of regression models are as follows:
              
                   
                  ------------------------------------------------------------------------------------------------
                     N          Number of observations. Reported by asdoc as default
                     r2         R-squared. Reported by asdoc as default
                     r2_a       Adjusted r-squared
                     F          F-statistics
                     rmse       RMSE
                     rss        Residual sum of squares
                     ll         Log-likelihood
                     chi2       Chi-square value
               ---------------------------------------------------------------------------------------------------
              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


              • #8
                Dear Professor Shah,

                Thank you for responding. I will improvise a bit and do some things manually then.

                Kind regards,
                Max Welling

                Comment

                Working...
                X