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
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
Comment