Two-stage residual inclusion estimators

Read in binary outcome data; y outcome, x exposure, w covariate, z* instrumental variables (genotypes).

use ivbinoutdata, clear

Fit the model with a single instrumental variable.

ivtsri y (x = z1)
Final GMM criterion Q(b) =  1.38e-32

note: model is exactly identified.

GMM estimation 

Number of parameters =   5
Number of moments    =   5
Initial weight matrix: Unadjusted                 Number of obs   =      2,500

------------------------------------------------------------------------------
             |               Robust
             | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
    /s1xb_z1 |   .9318626   .0711029    13.11   0.000     .7925034    1.071222
         /a0 |   1.456817   .0466934    31.20   0.000       1.3653    1.548335
         /b1 |   .1433391   .0139152    10.30   0.000     .1160658    .1706123
         /b2 |   .0237303   .0146168     1.62   0.104    -.0049182    .0523787
         /b0 |   .2817003   .0268135    10.51   0.000     .2291468    .3342537
------------------------------------------------------------------------------
Instruments for equation 1: z1 _cons
Instruments for equation 2: x residuals _cons

Causal risk difference for: b1

 ( 1)  [b1]_cons = 0

------------------------------------------------------------------------------
             | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1433391   .0139152    10.30   0.000     .1160658    .1706123
------------------------------------------------------------------------------

Causal risk difference for: b2

 ( 1)  [b2]_cons = 0

------------------------------------------------------------------------------
             | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0237303   .0146168     1.62   0.104    -.0049182    .0523787
------------------------------------------------------------------------------

Fit the model with multiple instruments.

ivtsri y (x = z1 z2 z3)
Final GMM criterion Q(b) =  7.38e-33

note: model is exactly identified.

GMM estimation 

Number of parameters =   7
Number of moments    =   7
Initial weight matrix: Unadjusted                 Number of obs   =      2,500

------------------------------------------------------------------------------
             |               Robust
             | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
    /s1xb_z1 |   .9945859   .0614877    16.18   0.000     .8740722      1.1151
    /s1xb_z2 |   .9540576   .0525572    18.15   0.000     .8510474    1.057068
    /s1xb_z3 |   .9554229   .0495052    19.30   0.000     .8583944    1.052451
         /a0 |   .0842244   .0675928     1.25   0.213    -.0482551    .2167039
         /b1 |   .1307856   .0067841    19.28   0.000     .1174891    .1440822
         /b2 |    .047557   .0084484     5.63   0.000     .0309984    .0641155
         /b0 |   .3046021   .0148061    20.57   0.000     .2755826    .3336216
------------------------------------------------------------------------------
Instruments for equation 1: z1 z2 z3 _cons
Instruments for equation 2: x residuals _cons

Causal risk difference for: b1

 ( 1)  [b1]_cons = 0

------------------------------------------------------------------------------
             | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1307856   .0067841    19.28   0.000     .1174891    .1440822
------------------------------------------------------------------------------

Causal risk difference for: b2

 ( 1)  [b2]_cons = 0

------------------------------------------------------------------------------
             | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .047557   .0084484     5.63   0.000     .0309984    .0641155
------------------------------------------------------------------------------

Fit the model with multiple instruments, and adjusting for w.

ivtsri y w (x = z1 z2 z3)
Final GMM criterion Q(b) =  1.31e-32

note: model is exactly identified.

GMM estimation 

Number of parameters =   9
Number of moments    =   9
Initial weight matrix: Unadjusted                 Number of obs   =      2,500

------------------------------------------------------------------------------
             |               Robust
             | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
    /s1xb_z1 |   .9882395   .0505573    19.55   0.000     .8891491     1.08733
    /s1xb_z2 |   .9152859   .0431149    21.23   0.000     .8307823    .9997895
    /s1xb_z3 |    .954388   .0404106    23.62   0.000     .8751847    1.033591
     /s1xb_w |   .9801363    .027334    35.86   0.000     .9265627     1.03371
         /a0 |   .0734396   .0541988     1.36   0.175    -.0327882    .1796673
         /b1 |    .129698    .006901    18.79   0.000     .1161722    .1432237
         /b2 |   .0404658    .008937     4.53   0.000     .0229495    .0579821
 /s2exogxb_w |   .0638726   .0103505     6.17   0.000     .0435859    .0841593
         /b0 |   .3041477   .0145428    20.91   0.000     .2756443    .3326511
------------------------------------------------------------------------------
Instruments for equation 1: z1 z2 z3 w _cons
Instruments for equation 2: x residuals w _cons

Causal risk difference for: b1

 ( 1)  [b1]_cons = 0

------------------------------------------------------------------------------
             | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .129698    .006901    18.79   0.000     .1161722    .1432237
------------------------------------------------------------------------------

Causal risk difference for: b2

 ( 1)  [b2]_cons = 0

------------------------------------------------------------------------------
             | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0404658    .008937     4.53   0.000     .0229495    .0579821
------------------------------------------------------------------------------

Using the log additive link function.

ivtsri y (x = z1 z2 z3), link(logadd)
Final GMM criterion Q(b) =  6.65e-33

note: model is exactly identified.

GMM estimation 

Number of parameters =   7
Number of moments    =   7
Initial weight matrix: Unadjusted                 Number of obs   =      2,500

------------------------------------------------------------------------------
             |               Robust
             | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
    /s1xb_z1 |   .9945859   .0614877    16.18   0.000     .8740722      1.1151
    /s1xb_z2 |   .9540576   .0525572    18.15   0.000     .8510474    1.057068
    /s1xb_z3 |   .9554229   .0495052    19.30   0.000     .8583944    1.052451
         /a0 |   .0842244   .0675928     1.25   0.213    -.0482551    .2167039
         /b1 |   .2246119   .0145109    15.48   0.000     .1961711    .2530527
         /b2 |   .0995872    .016851     5.91   0.000     .0665599    .1326146
         /b0 |  -1.203224   .0392053   -30.69   0.000    -1.280065   -1.126383
------------------------------------------------------------------------------
Instruments for equation 1: z1 z2 z3 _cons
Instruments for equation 2: x residuals _cons

Causal risk ratio for: b1

 ( 1)  [b1]_cons = 0

------------------------------------------------------------------------------
             |     exp(b)   Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.251837   .0181653    15.48   0.000     1.216735    1.287951
------------------------------------------------------------------------------

Causal risk ratio for: b2

 ( 1)  [b2]_cons = 0

------------------------------------------------------------------------------
             |     exp(b)   Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.104715   .0186155     5.91   0.000     1.068825     1.14181
------------------------------------------------------------------------------

Using the log multiplicative link function.

ivtsri y (x = z1 z2 z3), link(logmult)
Final GMM criterion Q(b) =  6.21e-32

note: model is exactly identified.

GMM estimation 

Number of parameters =   7
Number of moments    =   7
Initial weight matrix: Unadjusted                 Number of obs   =      2,500

------------------------------------------------------------------------------
             |               Robust
             | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
    /s1xb_z1 |   .9945859   .0614877    16.18   0.000     .8740722      1.1151
    /s1xb_z2 |   .9540576   .0525572    18.15   0.000     .8510474    1.057068
    /s1xb_z3 |   .9554229   .0495052    19.30   0.000     .8583944    1.052451
         /a0 |   .0842244   .0675928     1.25   0.213    -.0482551    .2167039
         /b1 |   .5193282   .0388913    13.35   0.000     .4431026    .5955538
         /b2 |   .1793399   .0361099     4.97   0.000     .1085658    .2501141
         /b0 |  -1.936359   .0941036   -20.58   0.000    -2.120799    -1.75192
------------------------------------------------------------------------------
Instruments for equation 1: z1 z2 z3 _cons
Instruments for equation 2: x residuals _cons

Causal risk ratio for: b1

 ( 1)  [b1]_cons = 0

------------------------------------------------------------------------------
             |     exp(b)   Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.680898   .0653723    13.35   0.000     1.557532    1.814035
------------------------------------------------------------------------------

Causal risk ratio for: b2

 ( 1)  [b2]_cons = 0

------------------------------------------------------------------------------
             |     exp(b)   Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.196427   .0432029     4.97   0.000     1.114678    1.284172
------------------------------------------------------------------------------

Using the logit link function.

ivtsri y (x = z1 z2 z3), link(logit)
Final GMM criterion Q(b) =  6.75e-33

note: model is exactly identified.

GMM estimation 

Number of parameters =   7
Number of moments    =   7
Initial weight matrix: Unadjusted                 Number of obs   =      2,500

------------------------------------------------------------------------------
             |               Robust
             | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
    /s1xb_z1 |   .9945859   .0614877    16.18   0.000     .8740722      1.1151
    /s1xb_z2 |   .9540576   .0525572    18.15   0.000     .8510474    1.057068
    /s1xb_z3 |   .9554229   .0495052    19.30   0.000     .8583944    1.052451
         /a0 |   .0842244   .0675928     1.25   0.213    -.0482551    .2167039
         /b1 |   1.108148   .0667702    16.60   0.000     .9772804    1.239015
         /b2 |   .3825741   .0664177     5.76   0.000     .2523978    .5127505
         /b0 |  -1.654878   .1262212   -13.11   0.000    -1.902267   -1.407489
------------------------------------------------------------------------------
Instruments for equation 1: z1 z2 z3 _cons
Instruments for equation 2: x residuals _cons

Causal odds ratio for: b1

 ( 1)  [b1]_cons = 0

------------------------------------------------------------------------------
             |     exp(b)   Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   3.028743   .2022298    16.60   0.000      2.65722    3.452211
------------------------------------------------------------------------------

Causal odds ratio for: b2

 ( 1)  [b2]_cons = 0

------------------------------------------------------------------------------
             |     exp(b)   Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.466054   .0973719     5.76   0.000     1.287108    1.669878
------------------------------------------------------------------------------

Bootstrap standard errors.

bootstrap, reps(250): ivtsri y (x = z1 z2 z3), estonly
(running ivtsri on estimation sample)

Bootstrap replications (250): .........10.........20.........30.........40.........50.........60.........70.........80.........90.........100.........110..
> .......120.........130.........140.........150.........160.........170.........180.........190.........200.........210.........220.........230.........24
> 0.........250 done

------------------------------------------------------------------------------
             |   Observed   Bootstrap                         Normal-based
           y | coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
           x |   .1307856   .0064668    20.22   0.000     .1181109    .1434604
   residuals |    .047557   .0084015     5.66   0.000     .0310903    .0640236
       _cons |   .3046021   .0147641    20.63   0.000      .275665    .3335392
------------------------------------------------------------------------------