2
$\begingroup$

I'm running two different IV models in Stata that share the same DV and controls but have different instruments for the independent variable of interest.

ivregress 2sls energy householdsize sqmeters nondetached (investment= built1978), robust

and

ivregress 2sls energy householdsize sqmeters nondetached (investment= age60), robust

What I want to know is whether the two resulting coefficients for investment are significantly different from one another.

My first thought would be to use something along the lines of sureg or suest combined with lincom, but I can't quite figure out a way to make it work. sureg and suest do not work with ivregress(as far as I'm concerned), and with lincom I can't find a way to access the coefficients and their standard errors.

Any help would be greatly appreciated - both towards a general (non-Stata) solution but of course also towards a Stata-implementation.

Since I'm not accustomed to posting on these forums, please do let me know if there are obvious ways to improve my question.

$\endgroup$
2
$\begingroup$

I think you can do this by recasting the 2SLS problem as a GMM one, though I am now somewhat uncertain about the winitial() option. Perhaps others can chime in on this point.

Toy example:

. sysuse auto, clear
(1978 Automobile Data)

. ivregress 2sls mpg gear_ratio (turn = weight), robust

Instrumental variables (2SLS) regression          Number of obs   =         74
                                                  Wald chi2(2)    =      85.55
                                                  Prob > chi2     =     0.0000
                                                  R-squared       =     0.4483
                                                  Root MSE        =      4.268

------------------------------------------------------------------------------
             |               Robust
         mpg |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        turn |  -1.297417   .2285046    -5.68   0.000    -1.745278   -.8495566
  gear_ratio |  -.6471477   2.053764    -0.32   0.753    -4.672451    3.378156
       _cons |    74.6892   14.55076     5.13   0.000     46.17024    103.2082
------------------------------------------------------------------------------
Instrumented:  turn
Instruments:   gear_ratio weight

. ivregress 2sls mpg gear_ratio (turn = length), robust

Instrumental variables (2SLS) regression          Number of obs   =         74
                                                  Wald chi2(2)    =      93.27
                                                  Prob > chi2     =     0.0000
                                                  R-squared       =     0.4720
                                                  Root MSE        =     4.1754

------------------------------------------------------------------------------
             |               Robust
         mpg |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        turn |  -1.226092   .1904174    -6.44   0.000    -1.599303   -.8528803
  gear_ratio |  -.1820588   1.819862    -0.10   0.920    -3.748923    3.384806
       _cons |   70.45905   12.29022     5.73   0.000     46.37067    94.54744
------------------------------------------------------------------------------
Instrumented:  turn
Instruments:   gear_ratio length

. 
. gmm ///
> (eq1: mpg - {xb: turn gear_ratio _cons}) ///
> (eq2: mpg - {xc: turn gear_ratio _cons}), ///
> instruments(eq1: gear_ratio weight) ///
> instruments(eq2: gear_ratio length) ///
> onestep winitial(unadjusted, indep)

Step 1
Iteration 0:   GMM criterion Q(b) =  949.82073  
Iteration 1:   GMM criterion Q(b) =  5.552e-21  
Iteration 2:   GMM criterion Q(b) =  5.159e-28  

note: model is exactly identified

GMM estimation 

Number of parameters =   6
Number of moments    =   6
Initial weight matrix: Unadjusted                 Number of obs   =         74

------------------------------------------------------------------------------
             |               Robust
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
xb           |
        turn |  -1.297417   .2285025    -5.68   0.000    -1.745274   -.8495606
  gear_ratio |  -.6471477   2.053753    -0.32   0.753    -4.672429    3.378134
       _cons |    74.6892   14.55064     5.13   0.000     46.17047    103.2079
-------------+----------------------------------------------------------------
xc           |
        turn |  -1.226092   .1904174    -6.44   0.000    -1.599303   -.8528802
  gear_ratio |  -.1820588   1.819862    -0.10   0.920    -3.748923    3.384806
       _cons |   70.45905   12.29022     5.73   0.000     46.37066    94.54745
------------------------------------------------------------------------------
Instruments for equation eq1: gear_ratio weight _cons
Instruments for equation eq2: gear_ratio length _cons

.         
. test _b[xb:turn] = _b[xc:turn]  

 ( 1)  [xb]turn - [xc]turn = 0

           chi2(  1) =    0.48
         Prob > chi2 =    0.4904

Stata Code:

cls 
sysuse auto, clear
ivregress 2sls mpg gear_ratio (turn = weight), robust
ivregress 2sls mpg gear_ratio (turn = length), robust

gmm ///
(eq1: mpg - {xb: turn gear_ratio _cons}) ///
(eq2: mpg - {xc: turn gear_ratio _cons}), ///
instruments(eq1: gear_ratio weight) ///
instruments(eq2: gear_ratio length) ///
onestep winitial(unadjusted, indep)

test _b[xb:turn] = _b[xc:turn]  
$\endgroup$
  • $\begingroup$ @user211090 Did this help? $\endgroup$ – Dimitriy V. Masterov Jun 14 '18 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.