0

I have models that have different dependent variables (DVs), but using the same instrumental variable (IV), with two different types of identification strategies. In short I have:

Group1 
model 1
model 2
model 3
model 4

Group2
model 1-2
model 2-2
model 3-2
model 4-2

I want to plot the coefficients where I can compare coefficient estimate of the IV of model 1 and model 1-2; model 2 and model 2-2 ... at once. I would like the eight coefficients to be plotted in one graph, since the IV of interest is the same for all models.

Is there a stylized way to do this?

For now, I only know how to plot coefs of model 1 and model 1-2 in one graph, but not all other ones. I want the coefficients to be plotted horizontally, according to model number (1, 2, 3, 4) and compare coefficients of model 1 and model 1-2; model 2 and model 2-2, for each model number on `x-axis'.

enter image description here

halo09876
  • 2,725
  • 12
  • 51
  • 71

1 Answers1

1

The community-contributed command coefplot is not meant to be used like that.

Nevertheless, below is a toy example of how you could get what you want:

sysuse auto, clear
estimates clear 

// code for identification strategy 1

regress price mpg trunk length turn if foreign == 0
estimates store A

regress price trunk turn if foreign == 0
estimates store B

regress price weight trunk turn if foreign == 0
estimates store C

regress price trunk if foreign == 0
estimates store D

// code for identification strategy 2

regress price mpg trunk length turn if foreign == 1
estimates store E

regress price trunk turn if foreign == 1
estimates store F

regress price weight trunk turn if foreign == 1
estimates store G

regress price trunk if foreign == 1
estimates store H

Then you draw the plot as follows:

local gap1 : display _dup(30) " "
local gap2 : display _dup(400) " "

local label1 |`gap1'|`gap1'|`gap1'|`gap2'

local gap3 : display _dup(25) " "
local gap4 : display _dup(400) " "

local label2 DV1`gap3'DV2`gap3'DV3`gap3'DV4`gap4'

coefplot (A, offset(-0.38)) (E, offset(-0.33))  ///
         (B, offset(-0.15)) (F, offset(-0.1))  ///
         (C, offset(0.09)) (G, offset(0.135))  ///
         (D, offset(0.3)) (H, offset(0.35)), ///
         vertical  keep(trunk) coeflabels(trunk = `""`label1'""`label2'""') ///
         xlabel(, notick labgap(0)) legend(off)

The code here uses Stata's toy auto dataset to run a number of simple regressions for each foreign category. The same dependent variable price is used for illustration but you can use different variables in its place. The variable trunk is assumed here to be the variable of interest.

What the above toy code snippet basically does is to save each set of regression estimates and then simulate pairs of models. The labels DV are drawn based on a hack that i demonstrated recently in the following two questions:

The result is a very good approximation but will require experimentation from your part:

enter image description here