IV estimation.pdf

59
Instrumental Variables Estimation in Stata Christopher F Baum 1 Faculty Micro Resource Center Boston College March 2007 1 Thanks to Austin Nichols for the use of his material on weak instruments and Mark Schaffer for helpful comments. The standard disclaimer applies. Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 1 / 31

Transcript of IV estimation.pdf

  • Instrumental Variables Estimation in Stata

    Christopher F Baum1

    Faculty Micro Resource CenterBoston College

    March 2007

    1Thanks to Austin Nichols for the use of his material on weak instruments and Mark Schaffer for helpful comments.

    The standard disclaimer applies.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 1 / 31

  • Instrumental Variables Estimation in Stata Introduction

    Instrumental variables methods are widely used in economics andfinance to deal with problems of endogeneity and measurement error.We discuss the ivreg2 suite of programs extending official Statascapabilities authored by Baum, Schaffer and Stillman. Further detailsare available in Baum, An Introduction to Modern Econometrics UsingStata (Stata Press, 2006) and Baum et al. (Stata Journal, 2007).

    Instrumental variables methods can provide a workable solution tomany problems in economic research, but also bring additionalchallenges of bias and precision. We consider how GeneralizedMethod of Moments (GMM) estimators can improve upon thetraditional two-stage least squares approach, and how the reliability ofIV methods can be assessed, particularly in the potential presence ofweak instruments.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 2 / 31

  • Instrumental Variables Estimation in Stata Introduction

    Instrumental variables methods are widely used in economics andfinance to deal with problems of endogeneity and measurement error.We discuss the ivreg2 suite of programs extending official Statascapabilities authored by Baum, Schaffer and Stillman. Further detailsare available in Baum, An Introduction to Modern Econometrics UsingStata (Stata Press, 2006) and Baum et al. (Stata Journal, 2007).

    Instrumental variables methods can provide a workable solution tomany problems in economic research, but also bring additionalchallenges of bias and precision. We consider how GeneralizedMethod of Moments (GMM) estimators can improve upon thetraditional two-stage least squares approach, and how the reliability ofIV methods can be assessed, particularly in the potential presence ofweak instruments.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 2 / 31

  • Instrumental Variables Estimation in Stata Introduction

    Why not always use IV?

    It may be difficult to find variables that can serve as valid instruments.Most variables that have an effect on included endogenous variablesalso have a direct effect on the dependent variable.

    The precision of IV estimates is likely to be lower than that of OLSestimates. In the presence of weak instruments (excluded instrumentsonly weakly correlated with included endogenous regressors) the lossof precision will be severe. This suggests we need a method todetermine whether a particular regressor must be treated asendogenous.

    IV estimators are biased, and their finite-sample properties are oftenproblematic. Thus, most of the justification for the use of IV isasymptotic. Performance in small samples may be poor.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 3 / 31

  • Instrumental Variables Estimation in Stata Introduction

    Why not always use IV?

    It may be difficult to find variables that can serve as valid instruments.Most variables that have an effect on included endogenous variablesalso have a direct effect on the dependent variable.

    The precision of IV estimates is likely to be lower than that of OLSestimates. In the presence of weak instruments (excluded instrumentsonly weakly correlated with included endogenous regressors) the lossof precision will be severe. This suggests we need a method todetermine whether a particular regressor must be treated asendogenous.

    IV estimators are biased, and their finite-sample properties are oftenproblematic. Thus, most of the justification for the use of IV isasymptotic. Performance in small samples may be poor.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 3 / 31

  • Instrumental Variables Estimation in Stata Introduction

    Why not always use IV?

    It may be difficult to find variables that can serve as valid instruments.Most variables that have an effect on included endogenous variablesalso have a direct effect on the dependent variable.

    The precision of IV estimates is likely to be lower than that of OLSestimates. In the presence of weak instruments (excluded instrumentsonly weakly correlated with included endogenous regressors) the lossof precision will be severe. This suggests we need a method todetermine whether a particular regressor must be treated asendogenous.

    IV estimators are biased, and their finite-sample properties are oftenproblematic. Thus, most of the justification for the use of IV isasymptotic. Performance in small samples may be poor.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 3 / 31

  • Instrumental Variables Estimation in Stata Introduction

    Why not always use IV?

    Instruments may be weak: satisfactorily exogenous, but only weaklycorrelated with the endogenous regressors. As Bound, Jaeger, Baker(NBER TWP 1993, JASA 1995) argue the cure can be worse than thedisease.

    Staiger and Stock (Econometrica, 1997) formalized the definition ofweak instruments. Unfortunately many researchers conclude fromtheir work that if the first-stage F statistic exceeds 10, their instrumentsare sufficiently strong.

    Stock and Yogo (Camb.U.Press festschrift, 2005) further explore theissue and provide useful rules of thumb for evaluating the weakness ofinstruments. ivreg2 now contains StockYogo tabulations based onthe CraggDonald statistic.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 4 / 31

  • Instrumental Variables Estimation in Stata Introduction

    Why not always use IV?

    Instruments may be weak: satisfactorily exogenous, but only weaklycorrelated with the endogenous regressors. As Bound, Jaeger, Baker(NBER TWP 1993, JASA 1995) argue the cure can be worse than thedisease.

    Staiger and Stock (Econometrica, 1997) formalized the definition ofweak instruments. Unfortunately many researchers conclude fromtheir work that if the first-stage F statistic exceeds 10, their instrumentsare sufficiently strong.

    Stock and Yogo (Camb.U.Press festschrift, 2005) further explore theissue and provide useful rules of thumb for evaluating the weakness ofinstruments. ivreg2 now contains StockYogo tabulations based onthe CraggDonald statistic.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 4 / 31

  • Instrumental Variables Estimation in Stata Introduction

    Why not always use IV?

    Instruments may be weak: satisfactorily exogenous, but only weaklycorrelated with the endogenous regressors. As Bound, Jaeger, Baker(NBER TWP 1993, JASA 1995) argue the cure can be worse than thedisease.

    Staiger and Stock (Econometrica, 1997) formalized the definition ofweak instruments. Unfortunately many researchers conclude fromtheir work that if the first-stage F statistic exceeds 10, their instrumentsare sufficiently strong.

    Stock and Yogo (Camb.U.Press festschrift, 2005) further explore theissue and provide useful rules of thumb for evaluating the weakness ofinstruments. ivreg2 now contains StockYogo tabulations based onthe CraggDonald statistic.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 4 / 31

  • Instrumental Variables Estimation in Stata Introduction

    IV estimation as a GMM problem

    Before discussing further the motivation for various weak instrumentdiagnostics, we define the setting for IV estimation as a GeneralizedMethod of Moments (GMM) optimization problem.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 5 / 31

  • Instrumental Variables Estimation in Stata The IV-GMM estimator

    We consider the model

    y = X + u, u (0,)

    with X (N k) and define a matrix Z (N `) where ` k . This is theGeneralized Method of Moments IV (IV-GMM) estimator. The `instruments give rise to a set of ` moments:

    gi() = Z i ui = Zi (yi xi), i = 1,N

    where each gi is an `-vector. The method of moments approachconsiders each of the ` moment equations as a sample moment, whichwe may estimate by averaging over N:

    g() =1N

    Ni=1

    zi(yi xi) = 1NZu

    The GMM approach chooses an estimate that solves g(GMM) = 0.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 6 / 31

  • Instrumental Variables Estimation in Stata Exact identification and 2SLS

    If ` = k , the equation to be estimated is said to be exactly identified bythe order condition for identification: that is, there are as manyexcluded instruments as included right-hand endogenous variables.The method of moments problem is then k equations in k unknowns,and a unique solution exists, equivalent to the standard IV estimator:

    IV = (Z X )1Z y

    In the case of overidentification (` > k ) we may define a set of kinstruments

    X = Z (Z Z )1Z X = PZX

    which gives rise to the two-stage least squares (2SLS) estimator

    2SLS = (X X )1X y = (X PZX )1X PZy

    which despite its name is computed by this single matrix equation.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 7 / 31

  • Instrumental Variables Estimation in Stata Exact identification and 2SLS

    If ` = k , the equation to be estimated is said to be exactly identified bythe order condition for identification: that is, there are as manyexcluded instruments as included right-hand endogenous variables.The method of moments problem is then k equations in k unknowns,and a unique solution exists, equivalent to the standard IV estimator:

    IV = (Z X )1Z y

    In the case of overidentification (` > k ) we may define a set of kinstruments

    X = Z (Z Z )1Z X = PZX

    which gives rise to the two-stage least squares (2SLS) estimator

    2SLS = (X X )1X y = (X PZX )1X PZy

    which despite its name is computed by this single matrix equation.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 7 / 31

  • Instrumental Variables Estimation in Stata The IV-GMM approach

    In the 2SLS method with overidentification, the ` available instrumentsare boiled down" to the k needed by defining the PZ matrix. In theIV-GMM approach, that reduction is not necessary. All ` instrumentsare used in the estimator. Furthermore, a weighting matrix is employedso that we may choose GMM so that the elements of g(GMM) are asclose to zero as possible. With ` > k , not all ` moment conditions canbe exactly satisfied, so a criterion function that weights themappropriately is used to improve the efficiency of the estimator.

    The GMM estimator minimizes the criterion

    J(GMM) = N g(GMM)W g(GMM)

    where W is a ` ` weighting matrix.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 8 / 31

  • Instrumental Variables Estimation in Stata The IV-GMM approach

    In the 2SLS method with overidentification, the ` available instrumentsare boiled down" to the k needed by defining the PZ matrix. In theIV-GMM approach, that reduction is not necessary. All ` instrumentsare used in the estimator. Furthermore, a weighting matrix is employedso that we may choose GMM so that the elements of g(GMM) are asclose to zero as possible. With ` > k , not all ` moment conditions canbe exactly satisfied, so a criterion function that weights themappropriately is used to improve the efficiency of the estimator.

    The GMM estimator minimizes the criterion

    J(GMM) = N g(GMM)W g(GMM)

    where W is a ` ` weighting matrix.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 8 / 31

  • Instrumental Variables Estimation in Stata The GMM weighting matrix

    Solving the set of FOCs, we derive the IV-GMM estimator of anoveridentified equation:

    GMM = (X ZWZ X )1X ZWZ y

    which will be identical for all W matrices which differ by a factor ofproportionality. The optimal weighting matrix, as shown by Hansen(1982), chooses W = S1 where S is the covariance matrix of themoment conditions to produce the most efficient estimator:

    S = E [Z uuZ ] = limN N1[Z Z ]

    With a consistent estimator of S derived from 2SLS residuals, wedefine the feasible IV-GMM estimator as

    FEGMM = (X Z S1Z X )1X Z S1Z y

    where FEGMM refers to the feasible efficient GMM estimator.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 9 / 31

  • Instrumental Variables Estimation in Stata The GMM weighting matrix

    Solving the set of FOCs, we derive the IV-GMM estimator of anoveridentified equation:

    GMM = (X ZWZ X )1X ZWZ y

    which will be identical for all W matrices which differ by a factor ofproportionality. The optimal weighting matrix, as shown by Hansen(1982), chooses W = S1 where S is the covariance matrix of themoment conditions to produce the most efficient estimator:

    S = E [Z uuZ ] = limN N1[Z Z ]

    With a consistent estimator of S derived from 2SLS residuals, wedefine the feasible IV-GMM estimator as

    FEGMM = (X Z S1Z X )1X Z S1Z y

    where FEGMM refers to the feasible efficient GMM estimator.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 9 / 31

  • Instrumental Variables Estimation in Stata IV-GMM and the distribution of u

    The derivation makes no mention of the form of , thevariance-covariance matrix (vce) of the error process u. If the errorssatisfy all classical assumptions are i .i .d ., S = 2uIN and the optimalweighting matrix is proportional to the identity matrix. The IV-GMMestimator is merely the standard IV (or 2SLS) estimator.

    If there is heteroskedasticity of unknown form, we usually computerobust standard errors in any Stata estimation command to derive aconsistent estimate of the vce. In this context,

    S =1N

    Ni=1

    u2i Zi Zi

    where u is the vector of residuals from any consistent estimator of (e.g., the 2SLS residuals). For an overidentified equation, the IV-GMMestimates computed from this estimate of S will be more efficient than2SLS estimates.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 10 / 31

  • Instrumental Variables Estimation in Stata IV-GMM and the distribution of u

    The derivation makes no mention of the form of , thevariance-covariance matrix (vce) of the error process u. If the errorssatisfy all classical assumptions are i .i .d ., S = 2uIN and the optimalweighting matrix is proportional to the identity matrix. The IV-GMMestimator is merely the standard IV (or 2SLS) estimator.

    If there is heteroskedasticity of unknown form, we usually computerobust standard errors in any Stata estimation command to derive aconsistent estimate of the vce. In this context,

    S =1N

    Ni=1

    u2i Zi Zi

    where u is the vector of residuals from any consistent estimator of (e.g., the 2SLS residuals). For an overidentified equation, the IV-GMMestimates computed from this estimate of S will be more efficient than2SLS estimates.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 10 / 31

  • Instrumental Variables Estimation in Stata IV-GMM cluster-robust estimates

    If errors are considered to exhibit arbitrary intra-cluster correlation in adataset with M clusters (M

  • Instrumental Variables Estimation in Stata IV-GMM HAC estimates

    The IV-GMM approach may also be used to generate HAC standarderrors: those robust to arbitrary heteroskedasticity and autocorrelation.Although the best-known HAC approach is that of Newey and West(per Statas newey), that is only one choice of a HAC estimator thatmay be applied to an IV-GMM problem.

    You can also specify a vce that is robust to autocorrelation whilemaintaining the assumption of conditional homoskedasticity: that is,AC without the H.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 12 / 31

  • Instrumental Variables Estimation in Stata Implementation in Stata

    The estimators we have discussed are available from Baum, Schafferand Stillmans ivreg2 package (ssc describe ivreg2). Theivreg2 command has the same basic syntax as Statas standardivreg:

    ivreg2 depvar [varlist1] (varlist2=instlist) ///[if] [in] [, options]

    The ` variables in varlist1 and instlist comprise Z , the matrix ofinstruments. The k variables in varlist1 and varlist2 compriseX . Both matrices by default include a units vector.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 13 / 31

  • Instrumental Variables Estimation in Stata Implementation in Stata

    The estimators we have discussed are available from Baum, Schafferand Stillmans ivreg2 package (ssc describe ivreg2). Theivreg2 command has the same basic syntax as Statas standardivreg:

    ivreg2 depvar [varlist1] (varlist2=instlist) ///[if] [in] [, options]

    The ` variables in varlist1 and instlist comprise Z , the matrix ofinstruments. The k variables in varlist1 and varlist2 compriseX . Both matrices by default include a units vector.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 13 / 31

  • Instrumental Variables Estimation in Stata ivreg2 options

    By default ivreg2 estimates the IV estimator, or 2SLS estimator if` > k . If the gmm option is specified, it estimates the IV-GMM estimator.

    With the robust option, the vce is heteroskedasticity-robust.

    With the cluster(varname) option, the vce is cluster-robust.

    With the robust and bw( ) options, the vce is HAC with the defaultBartlett kernel, or NeweyWest. Other kernel( ) choices lead toalternative HAC estimators. Both robust and bw( ) must bespecified for HAC; estimates produced with bw( ) alone are robust toarbitrary autocorrelation but assume homoskedasticity. NB: this willchange in the next version of ivreg2.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 14 / 31

  • Instrumental Variables Estimation in Stata Tests of overidentifying restrictions

    If and only if an equation is overidentified, we may test whether theexcluded instruments are appropriately independent of the errorprocess. That test should always be performed when it is possible todo so, as it allows us to evaluate the validity of the instruments.

    A test of overidentifying restrictions regresses the residuals from an IVor 2SLS regression on all instruments in Z . Under the null hypothesisthat all instruments are uncorrelated with u, the test has alarge-sample 2(r) distribution where r is the number of overidentifyingrestrictions.

    Under the assumption of i .i .d . errors, this is known as a Sargan test,and is routinely produced by ivreg2 for IV and 2SLS estimates. It canalso be calculated after ivreg estimation with the overid command,which is part of the ivreg2 suite.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 15 / 31

  • Instrumental Variables Estimation in Stata Tests of overidentifying restrictions

    If and only if an equation is overidentified, we may test whether theexcluded instruments are appropriately independent of the errorprocess. That test should always be performed when it is possible todo so, as it allows us to evaluate the validity of the instruments.

    A test of overidentifying restrictions regresses the residuals from an IVor 2SLS regression on all instruments in Z . Under the null hypothesisthat all instruments are uncorrelated with u, the test has alarge-sample 2(r) distribution where r is the number of overidentifyingrestrictions.

    Under the assumption of i .i .d . errors, this is known as a Sargan test,and is routinely produced by ivreg2 for IV and 2SLS estimates. It canalso be calculated after ivreg estimation with the overid command,which is part of the ivreg2 suite.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 15 / 31

  • Instrumental Variables Estimation in Stata Tests of overidentifying restrictions

    If and only if an equation is overidentified, we may test whether theexcluded instruments are appropriately independent of the errorprocess. That test should always be performed when it is possible todo so, as it allows us to evaluate the validity of the instruments.

    A test of overidentifying restrictions regresses the residuals from an IVor 2SLS regression on all instruments in Z . Under the null hypothesisthat all instruments are uncorrelated with u, the test has alarge-sample 2(r) distribution where r is the number of overidentifyingrestrictions.

    Under the assumption of i .i .d . errors, this is known as a Sargan test,and is routinely produced by ivreg2 for IV and 2SLS estimates. It canalso be calculated after ivreg estimation with the overid command,which is part of the ivreg2 suite.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 15 / 31

  • Instrumental Variables Estimation in Stata Tests of overidentifying restrictions

    If we have used IV-GMM estimation in ivreg2, the test ofoveridentifying restrictions becomes J: the GMM criterion function.Although J will be identically zero for any exactly-identified equation, itwill be positive for an overidentified equation. If it is too large, doubt iscast on the satisfaction of the moment conditions underlying GMM.

    The test in this context is known as the Hansen test or J test, and isroutinely calculated by ivreg2 when the gmm option is employed.

    The SarganHansen test of overidentifying restrictions should beperformed routinely in any overidentified model estimated withinstrumental variables techniques. Instrumental variables techniquesare powerful, but if a strong rejection of the null hypothesis of theSarganHansen test is encountered, you should strongly doubt thevalidity of the estimates.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 16 / 31

  • Instrumental Variables Estimation in Stata Tests of overidentifying restrictions

    If we have used IV-GMM estimation in ivreg2, the test ofoveridentifying restrictions becomes J: the GMM criterion function.Although J will be identically zero for any exactly-identified equation, itwill be positive for an overidentified equation. If it is too large, doubt iscast on the satisfaction of the moment conditions underlying GMM.

    The test in this context is known as the Hansen test or J test, and isroutinely calculated by ivreg2 when the gmm option is employed.

    The SarganHansen test of overidentifying restrictions should beperformed routinely in any overidentified model estimated withinstrumental variables techniques. Instrumental variables techniquesare powerful, but if a strong rejection of the null hypothesis of theSarganHansen test is encountered, you should strongly doubt thevalidity of the estimates.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 16 / 31

  • Instrumental Variables Estimation in Stata Testing a subset of overidentifying restrictions

    We may be quite confident of some instruments independence from ubut concerned about others. In that case a GMM distance or C testmay be used. The orthog( ) option of ivreg2 will test whether asubset of the models overidentifying restrictions appear to be satisfied.

    This is carried out by calculating two SarganHansen statistics: one forthe full model and a second for the model in which the listed variablesare (a) considered endogenous, if included regressors, or (b) dropped,if excluded regressors. In case (a), the model must still satisfy theorder condition for identification. The difference of the twoSarganHansen statistics, often termed the GMM distance or Cstatistic, will be distributed 2 under the null hypothesis that thespecified orthogonality conditions are satisfied, with d.f. equal to thenumber of those conditions.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 17 / 31

  • Instrumental Variables Estimation in Stata Testing a subset of overidentifying restrictions

    We may be quite confident of some instruments independence from ubut concerned about others. In that case a GMM distance or C testmay be used. The orthog( ) option of ivreg2 will test whether asubset of the models overidentifying restrictions appear to be satisfied.

    This is carried out by calculating two SarganHansen statistics: one forthe full model and a second for the model in which the listed variablesare (a) considered endogenous, if included regressors, or (b) dropped,if excluded regressors. In case (a), the model must still satisfy theorder condition for identification. The difference of the twoSarganHansen statistics, often termed the GMM distance or Cstatistic, will be distributed 2 under the null hypothesis that thespecified orthogonality conditions are satisfied, with d.f. equal to thenumber of those conditions.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 17 / 31

  • Instrumental Variables Estimation in Stata Testing a subset of overidentifying restrictions

    A variant on this strategy is implemented by the endog( ) option ofivreg2, in which one or more variables considered endogenous canbe tested for exogeneity. The C test in this case will consider whetherthe null hypothesis of their exogeneity is supported by the data.

    If all endogenous regressors are included in the endog( ) option, thetest is essentially a test of whether IV methods are required toestimate the equation. If OLS estimates of the equation are consistent,they should be preferred. In this context, the test is equivalent to aHausman test comparing IV and OLS estimates, as implemented byStatas hausman command with the sigmaless option. Usingivreg2, you need not estimate and store both models to generate thetests verdict.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 18 / 31

  • Instrumental Variables Estimation in Stata Testing a subset of overidentifying restrictions

    A variant on this strategy is implemented by the endog( ) option ofivreg2, in which one or more variables considered endogenous canbe tested for exogeneity. The C test in this case will consider whetherthe null hypothesis of their exogeneity is supported by the data.

    If all endogenous regressors are included in the endog( ) option, thetest is essentially a test of whether IV methods are required toestimate the equation. If OLS estimates of the equation are consistent,they should be preferred. In this context, the test is equivalent to aHausman test comparing IV and OLS estimates, as implemented byStatas hausman command with the sigmaless option. Usingivreg2, you need not estimate and store both models to generate thetests verdict.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 18 / 31

  • Instrumental Variables Estimation in Stata Testing for weak instruments

    Instrumental variables methods rely on two assumptions: the excludedinstruments are distributed independently of the error process, andthey are sufficiently correlated with the included endogenousregressors. Tests of overidentifying restrictions address the firstassumption, although we should note that a rejection of their null maybe indicative that the exclusion restrictions for these instruments maybe inappropriate. That is, some of the instruments have beenimproperly excluded from the regression models specification.

    The specification of an instrumental variables model asserts that theexcluded instruments affect the dependent variable only indirectly,through their correlations with the included endogenous variables. Ifan excluded instrument exerts both direct and indirect influences onthe dependent variable, the exclusion restriction should be rejected.This can be readily tested by including the variable as a regressor.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 19 / 31

  • Instrumental Variables Estimation in Stata Testing for weak instruments

    Instrumental variables methods rely on two assumptions: the excludedinstruments are distributed independently of the error process, andthey are sufficiently correlated with the included endogenousregressors. Tests of overidentifying restrictions address the firstassumption, although we should note that a rejection of their null maybe indicative that the exclusion restrictions for these instruments maybe inappropriate. That is, some of the instruments have beenimproperly excluded from the regression models specification.

    The specification of an instrumental variables model asserts that theexcluded instruments affect the dependent variable only indirectly,through their correlations with the included endogenous variables. Ifan excluded instrument exerts both direct and indirect influences onthe dependent variable, the exclusion restriction should be rejected.This can be readily tested by including the variable as a regressor.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 19 / 31

  • Instrumental Variables Estimation in Stata Testing for weak instruments

    To test the second assumptionthat the excluded instruments aresufficiently correlated with the included endogenous regressorsweshould consider the goodness-of-fit of the first stage regressionsrelating each endogenous regressor to the entire set of instruments.

    It is important to understand that the theory of single-equation (limitedinformation) IV estimation requires that all columns of X areconceptually regressed on all columns of Z in the calculation of theestimates. We cannot meaningfully speak of this variable is aninstrument for that regressor or somehow restrict which instrumentsenter which first-stage regressions. Statas ivreg or ivreg2 will notlet you do that because there is no analytical validity in such acomputation.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 20 / 31

  • Instrumental Variables Estimation in Stata Testing for weak instruments

    To test the second assumptionthat the excluded instruments aresufficiently correlated with the included endogenous regressorsweshould consider the goodness-of-fit of the first stage regressionsrelating each endogenous regressor to the entire set of instruments.

    It is important to understand that the theory of single-equation (limitedinformation) IV estimation requires that all columns of X areconceptually regressed on all columns of Z in the calculation of theestimates. We cannot meaningfully speak of this variable is aninstrument for that regressor or somehow restrict which instrumentsenter which first-stage regressions. Statas ivreg or ivreg2 will notlet you do that because there is no analytical validity in such acomputation.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 20 / 31

  • Instrumental Variables Estimation in Stata Testing for weak instruments

    The first and ffirst options of ivreg2 present several usefuldiagnostics that assess the first-stage regressions. If there is a singleendogenous regressor, these issues are simplified, as the instrumentseither explain a reasonable fraction of that regressors variability or not.With multiple endogenous regressors, diagnostics are morecomplicated, as each instrument is being called upon to play a role ineach first-stage regression. With sufficiently weak instruments, theasymptotic identification status of the equation is called into question.An equation identified by the order and rank conditions in a finitesample may still be effectively unidentified.

    As Staiger and Stock (Econometrica, 1997) show, the weakinstruments problem can arise even when the first-stage t- and F -testsare significant at conventional levels in a large sample. In the worstcase, the bias of the IV estimator is the same as that of OLS, IVbecomes inconsistent, and nothing is gained by instrumenting.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 21 / 31

  • Instrumental Variables Estimation in Stata Testing for weak instruments

    The first and ffirst options of ivreg2 present several usefuldiagnostics that assess the first-stage regressions. If there is a singleendogenous regressor, these issues are simplified, as the instrumentseither explain a reasonable fraction of that regressors variability or not.With multiple endogenous regressors, diagnostics are morecomplicated, as each instrument is being called upon to play a role ineach first-stage regression. With sufficiently weak instruments, theasymptotic identification status of the equation is called into question.An equation identified by the order and rank conditions in a finitesample may still be effectively unidentified.

    As Staiger and Stock (Econometrica, 1997) show, the weakinstruments problem can arise even when the first-stage t- and F -testsare significant at conventional levels in a large sample. In the worstcase, the bias of the IV estimator is the same as that of OLS, IVbecomes inconsistent, and nothing is gained by instrumenting.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 21 / 31

  • Instrumental Variables Estimation in Stata Testing for weak instruments

    Beyond the informal rule-of-thumb diagnostics such as F > 10,ivreg2 computes several statistics that can be used to criticallyevaluate the strength of instruments. We can write the first-stageregressions as

    X = Z + v

    With X1 as the endogenous regressors, Z1 the excluded instrumentsand Z2 as the included instruments, this can be partitioned as

    X1 = [Z1Z2] [1112] + v1

    The rank condition for identification states that the L K1 matrix 11must be of full column rank.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 22 / 31

  • Instrumental Variables Estimation in Stata The Anderson canonical correlation statistic

    We do not observe the true 11, so we must replace it with anestimate. Andersons (John Wiley, 1984) approach to testing the rankof this matrix (or that of the full Pi matrix) considers the canonicalcorrelations of the X and Z matrices. If the equation is to be identified,all K of the canonical correlations will be significantly different fromzero.

    The squared canonical correlations can be expressed as eigenvaluesof a matrix. Andersons CC test considers the null hypothesis that theminimum canonical correlation is zero. Under the null, the test statisticis distributed 2 with (L K + 1) d.f., so it may be calculated even foran exactly-identified equation. Failure to reject the null suggests theequation is unidentified. ivreg2 routinely reports this LR statistic.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 23 / 31

  • Instrumental Variables Estimation in Stata The Anderson canonical correlation statistic

    We do not observe the true 11, so we must replace it with anestimate. Andersons (John Wiley, 1984) approach to testing the rankof this matrix (or that of the full Pi matrix) considers the canonicalcorrelations of the X and Z matrices. If the equation is to be identified,all K of the canonical correlations will be significantly different fromzero.

    The squared canonical correlations can be expressed as eigenvaluesof a matrix. Andersons CC test considers the null hypothesis that theminimum canonical correlation is zero. Under the null, the test statisticis distributed 2 with (L K + 1) d.f., so it may be calculated even foran exactly-identified equation. Failure to reject the null suggests theequation is unidentified. ivreg2 routinely reports this LR statistic.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 23 / 31

  • Instrumental Variables Estimation in Stata The CraggDonald statistic

    The CD statistic is a closely related test of the rank of a matrix. Whilethe Anderson CC test is a LR test, the CD test is a Wald statistic, withthe same asymptotic distribution. The CD statistic plays an importantrole in Stock and Yogos work (see below). Both the Anderson andCD tests are reported by ivreg2 with the first option.

    The canonical correlations may also be used to test a set ofinstruments for redundancy (Hall and Peixe, ES WC 2000). Theredundant( ) option of ivreg2 allows a set of excludedinstruments to be tested for relevance, with the null hypothesis thatthey do not contribute to the asymptotic efficiency of the equation.

    All of these tests assume i .i .d . errors. In the presence of non-i .i .d .errors, they will be biased upwards, making identification appear morelikely than it really is.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 24 / 31

  • Instrumental Variables Estimation in Stata The CraggDonald statistic

    The CD statistic is a closely related test of the rank of a matrix. Whilethe Anderson CC test is a LR test, the CD test is a Wald statistic, withthe same asymptotic distribution. The CD statistic plays an importantrole in Stock and Yogos work (see below). Both the Anderson andCD tests are reported by ivreg2 with the first option.

    The canonical correlations may also be used to test a set ofinstruments for redundancy (Hall and Peixe, ES WC 2000). Theredundant( ) option of ivreg2 allows a set of excludedinstruments to be tested for relevance, with the null hypothesis thatthey do not contribute to the asymptotic efficiency of the equation.

    All of these tests assume i .i .d . errors. In the presence of non-i .i .d .errors, they will be biased upwards, making identification appear morelikely than it really is.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 24 / 31

  • Instrumental Variables Estimation in Stata The CraggDonald statistic

    The CD statistic is a closely related test of the rank of a matrix. Whilethe Anderson CC test is a LR test, the CD test is a Wald statistic, withthe same asymptotic distribution. The CD statistic plays an importantrole in Stock and Yogos work (see below). Both the Anderson andCD tests are reported by ivreg2 with the first option.

    The canonical correlations may also be used to test a set ofinstruments for redundancy (Hall and Peixe, ES WC 2000). Theredundant( ) option of ivreg2 allows a set of excludedinstruments to be tested for relevance, with the null hypothesis thatthey do not contribute to the asymptotic efficiency of the equation.

    All of these tests assume i .i .d . errors. In the presence of non-i .i .d .errors, they will be biased upwards, making identification appear morelikely than it really is.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 24 / 31

  • Instrumental Variables Estimation in Stata The Stock and Yogo approach

    Stock and Yogo (Camb.U.Press festschrift, 2005) propose testing forweak instruments by using the F -statistic form of the CD statistic.Their null hypothesis is that the estimator is weakly identified in thesense that it is subject to bias that the investigator finds unacceptablylarge.

    Their test comes in two flavors: maximal relative bias (relative to thebias of OLS) and maximal size. The former test has the null thatinstruments are weak, where weak instruments are those that can leadto an asymptotic relative bias greater than some level b. This test usesthe finite sample distribution of the IV estimator, and can only becalculated where the appropriate moments exist. The mth momentexists iff m < (L K + 1). The test is routinely reported in ivreg2output when it can be calculated, with the relevant critical valuescalculated by Stock and Yogo.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 25 / 31

  • Instrumental Variables Estimation in Stata The Stock and Yogo approach

    Stock and Yogo (Camb.U.Press festschrift, 2005) propose testing forweak instruments by using the F -statistic form of the CD statistic.Their null hypothesis is that the estimator is weakly identified in thesense that it is subject to bias that the investigator finds unacceptablylarge.

    Their test comes in two flavors: maximal relative bias (relative to thebias of OLS) and maximal size. The former test has the null thatinstruments are weak, where weak instruments are those that can leadto an asymptotic relative bias greater than some level b. This test usesthe finite sample distribution of the IV estimator, and can only becalculated where the appropriate moments exist. The mth momentexists iff m < (L K + 1). The test is routinely reported in ivreg2output when it can be calculated, with the relevant critical valuescalculated by Stock and Yogo.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 25 / 31

  • Instrumental Variables Estimation in Stata The Stock and Yogo approach

    The second test proposed by Stock and Yogo is based on theperformance of the Wald test statistic for the endogenous regressors.Under weak identification, the test rejects too often. The test statistic isbased on the rejection rate r tolerable to the researcher if the truerejection rate is 5%. Their tabulated values consider various values forr . To be able to reject the null that the size of the test is unacceptablylarge (versus 5%), the CraggDonald F statistic must exceed thetabulated critical value.

    The StockYogo test statistics, like others discussed above, assumei .i .d . errors.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 26 / 31

  • Instrumental Variables Estimation in Stata The Stock and Yogo approach

    The second test proposed by Stock and Yogo is based on theperformance of the Wald test statistic for the endogenous regressors.Under weak identification, the test rejects too often. The test statistic isbased on the rejection rate r tolerable to the researcher if the truerejection rate is 5%. Their tabulated values consider various values forr . To be able to reject the null that the size of the test is unacceptablylarge (versus 5%), the CraggDonald F statistic must exceed thetabulated critical value.

    The StockYogo test statistics, like others discussed above, assumei .i .d . errors.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 26 / 31

  • Instrumental Variables Estimation in Stata The AndersonRubin test for endogenous regressors

    The AndersonRubin (Ann.Math.Stat., 1949) test for the significanceof endogenous regressors in the structural equation is robust to thepresence of weak instruments, and may be robustified for non-i .i .d .errors if an alternative VCE is estimated. The test essentiallysubstitutes the reduced-form equations into the structural equation andtests for the joint significance of the excluded instruments in Z1.

    If a single endogenous regressor appears in the equation, alternativetest statistics robust to weak instruments are provided by Moreira andPoi (Stata J., 2003) and Mikusheva and Poi (Stata J., 2006) as thecondivreg and condtest commands.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 27 / 31

  • Instrumental Variables Estimation in Stata The AndersonRubin test for endogenous regressors

    The AndersonRubin (Ann.Math.Stat., 1949) test for the significanceof endogenous regressors in the structural equation is robust to thepresence of weak instruments, and may be robustified for non-i .i .d .errors if an alternative VCE is estimated. The test essentiallysubstitutes the reduced-form equations into the structural equation andtests for the joint significance of the excluded instruments in Z1.

    If a single endogenous regressor appears in the equation, alternativetest statistics robust to weak instruments are provided by Moreira andPoi (Stata J., 2003) and Mikusheva and Poi (Stata J., 2006) as thecondivreg and condtest commands.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 27 / 31

  • Instrumental Variables Estimation in Stata LIML and GMM-CUE estimation

    OLS and IV estimators are special cases of k-class estimators: OLSwith k = 0 and IV with k = 1. Limited-information maximum likelihood(LIML) is another member of this class, with k chosen optimally in theestimation process. Like any ML estimator, LIML is invariant tonormalization. In an equation with two endogenous variables, it doesnot matter whether you specify y1 or y2 as the left-hand variable.

    The latest version of ivreg2 produces LIML estimates with the limloption for equations with i .i .d . errors. If that assumption is notreasonable, you may use the GMM equivalent: the continuouslyupdated GMM estimator, or CUE estimator. In ivreg2, the cue optioncombined with robust, cluster and/or bw( ) options specifies thatnon-i .i .d . errors are to be modeled.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 28 / 31

  • Instrumental Variables Estimation in Stata LIML and GMM-CUE estimation

    OLS and IV estimators are special cases of k-class estimators: OLSwith k = 0 and IV with k = 1. Limited-information maximum likelihood(LIML) is another member of this class, with k chosen optimally in theestimation process. Like any ML estimator, LIML is invariant tonormalization. In an equation with two endogenous variables, it doesnot matter whether you specify y1 or y2 as the left-hand variable.

    The latest version of ivreg2 produces LIML estimates with the limloption for equations with i .i .d . errors. If that assumption is notreasonable, you may use the GMM equivalent: the continuouslyupdated GMM estimator, or CUE estimator. In ivreg2, the cue optioncombined with robust, cluster and/or bw( ) options specifies thatnon-i .i .d . errors are to be modeled.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 28 / 31

  • Instrumental Variables Estimation in Stata Testing for i.i.d. errors in an IV context

    In the context of an equation estimated with instrumental variables, thestandard diagnostic tests for heteroskedasticity and autocorrelation aregenerally not valid.

    In the case of heteroskedasticity, Pagan and Hall (EconometricReviews, 1983) showed that the BreuschPagan or CookWeisbergtests (estat hettest) are generally not usable in an IV setting.They propose a test that will be appropriate in IV estimation whereheteroskedasticity may be present in more than one structuralequation. Mark Schaffers ivhettest, part of the ivreg2 suite,performs the PaganHall test under a variety of assumptions on theindicator variables. It will also reproduce the BreuschPagan test ifapplied in an OLS context.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 29 / 31

  • Instrumental Variables Estimation in Stata Testing for i.i.d. errors in an IV context

    In the context of an equation estimated with instrumental variables, thestandard diagnostic tests for heteroskedasticity and autocorrelation aregenerally not valid.

    In the case of heteroskedasticity, Pagan and Hall (EconometricReviews, 1983) showed that the BreuschPagan or CookWeisbergtests (estat hettest) are generally not usable in an IV setting.They propose a test that will be appropriate in IV estimation whereheteroskedasticity may be present in more than one structuralequation. Mark Schaffers ivhettest, part of the ivreg2 suite,performs the PaganHall test under a variety of assumptions on theindicator variables. It will also reproduce the BreuschPagan test ifapplied in an OLS context.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 29 / 31

  • Instrumental Variables Estimation in Stata Testing for i.i.d. errors in an IV context

    In the same token, the BreuschGodfrey statistic used in the OLScontext (estat bgodfrey) will generally not be appropriate in thepresence of endogenous regressors, overlapping data or conditionalheteroskedasticity of the error process. Cumby and Huizinga(Econometrica, 1992) proposed a generalization of the BG statisticwhich handles each of these cases.

    Their test is actually more general in another way. Its null hypothesis ofthe test is that the regression error is a moving average of known orderq 0 against the general alternative that autocorrelations of theregression error are nonzero at lags greater than q. In that context, itcan be used to test that autocorrelations beyond any q are zero. Likethe BG test, it can test multiple lag orders. The CH test is available asBaum and Schaffers ivactest routine, part of the ivreg2 suite.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 30 / 31

  • Instrumental Variables Estimation in Stata Testing for i.i.d. errors in an IV context

    In the same token, the BreuschGodfrey statistic used in the OLScontext (estat bgodfrey) will generally not be appropriate in thepresence of endogenous regressors, overlapping data or conditionalheteroskedasticity of the error process. Cumby and Huizinga(Econometrica, 1992) proposed a generalization of the BG statisticwhich handles each of these cases.

    Their test is actually more general in another way. Its null hypothesis ofthe test is that the regression error is a moving average of known orderq 0 against the general alternative that autocorrelations of theregression error are nonzero at lags greater than q. In that context, itcan be used to test that autocorrelations beyond any q are zero. Likethe BG test, it can test multiple lag orders. The CH test is available asBaum and Schaffers ivactest routine, part of the ivreg2 suite.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 30 / 31

  • Instrumental Variables Estimation in Stata Panel data IV estimation

    Panel data IV estimation

    The features of ivreg2 are also available in the routine xtivreg2,which is a wrapper for ivreg2. This routine of Mark Schaffersextends Statas xtivregs support for the fixed effect (fe) and firstdifference (fd) estimators. The xtivreg2 routine is available fromssc.

    Just as ivreg2 may be used to conduct a Hausman test of IV vs.OLS, Schaffer and Stillmans xtoverid routine may be used toconduct a Hausman test of random effects vs. fixed effects afterxtreg, re and xtivreg, re. This routine can also calculate testsof overidentifying restrictions after those two commands as well asxthtaylor. The xtoverid routine is also available from ssc.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 31 / 31

  • Instrumental Variables Estimation in Stata Panel data IV estimation

    Panel data IV estimation

    The features of ivreg2 are also available in the routine xtivreg2,which is a wrapper for ivreg2. This routine of Mark Schaffersextends Statas xtivregs support for the fixed effect (fe) and firstdifference (fd) estimators. The xtivreg2 routine is available fromssc.

    Just as ivreg2 may be used to conduct a Hausman test of IV vs.OLS, Schaffer and Stillmans xtoverid routine may be used toconduct a Hausman test of random effects vs. fixed effects afterxtreg, re and xtivreg, re. This routine can also calculate testsof overidentifying restrictions after those two commands as well asxthtaylor. The xtoverid routine is also available from ssc.

    Christopher F Baum (Boston College) Instrumental Variables Estimation in Stata March 2007 31 / 31

    Instrumental Variables Estimation in StataIntroduction The IV-GMM estimatorExact identification and 2SLSThe IV-GMM approachThe GMM weighting matrixIV-GMM and the distribution of uIV-GMM cluster-robust estimatesIV-GMM HAC estimatesImplementation in Stataivreg2 optionsTests of overidentifying restrictionsTesting a subset of overidentifying restrictionsTesting for weak instrumentsThe Anderson canonical correlation statisticThe Cragg--Donald statisticThe Stock and Yogo approachThe Anderson--Rubin test for endogenous regressorsLIML and GMM-CUE estimationTesting for i.i.d. errors in an IV contextPanel data IV estimation