This is a public repository for the package ivcombine for Stata, which implements the estimation procedure for combining multiple instrumental variables described in the paper A Vector Monotonicity Assumption for Multiple Instruments.
This is a preliminary version of the code and is offered without warranty. I appreciate any feedback or issues noted as I continue to develop it. A Stata help file is forthcoming; for now, please see below as a guide to usage.
The file ivcombine.ado is the main code file. The package can be installed directly from within Stata by running
net from https://raw.githubusercontent.com/leonardgoff/ivcombine/master
net describe ivcombine
net install ivcombine
Alternatively, you can install the package by downloading ivcombine.ado to your ado directory for Stata, e.g. C:\ado\personal.
The function delivers a point estimate and standard error for a conditional average treatment effect parameter of the form ivcombine estimates the "all-compliers LATE" (ACLATE), which is the largest group of such compliers. Other choices are described in the paper and can be implemented as below.
Here's some test code to get you going, once ivcombine is installed. This uses a simulated dataset sampledata.dta, which can also be downloaded from this repository.
use "sampledata.dta", clear
*To estimate e.g. the all compliers late on the treated:
ivcombine Y D Z1 Z2, vary(1 2) treated
*To estimate e.g. the ``Set LATE'' for instrument 1:
ivcombine Y D Z1 Z2, vary(1)
The basic syntax of the command is as follows:
ivcombine outcomevar treatmentvar instrument1 instrument2 ..., [vary(numlist) treated untreated covs(varlist) vce(string)]
where:
outcomevaris an outcome variable (Y, in the notation of the paper)treatmentvaris a binary endogenous treatment variable (D, in the notation of the paper)instrument1is a binary instrumental variable fortreatmentvar(denoted Z1 in the paper),instrument2is another binary instrumental variable fortreatmentvar(denoted Z2 in the paper), etc., where all of the instruments are assumed to be jointly valid and satisfy vector monotonicity
Optional arguments to ``ivcombine'' include:
-
varyhelps specify the parameter of interest to estimate, by giving a list of instrument indices that are to be varied. If one has three instruments and wants the ACLATE, for example, one would specifyvary(1 2 3). If not set by the user,varywill default to the set of all instruments. -
treatedhelps specify the parameter of interest to estimate, by allowing the user to condition on units that receive treatment. For example, iftreatedis set along withvary(1), theivcombinefunction will return the parameter$SLATT_{\{1\}}$ , the set LATE among the treated for instrument one. -
untreatedhelps specify the parameter of interest to estimate, by allowing the user to condition on units that do not receive treatment. For example, iftreatedis set along withvary(1), theivcombinefunction will return the parameter$SLATU_{\{1\}}$ , the set LATE among the untreated for instrument one. -
covsallows a set of control variables (denoted as$X$ in the paper).ivcombinesimply uses these controls as additional regressors when estimating linear projections. This allows the user to recover the desired parameter of interest, assuming the instruments are valid conditional on$X$ , under the approximation that the conditional expectation functions$E[Y_i|Z_{i},X_i]$ and$E[D_i|Z_{i},X_i]$ are both additively separable between the vector of instruments$Z_i$ and$X_i$ , and linear in the components of$X_i$ . -
vceallows the user to specify a desired variance estimator. Options includerobustandcluster.ivcombinedefaults to heteroskedasticity-robust standard errors, while specifyingcluster(clustervar)would allow cluster-robust standard errors byclustervar.
In addition to outputting the numerical results to the screen, The ivcombine function sets the following scalars for use in your code:
-
param_ptestreturns the point estimate of the parameter of interest$\Delta_c$ -
param_sereturns a standard error for the above estimate of the parameter of interest$\Delta_c$ -
fstage_ptestreturns a point estimate of$P(c(G_i,Z_i)=1)$ for the parameter of interest (intuitively, this is the size of the group for whom average treatment effects are being estimated, and serves as the ``denominator'' in$\Delta_c$ ) -
fstage_sereturns a standard error for the above estimate of$P(c(G_i,Z_i)=1)$ -
ivcombinealso storesparam_ptestand the square ofparam_seas the Stata matricese(b)ande(V)(each is a$1 \times 1$ matrix). This can be useful when reporting results using e.g. theesttabcommand