Announcement

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

  • Exporting margins table

    Hello guys,
    I have a question related to exporting margins table. I have been outreg2 to export margins table until now. The problem I have is that when I export the table, I don't get the same result as in the result table. I am struggling to articulate my outreg2 command properly.

    I used this code: [outreg2 using test2.doc, word replace ctitle(Predicted prob.) addnote(NOTE: All predictors at
    their mean value)][/CODE]

    Click image for larger version

Name:	Screenshot 2022-09-21 140213.jpg
Views:	1
Size:	19.4 KB
ID:	1682835
    Click image for larger version

Name:	Screenshot 2022-09-21 140317.jpg
Views:	1
Size:	62.1 KB
ID:	1682836

  • #2
    -outreg- and similar pretty-print commands output the estimates currently stored in e() unless you specify otherwise. -margins- does not, by default, post its results in -e()-, so these programs are unaware of their existence and give you back the results of the regression that preceded.

    However, -margins- has a -post- option which will cause it to overwrite e() with its own results. So the problem is not with your -outreg- command. You just need to add the -post- option to your -margins- command. Then -outreg2- will work with the -margins- output.

    Comment


    • #3
      Thank you, that's very helpful

      Comment

      Working...
      X