Announcement

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

  • Report pseudo r-squared with marginal effect (logit)

    Hi,

    I am currently using the following code to export the marginal effects from my logit regression results to a word document:

    Code:
    logit y x
    margins, dydx (*) atmeans post
    outreg2 using output.doc, replace

    However, I want to add the pseudo r-squared to my document but I'm not sure how to do it. I would normally use:

    Code:
    addstat(Pseudo R-squared, e(r2_p))
    if I was just exporting the logit regression results, but this code does not work for the marginal effects.

    Thanks,
    Amy

  • #2
    See

    Code:
    help macro
    for a way to temporarily hold statistics. More discussion at https://journals.sagepub.com/doi/abs...urnalCode=stja. outreg2 is from SSC, as you are asked to explain.

    Code:
    logit y x
    local r2_p= e(r2_p)
    margins, dydx (*) atmeans post
    outreg2 using output.doc, replace addstat(Pseudo R-squared, `r2_p')

    Comment

    Working...
    X