Announcement

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

  • Esttab for marginal effects

    Hi All

    I am failing to tabulate my marginal effects results from my ologit. I have five outcomes and would like them to appear in one table. The commands I am using are as follows:

    Code:
    est clear 
    eststo clear 
    
    *Ordered Logit model
    ologit W8GENA ehat W8DLOCUS i.sex i.eth1 i.W8EVERMAR W8DINCW i.W8WRKHRSA wksearly i.W8DDEGP i.W8TAKEAW i.W8FIZZY W8SOCIALMED i.W1tvYP i.W1fameatYP i.W8AUDIT2 W8SLEEP2 i.W5agebd10mum i.educp, nolog
    
    *Marginal effects 
    
    eststo m1: margins, dydx(*) predict(outcome(1)) 
    eststo m2: margins, dydx(*) predict(outcome(2))
    eststo m3: margins, dydx(*) predict(outcome(3))
    eststo m4: margins, dydx(*) predict(outcome(4))
    eststo m5: margins, dydx(*) predict(outcome(5))
    esttab m1 m2 m3 m4 m5
    All this does is tabulate the first result into five columns.

    Kind Regards
    Nonsi Nkomo

  • #2
    From the help file of Ben Jann's contributed package ESTOUT (available on SSC)
    eststo stores a copy of the active estimation results for later tabulation
    In this case, the active estimation results are the ordered logit results. You can change the active estimation results to the results of the margins command with the -post- option, but you will need to rerun your logit model after each call to margins:

    Code:
    clear
    webuse fullauto.dta
    
    
    ologit rep77 foreign length mpg
    eststo m1: margins, dydx(*) predict(outcome(1)) post
    
    ologit rep77 foreign length mpg
    eststo m2: margins, dydx(*) predict(outcome(2)) post
    
    ologit rep77 foreign length mpg
    eststo m3: margins, dydx(*) predict(outcome(3)) post
    
    ologit rep77 foreign length mpg
    eststo m4: margins, dydx(*) predict(outcome(4)) post
    
    ologit rep77 foreign length mpg
    eststo m5: margins, dydx(*) predict(outcome(5)) post
    
    
    esttab m1 m2 m3 m4 m5
    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment


    • #3
      Hi Carole

      Thank you so much for this. It worked just fine!

      Kind Regards
      Nonsi Nkomo

      Comment

      Working...
      X