Hi Statalisters,
I'm attempting to display some regression results via the coefplot command. My analyses are stratified by several categorical variables. I wish to display all of these different stratified plots in the same graph. I have provided an simplified example below using auto data:
sysuse auto
eststo: reg mpg trunk length turn if foreign==0
eststo: reg mpg trunk length turn if foreign==1
eststo: reg mpg trunk length turn if rep78==3
eststo: reg mpg trunk length turn if rep78==4
eststo: reg mpg trunk length turn if rep78==5
coefplot est1 est2 || est3 est4 est5, drop(_cons) ///
legend(label(2 "Domestic")label(4 "Foreign")label(6 "rep78=3")label(8 "rep78=4")label(10 "rep78=5") ///
colfirst hole(3)colgap(30)) norecycle
First, I am wondering if there is a way to create two different legends, one for each plot in the graph.
Second, I am attempting to depict whether coefs. from different stratified levels are significantly different.
E.g.:
test [est4_mean]length=[est5_mean]length
The only way I can think of portraying significant differences is by manually drawing the demarcations in graph editor as I have done for est4 length and est5 length in the attached graph.
Any advice would be appreciated.
-Nick Otis
I'm attempting to display some regression results via the coefplot command. My analyses are stratified by several categorical variables. I wish to display all of these different stratified plots in the same graph. I have provided an simplified example below using auto data:
sysuse auto
eststo: reg mpg trunk length turn if foreign==0
eststo: reg mpg trunk length turn if foreign==1
eststo: reg mpg trunk length turn if rep78==3
eststo: reg mpg trunk length turn if rep78==4
eststo: reg mpg trunk length turn if rep78==5
coefplot est1 est2 || est3 est4 est5, drop(_cons) ///
legend(label(2 "Domestic")label(4 "Foreign")label(6 "rep78=3")label(8 "rep78=4")label(10 "rep78=5") ///
colfirst hole(3)colgap(30)) norecycle
First, I am wondering if there is a way to create two different legends, one for each plot in the graph.
Second, I am attempting to depict whether coefs. from different stratified levels are significantly different.
E.g.:
test [est4_mean]length=[est5_mean]length
The only way I can think of portraying significant differences is by manually drawing the demarcations in graph editor as I have done for est4 length and est5 length in the attached graph.
Any advice would be appreciated.
-Nick Otis
Comment