Announcement

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

  • Variable order for interaction term in output table using esttab

    Hello:

    I am trying to force two variables to show up at the very end of my regression table. My issue is that even after I set the order in estab, the interaction coefficients end up at the very bottom of the table. Is there a way to force variables to appear even below the interaction term?

    I am using Stata 15.1

    Here is my code:
    poisson summons_dummy c.moderate_inflation_m_y##i.abe2 c.moderate_deflation_m_y##i.abe2 gdp_lag1 unemprate effective_exch_rate trade call_rate_fred vote_infavor_cont hoc_election_35 hor_election_35 ldp_upper_d ldp_lower_d diet_insession weekend_dummy

    est store p6

    esttab p6, order(moderate_deflation_m_y moderate_inflation_m_y gdp_lag1 unemprate effective_exch_rate trade call_rate_fred vote_infavor_cont hoc_election_35 hor_election_35 ldp_upper_d ldp_lower_d diet_insession weekend_dummy), using "/Data/Stata/Tables/poisson_table_1", nobaselevels starlevels( † 0.10 * 0.05 ** 0.010 *** 0.001) se aic bic nonumber mtitle("Model 1") label varwidth(60) replace

    I would like "diet_insession" and "weekend_dummy" to show up at the bottom of the regression table.

    Any help would be appreciated!

    Thanks,
    Gene

  • #2
    esttab is from SSC, as you are asked to explain. Because you don't specify the interaction coefficients, they are placed last in order by default.

    order(orderlist) changes the order of the coefficients and equations within the table. orderlist is specified analogous to droplist in drop() (see above). Coefficients and equations that do not appear in orderlist are placed last (in their original order).
    You don't need to specify all the interactions in full, wildcard syntax works here (see the following example).

    Code:
    sysuse auto, clear
    regress price weight c.mpg##i.rep78 length
    *PLACE COEFFICIENT ON WEIGHT LAST (INTERACTIONS HIGHLIGHTED)
    esttab, order(mpg length *.rep78 *.rep78#c.mpg) drop(_cons)

    Comment


    • #3
      Thank you so much, Andrew. This is very helpful.

      Comment

      Working...
      X