Announcement

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

  • probit model with marginal effects and pseudo R2 using esttab

    Dear statalist,

    I want to output the results of 2 probit models using esttab, I present marginal effects instead of actual coefficients, but somehow the pseudo R2 row is blank in the output table.

    Code:
    probit y xa x2 x3
    eststo model_1: margins, dydx(*) post
    
    probit y xb x2 x3
    eststo model_2: margins, dydx(*) post
    
    logout, save(file1) word replace fix(5): ///
    esttab model_1 model_2, ///
    mtitle(name1 name2) ///
    b(%6.3f) z(%6.3f) ///
    star(* 0.1 ** 0.05 *** 0.01) ///
    scalar(N r2_p) compress nogap
    Following https://www.statalist.org/forums/for...rginal-effects, I add local r2_p= e(r2_p) before eststo, but that doesn't make any difference.

    Please kindly advice me on what's wrong with the code.Thanks a lot!

  • #2
    estout is from the Stata Journal/ SSC, as you are asked to explain (FAQ Advice #12)

    Code:
    probit...
    local r2_p= e(r2_p)
    eststo: margins ..., post
    estadd scalar r2_p = `r2_p'

    Comment


    • #3
      Thanks Andrew for your code and suggestion, and I will make sure to explain next time if I use user-written commands.

      Comment

      Working...
      X