1. Introduction
For a panel data linear regression model with individual effects capturing heterogeneity, empirical studies select the random-effects (RE) estimator if the
Hausman (
1978) test based on the contrast between the fixed-effects (FE) estimator and the random-effects estimator is not rejected (see
Owusu-Gyapong (
1986) for one such example). Alternatively, they select the fixed-effects estimator in cases where this Hausman test rejects the null hypothesis (see
Glick and Rose (
2002) for one such example). The fixed-effects estimator allows
all the regressors to be correlated with the individual effects, while the random-effects estimator assumes that
none of the regressors are correlated with the individual effects (see
Mundlak (
1978) for an explanation of this
all-or-
nothing idea).
Hausman and Taylor (
1981) argued that not all regressors may be correlated with individual effects, and proposed an instrumental variable estimator called the Hausman and Taylor (HT) estimator, which uses both the between and within variation in the strictly exogenous variables as instruments. This estimator allows the estimation of the coefficients of time-invariant regressors which are wiped out by the FE estimator. The extra instruments are obtained using the individual means of the strictly exogenous regressors as instruments for the time-invariant regressors that are correlated with the individual effects. The choice of strictly exogenous regressors is tested using a second Hausman test based upon the contrast between the FE and the HT estimators. Examples of time-invariant regressors include the effect of distance on trade and foreign direct investment (see
Egger and Pfaffermayr 2004), and the effect of common language on bilateral trade in a gravity equation (see
Serlenga and Shin 2007). The effects of time-invariant variables like race and gender in a Mincer wage equation (see
Cornwell and Rupert 1998) are important in wage discrimination applications estimating the wage gap between males and females or black and nonblack people.
Baltagi et al. (
2003) proposed a pretest estimator for this one-way error component panel data regression model based on these two-Hausman tests. In fact, the standard
Hausman (
1978) test based on the contrast between the one-way RE estimator and the one-way FE estimator is applied first. If it is not rejected, the pretest estimator chooses the one-way random-effects estimator. But rather than accepting the one-way fixed-effects estimator in cases where this first Hausman test rejects the null hypothesis, a second Hausman test based on the difference between the one-way FE and the one-way HT estimators is performed. If this second Hausman test does not reject the null hypothesis, the pretest estimator chooses the one-way HT estimator. Otherwise, this pretest estimator chooses the one-way FE estimator. In this study, the Monte Carlo results show that this pretest estimator is always second best in MSE performance compared to the efficient estimator, whether the model is random-effects, fixed-effects or Hausman and Taylor.
This paper generalizes this pretest estimator to the two-way panel data linear model with individual
and time effects. These could be macro-regressions of countries over time, or the marketing data of household purchases over repeated visits to a store. For the fixed versus random-effects in the two-way model, it is important to note that the
Mundlak (
1978) interpretation of the fixed-effects model as a correlated random effects model was generalized to this two-way model by
Wooldridge (
2021) and
Baltagi (
2023a). In fact,
Baltagi (
2023a) showed that in the Mundlak two-way model, the two-way fixed-effects model assumes that the time and individual effects are always correlated with
all the regressors, whereas the two-way random-effects model assumes that they are uncorrelated with
all the regressors. Once again, the choice between two-way fixed and two-way random-effects estimators is determined by a
Hausman (
1978) test, which was generalized from the one-way to the two-way model by
Kang (
1985).
Wyhowski (
1994) generalized the Hausman and Taylor estimator from the one-way to the two-way model. Instead of all the exogenous variables being uncorrelated with the time and individual effects as in the two-way random effects model, or all the exogenous variables being correlated with the time and individual effects like in the two-way fixed-effects model,
Wyhowski (
1994) allows some but not necessarily all of the regressors to be correlated with the individual and time effects.
Wyhowski (
1994) assumes that the researcher knows which regressors are correlated with the time effects but not the individual effects, the regressors that are correlated with the individual effects but not the time effects, the regressors correlated with both time and individual effects, as well as the regressors that are not correlated with both effects.
Baltagi (
2023b), on the other hand, assumes that the researcher only knows which regressors are not correlated with both effects. Wyhowski’s assumptions lead to more instrumental variables. These assumptions are testable using a Hausman-type over-identification test that is extended from the one-way to the two-way HT model (see
Baltagi 2023b). The two-way HT estimator allows the estimation of the effects of time-invariant as well as individual-invariant regressors which are wiped out by the two-way fixed-effects estimator.
1 In this study, Monte Carlo experiments are performed which compare the performance of this two-way pretest estimator with the standard panel data estimators under various designs. The estimators considered are ordinary least squares (OLS), two-way fixed-effects (TWFE), two-way random-effects (TWRE) and the two-way Hausman–Taylor (TWHT) estimators. In a two-way Hausman–Taylor design, we let some regressors be correlated with the individual effects and/or time effects. In a two-way RE design, the regressors are not allowed to be correlated with the individual and time effects. The Monte Carlo results show that the pretest estimator is always second best compared to the efficient estimator. It is second in RMSE performance compared to the two-way RE estimator in a two-way RE world, and second compared to the two-way HT estimator in a two-way HT world. The two-way FE estimator is a consistent estimator under both designs, but it is inefficient. The two-way HT estimator is the efficient estimator in the first design, and the two-way RE estimator is the efficient estimator in the second design. The disadvantage of the two-way FE estimator is that it does not allow the estimation of the coefficients of the time-invariant or individual-invariant regressors. Under the first design, where there is endogeneity among the regressors, we show that there is substantial bias in OLS and the two-way RE estimators, and both yield misleading inferences. Even under the second design, where there is no endogeneity between the time and individual effects and the regressors, inference based on OLS can be seriously misleading. This last result was emphasized by
Moulton (
1986).
2. The Two-Way Hausman and Taylor Estimator
Consider the two-way error component model:
where
is the
-th observation on the dependent variable,
denotes the constant,
represents
time-varying as well as individual-varying regressors,
represents
time-invariant regressors, and
represents
individual-invariant regressors.
,
and
independent of each other and themselves. let
denote the total number of observations.
In vector form, (
1) can be written as
where
ordered by
i as the slow index and
t as the fast index.
is a vector of ones of dimension
X is
,
Z is
,
W is
.
and
.
,
, where ⊗ is the Kronecker product,
is an identity matrix of dimension
N,
a vector of ones of dimension
N,
,
, and
Wyhowski (
1994) extended the
Hausman and Taylor (
1981) idea from the one-way to the two-way set up and allowed some but not necessarily all of the explanatory variables to be correlated with
and
.
Wyhowski (
1994) assumed that the researcher knows which
Xs are correlated with
but not
, which
Xs are correlated with
but not
, which
Xs are correlated with both
and
, and which
Xs are not correlated with both
and
In this paper, we only know which
Xs are not correlated with both effects. In particular, we consider the following model, where
represents cross-sectionally variant but time-invariant variables,
are time-variant but cross-sectionally invariant variables, and
is the
-th row of
X. As in the one-way
Hausman and Taylor (
1981) model, we split the regressors
X,
Z and
W into two sets of variables—
,
and
—where
is
is
is
is
,
is
is
with
,
,
and
.
,
and
are assumed to be exogenous in that they are not correlated with
,
and
, while
,
and
are endogenous because they are correlated with
or
, but not
The two-way fixed-effects (FE) model or Within transformation would sweep the intercepts
,
and
and remove the bias, but in the process, it would also sweep the
and
variables. Hence the two-way Within estimator will not give estimates of
,
or
. The two-way random-effects (RE) estimator assumes that the regressors are not correlated with the individual and time effects and applies a two-way random-effects GLS. A Hausman test based on the contrast between two-way FE and two-way RE determines whether two-way RE is efficient under the null hypothesis of no correlation between the regressors and the time and individual effects (see
Kang 1985). Instead of this idea of “
all” versus “
none” of the regressors being correlated with the individual and time effects, the two-way Hausman and Taylor (HT) estimator first proposed by
Wyhowski (
1994) allows some but not necessarily all of the regressors to be correlated with the individual and time effects. Assuming we only know which regressors are not correlated with both individual and time effects,
Baltagi (
2023b) proposed a modification of the
Wyhowski (
1994) estimator that uses fewer instruments and recovers the time-invariant as well as the individual-invariant variables which are important for policy studies. This is an instrumental-variables GLS estimator which can be implemented with a 2SLS or instrumental-variables regression after a two-way feasible GLS transformation due to
Fuller and Battese (
1974) (see the details in
Wyhowski (
1994) or
Baltagi (
2023b)). When both
and
and
is bounded,
Wyhowski (
1994) showed that the two-way Hausman–Taylor estimator is consistent. The two-way HT approach proposed by
Baltagi (
2023b) is summarized in the following Algorithm 1. A Hausman test based on two-way HT versus two-way FE determines whether the over-identification conditions are satisfied and, hence, whether the choice of exogenous
is rejected by the data (see
Baltagi 2023b).
Algorithm 1 Estimation of a two-way Hausman–Taylor model |
First step.
- (a)
with with and and , . - (b)
, with , . - (c)
, where and . - (c)
and - (e)
where , . - (f)
. - (g)
. - (h)
. - (i)
, , .
Second step.
- (a)
, and . - (b)
with . - (c)
Similarly, let , with . - (d)
and . - (e)
with . - (f)
and . - (g)
.
|
For the two-way Hausman and Taylor model considered in (
1), OLS is biased and inconsistent, while the two-way FE estimator which wipes out the intercept and the individual and time effects is consistent. The weakness of the fixed-effects estimator is that it also wipes out
and
, and therefore cannot estimate
and
The two-way RE estimator is biased and inconsistent under the correlated random-effects two-way model of Hausman and Taylor. The two-way HT estimator is efficient under this model. In this case, the two-way pretest estimator performs the Hausman test for two-way FE versus two-way RE proposed by
Kang (
1985) and selects the two-way RE if the null hypothesis is not rejected. It then selects the two-way HT if it passes a second Hausman test based on two-way FE versus two-way HT. If this is rejected, the pretest selects the two-way FE estimator.
2In empirical applications, the two tests should be used successively, as shown in
Figure 1. After calculating the TWFE (
), TWRE (
) and TWHT (
) estimators, the first test is the Hausman test defined by
, where
, and
is a subset of
. Under
(
none of the individual effects or time effects are correlated with the regressors),
, and one chooses the efficient estimator TWRE. If this test is rejected, we use the over-identification test (called the Hausman–Taylor test in
Figure 1) obtained by computing
, where
, with
representing a subset of
, and ⊖ is the symbol of the generalized inverse. Under
,
with
, and the efficient estimator TWHT is chosen. If the second test is rejected, the TWFE estimator is selected.
The pretest estimator may be written as
where
and
are indicator functions that take the values
and
if
in the first Hausman test falls within the interval 0 and
where
is the 5% critical value for the
statistics. This also means that
and
when
. Likewise,
and
are indicator functions that take the values
and
if
in the second Hausman–Taylor test falls within the interval 0 and
where
is the 5% critical value for the
statistics. This also means that
and
when
. It is clear from (
3) that the pretest estimator is a function of the data, the hypothesis and the significance level of the two Hausman tests. As (
3) is the sum of three parts, all three composed of products of non-independent random variables, and as underlined by
Judge et al. (
1978,
1988) and
Giles and Giles (
1993), to mention a few, the specification of the pretest estimator highlights the difficulty of deriving its sampling properties. And the choice of the significance level (here, 5%) of the
tests has a crucial role to play both in determining the proportion of use of each estimator and in determining the sampling performance of the pretest estimator.
3. Monte Carlo Results
Following
Baltagi et al. (
2003), we generalize the Monte Carlo design from the one-way to the two-way model:
where
,
,
.
is
(here,
.
is
(here,
.
and
are the time-invariant variables described below.
and
are the individual-invariant variables described below.
In our experiments, we set , , , and independent of each other. The total variance across experiments is fixed at The proportion of variance due to individual effects as well as the proportion of variance due to time effects is varied over the set (0.1, 0.2, 0.4, 0.6, 0.8) such that is always positive. We let , i.e., . Then, = , to which we add the particular case with . The values considered are , and . The number of replications is 1000.
The
variables are generated following
Nerlove (
1971). For these series, the ratios of the between-individual (Bxx), between-time (Cxx) and the within-individual–time (Wxx) variabilities relative to the total variability are roughly
,
and
.
Maddala and Mount (
1973, p. 326) warned that for the two-way model, Wxx has to be small with respect to Bxx and Cxx; otherwise, the random-effects GLS would be equivalent to the fixed effects model, and the errors in the estimation of the variance components would not be of much consequence for estimating the slope coefficients. The
variables are not correlated with
and
, and are generated as follows:
where
,
,
and
are uniform on
,
and
are uniform on
, and
and
are uniform on
.
We focus on the following two designs:
Case 1—A two-way Hausman–Taylor world, where
is correlated with
and
by design, and
is correlated with
as well as
Also,
is correlated with
as well as
.
In the above equations,
and
are uniform on
, and
is uniform on
.
is correlated with
by the common term
, with
by the common term
and with
by the common term
.
is correlated with
by the common term
, with
by the common term
and with
by the common term
.
Case 2—A two-way random-effects world, where
and
are not correlated with
and
, but are still correlated with
and
:
where
and
are uniform on
and where
is not correlated with
and
.
Table 1 shows the choice of the pretest estimator for various values of
in a Hausman–Taylor-type world when
and
. For example, when
, out of 1000 replications, the pretest estimator chose the RE estimator in 946 replications, the HT estimator in 24 replications and the FE estimator in 30 replications. For
, almost all replications chose the HT estimator. None selected RE, and between 9 and 14 replications selected FE. Note that as we vary
, not only does the proportion of the total variance due to the random individual and time effects vary, but so does the extent of correlation between the regressors and the individual and time effects. For example, when
, the mean correlation between
and
is 0.59. This rises to 0.84 when
In contrast, the mean correlation between
and
drops from 0.54 to 0.29 for these two cases. The mean correlation between
and
is 0.19 and 0.32, and the mean correlation between
and
is 0.34 and 0.23 for these two cases. We focus on the coefficients of the endogenous regressors
,
and
, i.e.,
,
and
. The results of the other coefficients are available upon request from the authors.
Table 1 reports the bias and RMSE (in %). When
, OLS performs well in terms of bias and RMSE for all coefficients. When
, HT, pretest and FE are the best in terms of RMSE for
, with HT and pretest performing the best for
and
.
Table 1 also reports the frequency of rejections in 1000 replications for
,
and
. This is assessed at the
significance level. Since the null hypothesis is always true, this represents the empirical size of the test. As expected, OLS performs badly, rejecting the null hypothesis when true in 99 to 100 percent of the cases, when
. The same is true for the RE estimator since endogeneity is present. On the other hand, HT performs well, giving a size close to the 5% level. FE performs well for
, but it cannot estimate
and
The pretest performs well, with a size between 5% and 6% for
and
and between 5% and 7% for
.
Table 2 shows the choice of the pretest estimator for various values of
in a random effects-type world when
and
. For example, when
out of 1000 replications, the pretest estimator is an RE estimator in 951 replications and an HT estimator in 49 replications. Now, there is no correlation between the regressors and the random individual and time effects.
Table 2 also reports the bias and RMSE (in %) for
and
. When
, RE and OLS perform the best in terms of RMSE for all coefficients. The pretest is a distant third, while HT and the fixed-effects model perform poorly. When
, in terms of RMSE, OLS performs poorly for all coefficients. RE is best, followed by the pretest and FE (only for
), and then, HT. For the frequency of rejections in 1000 replications for
,
and
in an RE world, OLS is the only estimator that performs badly, rejecting the null hypothesis when true in a large percentage of cases, especially when
are large. This is as large as 84% for
, 81% for
and 88% for
.
Table 3 and
Table 4 consider the two-way Hausman and Taylor world and two-way RE world for
and
, so that
, rather than 3 in the case of
Table 1 and
Table 2. Comparing
Table 3 and
Table 4 to
Table 1 and
Table 2, respectively,
T remains fixed at 100, while
N decreases from 300 to 200.
Table 5 and
Table 6 fix
N at 300 and double
T from 100 to 200. By and large, similar rankings in terms of RMSE occur as described in
Table 1 and
Table 2 but with different magnitudes.
As expected, holding
T fixed at 100 and increasing
N from 200 to 300, the RMSE of
decreases for both the HT and RE worlds. In
Table 3, the RMSE of the HT estimator of
is of the order
to
for
. This magnitude drops to the order
to
in
Table 1 as
N increases from 200 to 300, holding
T fixed at 100. This RMSE range drops even further to
in
Table 5 for
and
, i.e., increasing both
N and
T. A similar decline in RMSE occurs for
for the HT estimator. The RMSE range is
in
Table 1 (
,
), compared to
in
Table 3 (
,
) and
in
Table 5 (
,
).
Similarly, for the RE estimator, the RMSE range for
decreases from
in
Table 4 (for
,
) to
in
Table 2 (for
,
), and decreases further to
) in
Table 6 (for
,
). A similar decline in the RMSE happens for
for the RE estimator. The RMSE range is
in
Table 2 (
,
), compared to
in
Table 4 (
,
), and
in
Table 6 (
,
). For
, the RMSE performance improves as the
ratio declines. For the HT estimator, it is
for
Table 1 and drops to
for
Table 3 and
for
Table 5 . For the RE estimator, it is
for
Table 2 and drops to
for
Table 4 and
for
Table 6 .
3In summary, as in the one-way panel model, the OLS standard errors are biased and yield misleading inferences under both the two-way RE and HT worlds. RE, FE, HT and pretest yield the required 5% size under both designs for all values of . As expected, the RE estimator yields correct inference under a two-way RE world, but leads to misleading inference under a two-way HT world. In terms of bias, RMSE and inference, the pretest estimator is a viable alternative to two-way FE, RE and HT and should be considered in empirical panel applications.