Announcement

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

  • Probit marginal effects output table to Word

    Hi,

    I'm trying to make a regression table using Probit which reports marginal effects, and which I can put in a Word document such that it looks like journal article tables.

    I followed advice from here but when typing outreg2 using results, word it says file results.txt could not be opened.

    Is there a way to fix this issue? Or is there an easier way to make such a regression table?


    Many thanks.

  • #2
    outreg2 is from SSC (FAQ Advice #12). You do not show your regression command. Note that the probit coefficients are not marginal effects, so you should use margins with the -post- option to get the marginal effects.


    word it says file results.txt could not be opened.

    Make sure that the file results.txt is not open, and add the -replace- or -append- option if such a file already exists.
    Last edited by Andrew Musau; 10 Aug 2021, 10:21.

    Comment


    • #3
      Thanks! I wrote this:

      probit eh5 h3, r
      margins, dydx(*) atmeans
      outreg2 using results, word


      and it said: file results.txt could not be opened

      I do not have a file called results.txt because this website wrote that the command I used will generate the file.

      What's going wrong here?

      Comment


      • #4
        First

        Code:
        ssc install outreg2, replace
        Then try

        Code:
        probit eh5 h3, r
        margins, dydx(*) atmeans post
        outreg2 using results, word replace

        Comment


        • #5
          Thanks, but it still says file results.txt could not be opened

          Comment


          • #6
            I cannot tell you what the issue is. The following works for me:

            Code:
            webuse lbw, clear
            probit low age ui ht i.race
            margins, dydx(*) atmeans post
            outreg2 using results, word replace
            Res.:

            Code:
            . outreg2 using results, word replace
            results.rtf
            dir : seeout

            Comment


            • #7
              Thanks, turns out I was using an online directory - that was the problem

              Comment


              • #8
                Andrew Musau Any advice on how to generate a multiple marginal effects table for three regressions ( probit, IV, 2SLS)?

                Comment


                • #9
                  IV is ambiguous, 2SLS is linear IV regression. For linear models, the coefficients are themselves marginal effects. If using outreg2, you want something like

                  Code:
                  probit...
                  margins ..., post
                  estimates store probit
                  ivregress 2sls ...
                  estimates store iv2sls
                  outreg2 [probit iv2sls] using myfile, replace
                  Or using estout from SSC


                  Code:
                  probit...
                  margins ..., post
                  estimates store probit
                  ivregress 2sls ...
                  estimates store iv2sls
                  esttab probit iv2sls using myfile, replace

                  Comment


                  • #10
                    Andrew Musau Thank you so much! I have used the outreg2 and it worked very well, however the labels are not exported to the word doc the way they are shown in my stata window. The categories of the variables are shown not with their unique labels, is there a way to correct for this? And if there a way to add additionally (Wald test of exogeneity: χ 2 ,ρ12 =Corr(υ1, υ2) ..) to the bottom of the table?
                    Click image for larger version

Name:	outreg2.PNG
Views:	1
Size:	20.3 KB
ID:	1628947

                    Last edited by Hend She; 24 Sep 2021, 10:15.

                    Comment


                    • #11
                      For the labels, include the -label- option

                      Code:
                      outreg2 using myfile, label
                      For including statistics, see

                      Code:
                      help outreg2
                      under

                      9. Adding r( ) e( ) scalars

                      Comment


                      • #12
                        Thank you so much! Unfortunately, I have tried different commands used there but still not working to get these, Wald test of exogeneity: χ 2 ,ρ12 =Corr(υ1, υ2)

                        Comment


                        • #13
                          Reproducible example? As always, see FAQ Advice #12.

                          Comment


                          • #14

                            Code:
                            . outreg2 [probit ivprobit iv2sls] using myfile.doc, label adds("Wald chi2 (`=e(df_m)') ", e(chi2), Prob > chi2) replace
                            I get
                            check eret list for the existence of e(chi2)

                            Comment


                            • #15
                              Sorry, that does not help. Look at

                              Code:
                              help probit
                              help ivprobit
                              help ivregress 2sls
                              for examples and describe what statistic you need to output, showing an example. If this does not make sense, please (re)read FAQ Advice #12.

                              Comment

                              Working...
                              X