Abstract
We derive a new matrix statistic for the Hausman test for endogeneity in cross-sectional Instrumental Variables estimation, that incorporates heteroskedasticity in a natural way and does not use a generalized inverse. A Monte Carlo study examines the performance of the statistic for different heteroskedasticity-robust variance estimators and different skedastic situations. We find that the test statistic performs well as regards empirical size in almost all cases; however, as regards empirical power, how one corrects for heteroskedasticity matters. We also compare its performance with that of the Wald statistic from the augmented regression setup that is often used for the endogeneity test, and we find that the choice between them may depend on the desired significance level of the test.
Keywords:
Hausman test; heteroskedasticity; endogeneity; instrumental variables; generalized matrix inverse; Wald statistic JEL Classification:
C12; C26; C21
1. Introduction
The Hausman family of specification tests was introduced by Hausman (1978) and it has seen unabated use in econometrics ever since. Amini et al. (2012) detail its wide reach and different implementations for panel data, while in a cross-sectional setting, the test has often been used to test for regressor endogeneity.
In the cross-sectional setting, the test statistic is formally based on a “vector of contrasts”, the difference of two estimators, where under the null hypothesis, both are consistent and the one is also efficient, while under the alternative, only one is consistent. This form of the test uses a variance expression that is often singular, requiring a generalized inverse. To bypass the singularity of the variance matrix an “augmented regression” approach has been developed, linking the test with its precursors (Durbin 1954; Wu 1973, 1974).1
The efficiency of one of the estimators under the null hypothesis has a very convenient consequence: the variance of the difference of the two estimators equals the difference of their variances; thus, we do not have to compute covariances. However, when heteroskedasticity is present (and it is expected to exist regularly in cross sectional studies), this helpful simplification is no longer valid. Adkins et al. (2012) have examined in great detail this endogeneity test in situations of heteroskedasticity, and they take the augmented regression route to formulate the various test variants that they implement.
In this study, we push a known result in the literature to its conclusion, and we arrive at a new matrix Hausman statistic for an endogeneity test. This new statistic is a useful additional tool to have, for the following reasons: it handles heteroskedasticity in a natural way; it could be a more familiar tool to use for researchers that are accustomed to using matrix algebra and forms; compared to the original form of the Hausman statistic, it does not use generalized inverses. In fact, if the matrix involved is not invertible, it reflects the existence of perfect collinearity between some instruments and some endogenous regressors, which invalidates the instruments. Finally, in Monte Carlo simulations that we will present, it performed better than the “augmented regression” test in terms of power, when executing the test at the 10% significance level.
2. The Matrix Hausman Statistic for Testing Endogeneity
We follow the notation of Adkins et al. (2012). We consider the linear regression model . The vectors and are , and is assumed to be zero-mean. The regressor matrix is partitioned . is an submatrix of regressors thought to be endogenous (so not orthogonal to the error term) while is an submatrix of exogenous regressors (or “internal instruments”). The unknown of interest is the vector . We have available “external instruments” collected in matrix and the full instruments matrix is . We write the orthogonal projection matrix and the residual-maker (or annihilator) matrix , with being the Identity matrix. The subscript in P and M determines which collection of variables we use in each case. These matrices are symmetric and idempotent. We write for the residuals from the Ordinary Least Squares regression (OLS). We write for the linear projection of X on the columns of Z (the “fitted values”). Note that because belongs in the column space of .
The OLS estimator for is while the benchmark Instrumental Variables (IV) estimator when instruments are more in number than endogenous regressors is (two-stage least-squares). The basic expression of the Hausman statistic under homoskedasticity of the error term (with the OLS estimate of the error variance ) is
This is the statistic where we may encounter trouble in inverting the middle matrix, which, moreover, may not even be positive definite in finite samples. It may render the test inapplicable, or necessitate the use of a generalized inverse instead.
To bypass this issue, while simultaneously accounting for heteroskedasticity, we start by noting that the core of the statistic for the Hausman test is the difference
We have used the fact that are symmetric and idempotent and that . Result (2) is known in the literature. For example, Greene (2012, p. 276) arrives at it, but he does not go further. Also Adkins et al. (2012) actually start with it (their Equation (1)), but then they use the augmented regression approach to proceed. Also, later in their paper, when they re-purpose the “weak vs. strong instruments” test of Hahn et al. (2011), they “directly estimate the asymptotic covariance matrix of the contrast”, but the expression they give is inconveniently long, since this variance can be nicely compacted, as we will show. To our knowledge, the result in Equation (2) has not been pursued to the very end for the construction of a Hausman statistic and test, and this is what we will do here.
The null hypothesis of the Hausman test is that the two estimators converge to the same probability limit (plim):
To examine this hypothesis we consider the limiting distribution of the scaled difference and its variance, which, under the null hypothesis and given Equation (2), is
The middle matrix is . We can then formulate a theoretical statistic for the endogeneity test,
Here, denotes a generalized inverse of V.2 Combining Equation (2) and (3) with (4), we arrive at the following statistic feasible to compute, for some consistent estimator ,
We show in Appendix A that a generalized inverse of the middle matrix is , where denotes the Moore–Penrose generalized inverse. Inserting this in the expression for , we can simplify,
Next, because includes the submatrix , which is by construction orthogonal to the OLS residuals , we obtain that
We show in Appendix B that
We have managed to eliminate the generalized inverse and to use a proper inverse.3 What remains now is to find a consistent estimator for the Q matrix. Decomposing the OLS residuals, we have
This matrix expression, where we sandwich the outer product of the error vector, may look familiar to those acquainted with the heteroskedasticity-robust estimation literature and one could expect that we could now use the squared residuals in place of to estimate Q. However, there is an issue: the matrix is , growing in both dimensions as the sample size increases. So it is not clear that the related proof strategy of White (1980) is applicable here. Nevertheless, by drilling down even more, we arrive, in Appendix C, at an expression that contains matrix products with finite dimensions. Thus, we can indeed apply this substitution, which provides a consistent estimator for Q as
This indeed looks like a “White” estimator of a heteroskedastic covariance matrix. The expression is valid under the formal assumptions stated in White (1980), which we do not repeat here for brevity.
Equation (9) allows us also to conclude that the matrix Q must be invertible; otherwise, at least one component of the instruments matrix is not valid.
This can be shown in the following way: Let be a column of , the submatrix with the endogenous regressors. If , we will have so will have a column of zeros and Q will be singular. However, implies that belongs to the column space of the instruments matrix Z, meaning that it is an exact linear combination of the columns of Z. However, if this were the case, it necessarily implies that at least one of the instruments would be correlated with the error term, and so Z too would suffer from endogeneity. Namely, if while , we will have .
Therefore, using a proper inverse here also serves the function of alerting us that such exact linear dependence exists between instruments and endogenous regressors, if the matrix Q proves to be non-invertible. In such a case, executing the endogeneity test using a generalized inverse would be wrong; one first has to somehow correct the instruments matrix to restore the validity of the instruments.4
Lastly, using these results in the expression for , and again the fact that , we arrive at the final expression for the heteroskedasticity-robust matrix Hausman statistic (where we have also canceled out the factors),
Computing this statistic first requires running OLS estimation on the original model to obtain the residuals and their squares for , and then using the matrices and (since ), and also the matrix . The matrices and are of dimension ; thus, for very large samples, they may be taxing for the software (although they will be used just once in an actual applied study; it is simulation studies that may be considerably slowed down when using them). If one wishes to avoid them, to obtain , we can run OLS regressions for the columns of on Z, and also, to compute we can run regressions of on X and obtain the resulting residual series.
The statistic can be used also under the assumption of homoskedasticity, in which case it becomes
To increase power, one should use the error variance estimator from the OLS regression.
Equations (10) and (11) are the main theoretical contribution of this study. We have exploited the expression for the vector of contrasts in terms of projected regressors and OLS residuals, and we have arrived at a matrix Hausman statistic that incorporates possible heteroskedasticity in a natural way, it has a compact form, it does not use generalized inverses, and it guards against invalid instruments.
In the next section we present results from a simulation study to examine the performance of this matrix Hausman statistic, looking also into the variants that have been proposed for in an attempt to improve finite-sample performance. A recent overview and Monte Carlo study for these “HCx” estimators for heteroskedastic variance matrices can be found in MacKinnon (2013).
3. Monte Carlo Study
3.1. Description
We constructed a data generation process (DGP) with a constant term, one exogenous variable, two “suspected” endogenous variables and three external valid instruments. We considered a case where the DGP includes an unobservable covariate uncorrelated with the regressors (so here, OLS is consistent even if this variable is not included in the regressor matrix), and one where it is correlated (so there is endogeneity and OLS is inconsistent). The first case serves to examine the empirical size of the test, while the second provides information about the power of the test. The technical details of the Monte Carlo study are presented in Appendix D.
We created four scenarios as regards heteroskedasticity of the error term: homoskedasticity, heteroskedasticity with the error variance randomly changing per observation independently of the regressors, “group-wise” heteroskedasticity, where the error variance takes only three distinct values with equal probability, again independent of the regressors, and finally, a “random-coefficients” model, which leads to the error variance being a function of the regressors, without this affecting mean-independence. We considered sample sizes , and in each case, we executed 10,000 repetitions. In all cases, we initiated the random number generator by the same seed. This has two consequences: first, for a given sample size all scenarios have identical series for the observable variables, and they differ only with respect to the endogeneity/heteroskedasticity aspect. Second, for each scenario, as we increase the sample size the previous generated values are fully part of the larger sample. In this way, we mimic the accumulation of data rather than the availability of independent larger data sets.
As regards the statistic, we used both its homoskedastic variant (i.e., assuming, correctly or not, that the true error is homoskedastic), as well as the four best-known alternatives for estimation of heteroskedastic variance matrices, , as these are defined in MacKinnon (2013): writing for the diagonal element of the projection matrix , we have
Note that k is the number of regressors each time. For our matrix statistic, the number of regressors is , where .
3.2. Comparative Performance of the Variants of the Matrix Hausman Statistic
Here, we assess how the statistic performs in terms of empirical size and power, as we change the heteroskedasticity correction. We do not compare it with other forms of the Hausman test, because we want first to determine whether it has an acceptable performance (empirical size close to nominal, power rising fast with the sample size). If it performs acceptably, then a case arises to compare it to other forms of the Hausman test. We present the results in Table 1, which relates to testing at the significance level.
Table 1.
Monte Carlo simulation study. Empirical Size and Power of the matrix Hausman statistic. Nominal size: 5%.
We have the following main observations: first, the behavior of the Hausman matrix statistic as regards empirical size is rather stable, across different true skedastic scenarios as well as across different ways to incorporate the possible heteroskedasticity. In fact, it performs acceptably in relation to the size of the test, even if we ignore the possible presence of heteroskedasticity and use (11) instead of (10). Second, for the various variants to account for heteroskedasticity, the empirical size monotonically falls as we increase the strength of the finite-sample correction that we apply. Results for testing at the significance level (available upon request) show a similar behavior in relation to empirical size.
As regards empirical power, the choice of the heteroskedastic variant for matters even more, for small sample sizes. Power also deteriorates monotonically and visibly, while the highest power is achieved when we use the homoskedastic variant (where the test is slightly conservative).5 Overall, for testing at the significance level, it appears that the prudent thing to do when applying this statistic, is to use its heteroskedastic formula. When testing at the significance level, power increases visibly. For example, under conditional heteroskedasticity, the power at for sample sizes tends to be higher by a factor of to almost , i.e., almost double the power at the significance level, all else being equal. For the significance level therefore, it appears best to use the homoskedastic variant of the matrix statistic, Equation (11).
The finding that ignoring heteroskedasticity while it exists may lead to better-performing tests should not be surprising for small samples. To account for heteroskedasticity, we use additional estimated quantities, the OLS residuals individually and this should be expected to negatively affect statistical power in the context of a small sample.
3.3. Comparison with the Wald Statistic from the Augmented Regression Approach
Using the exact same simulated data sets, we have also computed the Wald statistic coming from the augmented regression setup to test for endogeneity. Here, we first regress the suspected endogenous regressors on the full instrument matrix Z, we obtain the residuals and we include these residuals in an augmented regressor matrix .6 We run an OLS regression of the dependent variable on , and we compute a Wald test for the coefficients of the regressors in the submatrix .7
In the interest of space, we do not report the full results here. The Wald statistic clearly has a size problem for these small samples: it tends to over-reject the correct null hypothesis, sometimes even having empirical size nearly double the nominal one (for both and nominal significance levels). The over-rejection becomes less than one percentile across skedastic scenarios, only with the heteroskedasticity correction.8 In Table 2, we report the performance for this statistic for testing at the significance level, and we repeat the performance metrics for our matrix statistic with the formula from Table 1.
Table 2.
Comparison in empirical size and power of the matrix Hausman statistic vs. the Wald statistic from the augmented regression setup. Nominal size: 5%.
The Wald statistic appears to have an advantage as regards power, even though some of this advantage will be lost due to the correction for the slightly oversized test. However, the picture changes if we want to test at the significance level. Here, it is our matrix statistic (which moreover assumes homoskedasticity) that has the advantage in terms of power, as is shown in Table 3.
Table 3.
Comparison in empirical size and power of the matrix Hausman statistic vs. the Wald statistic from the augmented regression setup. Nominal size: 10%.
Overall, no statistic dominates the other, and for sample sizes larger than the two are essentially equivalent in terms of size and power. For smaller samples, the desired significance level of the test can be our guide in order to choose between them.
Funding
This research received no external funding.
Data Availability Statement
No data were used for this study.
Conflicts of Interest
The author declare no conflicts of interest.
Appendix A
We argue that a generalized inverse of is .
A generalized inverse of matrix A satisfies . Setting for compactness and , our candidate generalized inverse is . We have
which is what we wanted to show. holds because the Moore–Penrose inverse satisfies this condition, among others.
Appendix B
We argue that
In order for a matrix to be indeed the unique Moore–Penrose pseudo-inverse of matrix A, it must satisfy four conditions:
- .
Note that Q is symmetric. For condition 1, we have
For condition 2, we have
For condition 3, we have
and for condition 4, we have analogously
Appendix C
We want to find a consistent estimator for
We have
However, ; thus, carrying out the multiplications and including the sample size as a scaling factor, we arrive at
The standard regularity conditions are assumed to hold, and so the matrices that sandwich the middle one are well defined and converge to a finite probability limit. Focusing on the middle one, we have
Further, and ; thus, adding scaling factors again, we have
Under the regularity conditions and the assumptions in White (1980), the probability limits of all these matrix products can be consistently estimated if in place of , we use . Reverting back, this means that
Thus, we have obtained that a consistent estimator of the matrix Q is (now eliminating the redundant scaling factors)
This can be compacted. Consider the matrix, suitably bracketed,
The outer terms are identical to the outer terms of . Its middle term can be decomposed,
However, so
This is identical to the middle component of ; thus, we arrive at
Appendix D
We present here the details of the Monte Carlo (MC) study whose results we report in the main text. The study was conducted using the software “gretl”. For the random number generator, we have used the seed 1930021000.
Table A1 contains the random variables that we have used as building blocks.
Table A1.
Building blocks of MC simulation.
We have generated one “unobservable” that creates endogeneity and one that it does not, two regressors that become endogenous when the correlated unobservable is used in the data generation process, one exogenous, and three instruments. Table A2 contains the generating expressions.
Table A2.
Variables in the MC simulation.
We note that, even though is a Normal random variable, the instrument is relevant (correlated with the endogenous variables), because has a non-zero mean, and so its absolute value is a Folded Normal, and remains correlated with (in contrast, if was a zero-mean Normal and consequently a Half Normal, their covariance would be zero).
As regards the scenarios of homoskedasticity, random heteroskedasticity, and groupwise heteroskedasticity, the error term (including the unobservable variable) was generated as shown in Table A3 ( implies that the correlated latent variable was used).
Table A3.
Error terms in the MC simulation.
For these three setups, the dependent variable was generated as
So, for example, is the situation where we have random heteroskedasticity and no endogeneity; thus, it was used to assess the empirical size of the test for this specific heteroskedastic scenario.
For the conditional heteroskedasticity scheme, we used a random-coefficients model, with mean values of the random coefficients equal to the specified coefficients above, together with the homoskedastic error term , namely
Decomposed, this leads to
Since all conditional heteroskedasticity factors are scaled by independent zero-mean Normals, no additional source of endogeneity is created.
The general matrix Hausman statistic is
The OLS regressions regressed on a constant and . are the OLS residuals used also in computing . , where is the projection matrix of X. Its diagonal elements were used for the variants of . and , where is the projection matrix of a constant and of . For the homoskedastic variant of the statistic, the estimated OLS error variance was used, instead of .
Notes
| 1 | Sometimes it is also called the “artificial regression” or “control function” approach. |
| 2 | In the literature, the test is presented with the use of the Moore–Penrose pseudo-inverse , most likely because its uniqueness avoids the necessity to choose among alternatives in an ad hoc manner, as well as the uncertainty of obtaining possibly different results for different generalized inverses in finite samples. Regardless, the limiting distributional result holds for any generalized inverse, see Hausman and Taylor (1981). |
| 3 | The need for a generalized inverse in the original formulation of the test is treated as “cumbersome” in the literature, see for example Greene (2012, p. 276) and Wooldridge (2002, p. 119), and it is also put forth as an argument to favor the use of the augmented regression test. |
| 4 | The “augmented regression” test also guards against this possibility, since it uses the residuals from regressing each endogenous variable on the instruments. If exact linear dependence exists, the related series of residuals will be a series of zeros. |
| 5 | This monotonic fall of power, as we “intensify” the degree to which we attempt to correct the heteroskedasticity estimator for finite sample performance, is in accord with what MacKinnon (2013, pp. 456–57) found. |
| 6 | In case there is an issue with the validity of the instruments, as discussed earlier, in the augmented regression method, we would get at least one series of zero residuals. |
| 7 | So, as regards the heteroskedasticity corrector , the number of regressors in the augmented regression setup is , while for and , the diagonal element is of a projection matrix that includes these additional variables. |
| 8 | MacKinnon (2013, pp. 449–52) also found in his simulations that the HC3 variant performs best as regards empirical size in small samples. |
References
- Adkins, Lee C., Randall C. Campbell, Viera Chmelarova, and R. Carter Hill. 2012. The Hausman test, and some alternatives, with heteroskedastic data. In Essays in Honor of Jerry Hausman. Advances in Econometrics, vol. 29. Leeds: Emerald Group Publishing Ltd. [Google Scholar]
- Amini, Shahram, Michael S. Delgado, Daniel J. Henderson, and Christopher F. Parmeter. 2012. Fixed vs. random: The Hausman test four decades later. In Essays in Honor of Jerry Hausman. Advances in Econometrics, vol. 29. Leeds: Emerald Group Publishing Ltd. [Google Scholar]
- Durbin, James. 1954. Errors in variables. Revue de l’institut International de Statistique 22: 23–32. [Google Scholar] [CrossRef] [Scilit]
- Greene, William H. 2012. Econometric Analysis, 7th ed. Harlow: Pearson Education Ltd. [Google Scholar]
- Hahn, Jinyong, John C. Ham, and Hyungsik Roger Moon. 2011. The Hausman test and weak instruments. Journal of Econometrics 160: 289–99. [Google Scholar] [CrossRef] [Scilit]
- Hausman, Jerry A. 1978. Specification tests in econometrics. Econometrica 46: 1251–71. [Google Scholar] [CrossRef] [Scilit]
- Hausman, Jerry A., and William E. Taylor. 1981. A generalized specification test. Economics Letters 8: 239–45. [Google Scholar] [CrossRef] [Scilit]
- MacKinnon, James G. 2013. Thirty years of heteroskedasticity-robust inference. In Recent Advances and Future Directions in Causality, Prediction, and Specification Analysis. Edited by Xiaohong Chen and Norman R. Swanson. New York: Springer, pp. 437–61. [Google Scholar]
- White, Halbert. 1980. A heteroskedasticity-consistent covariance matrix estimator and a direct test for heteroskedasticity. Econometrica 48: 817–38. [Google Scholar] [CrossRef] [Scilit]
- Wooldridge, Jeffrey M. 2002. Econometric Analysis of cross Section and Panel Data. Cambridge: MIT Press. [Google Scholar]
- Wu, De-Min. 1973. Alternative tests of independence between stochastic regressors and disturbances. Econometrica 41: 733–50. [Google Scholar] [CrossRef] [Scilit]
- Wu, De-Min. 1974. Alternative tests of independence between stochastic regressors and disturbances: Finite sample results. Econometrica 42: 529–46. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).