use ivbinoutdata, clear
Two-stage predictor substitution estimators
Read in binary outcome data; y
outcome, x
exposure, w
covariate, z*
instrumental variables (genotypes).
Fit the model with a single instrumental variable.
y (x = z1) ivtsps
Final GMM criterion Q(b) = 1.76e-32
note: model is exactly identified.
GMM estimation
Number of parameters = 4
Number of moments = 4
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
/b0 | .2817003 .0268135 10.51 0.000 .2291468 .3342537
------------------------------------------------------------------------------
Instruments for equation 1: z1 _cons
Instruments for equation 2: predicted _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
------------------------------------------------------------------------------
Fit the model with multiple instruments.
y (x = z1 z2 z3) ivtsps
Final GMM criterion Q(b) = 6.65e-33
note: model is exactly identified.
GMM estimation
Number of parameters = 6
Number of moments = 6
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
/b0 | .3046021 .0148061 20.57 0.000 .2755826 .3336216
------------------------------------------------------------------------------
Instruments for equation 1: z1 z2 z3 _cons
Instruments for equation 2: predicted _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
------------------------------------------------------------------------------
Fit the model with multiple instruments, and adjusting for w
.
y w (x = z1 z2 z3) ivtsps
Final GMM criterion Q(b) = 1.27e-32
note: model is exactly identified.
GMM estimation
Number of parameters = 8
Number of moments = 8
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
/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: predicted 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
------------------------------------------------------------------------------
Using the log additive link function.
y (x = z1 z2 z3), link(logadd) ivtsps
Final GMM criterion Q(b) = 8.95e-33
note: model is exactly identified.
GMM estimation
Number of parameters = 6
Number of moments = 6
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 | .2309625 .0125342 18.43 0.000 .206396 .255529
/b0 | -1.061422 .0336872 -31.51 0.000 -1.127447 -.995396
------------------------------------------------------------------------------
Instruments for equation 1: z1 z2 z3 _cons
Instruments for equation 2: predicted _cons
Causal risk ratio for: b1
( 1) [b1]_cons = 0
------------------------------------------------------------------------------
| exp(b) Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | 1.259812 .0157907 18.43 0.000 1.22924 1.291145
------------------------------------------------------------------------------
Using the log multiplicative link function.
y (x = z1 z2 z3), link(logmult) ivtsps
Final GMM criterion Q(b) = 1.10e-32
note: model is exactly identified.
GMM estimation
Number of parameters = 6
Number of moments = 6
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 | .2410471 .0158072 15.25 0.000 .2100656 .2720286
/b0 | -1.081193 .0390212 -27.71 0.000 -1.157673 -1.004713
------------------------------------------------------------------------------
Instruments for equation 1: z1 z2 z3 _cons
Instruments for equation 2: predicted _cons
Causal risk ratio for: b1
( 1) [b1]_cons = 0
------------------------------------------------------------------------------
| exp(b) Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | 1.272581 .0201159 15.25 0.000 1.233759 1.312625
------------------------------------------------------------------------------
Using the logit link function.
y (x = z1 z2 z3), link(logit) ivtsps
Final GMM criterion Q(b) = 6.69e-33
note: model is exactly identified.
GMM estimation
Number of parameters = 6
Number of moments = 6
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 | .5731411 .0351357 16.31 0.000 .5042763 .6420059
/b0 | -.8527558 .0687178 -12.41 0.000 -.9874403 -.7180713
------------------------------------------------------------------------------
Instruments for equation 1: z1 z2 z3 _cons
Instruments for equation 2: predicted _cons
Causal odds ratio for: b1
( 1) [b1]_cons = 0
------------------------------------------------------------------------------
| exp(b) Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | 1.77383 .0623248 16.31 0.000 1.655787 1.900289
------------------------------------------------------------------------------
Bootstrap standard errors.
bootstrap, reps(250): ivtsps y (x = z1 z2 z3), estonly
(running ivtsps 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]
-------------+----------------------------------------------------------------
predicted | .1307856 .0064668 20.22 0.000 .1181109 .1434604
_cons | .3046021 .0147641 20.63 0.000 .275665 .3335392
------------------------------------------------------------------------------