Announcement

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

  • Combining headings() and rename() with -coefplot-

    Hi everyone,

    Suppose you want to make a plot of regression coefficients where interactions are both grouped and renamed. Following the example from the -coefplot- paper (Jann, 2014) the following code allows you to group the interactions:
    * BEGIN *
    sysuse auto, clear

    keep if rep78>=3
    //run regression
    quietly regress mpg headroom i.rep78#i.foreign
    eststo model
    //plot results
    coefplot model, ///
    xline(0) omitted baselevels ///
    headings( 3.rep78#0.foreign = "{bf:Interaction Effects}") ///
    drop(_cons)
    * END *

    and the following allows you to rename an interaction (just one for the sake of brevity):

    * BEGIN *

    coefplot model, ///
    xline(0) omitted baselevels ///
    rename( 3.rep78#0.foreign = "new name") ///
    drop(_cons)
    * END *

    but combining the two methods

    * BEGIN *
    coefplot model, ///
    xline(0) omitted baselevels ///
    rename( 3.rep78#0.foreign = "new name") ///
    headings( 3.rep78#0.foreign = "{bf:Interaction Effects}") ///

    drop(_cons)
    * END *

    does not produce the desired result.

    For my data I make use of the groups() option as well, so I would like to find a solution where I can combine headings() and rename(). Any pointers are greatly appreciated.

    Thanks,

    Lawrence




  • #2
    Cross-posted (and also answered) at

    http://stackoverflow.com/questions/2...coefplot-stata

    Please see FAQ Advice for our policy on cross-posting, which is that you should tell us about it.

    Comment

    Working...
    X