A Pretest Estimator for the Two-Way Error Component Model

: For a panel data linear regression model with both individual and time effects, empirical studies select the two-way random-effects (TWRE) estimator if the Hausman test based on the contrast between the two-way fixed-effects (TWFE) estimator and the TWRE estimator is not rejected. Alternatively, they select the TWFE estimator in cases where this Hausman test rejects the null hypothesis. Not all the regressors may be correlated with these individual and time effects. The one-way Hausman-Taylor model has been generalized to the two-way error component model and allow some but not all regressors to be correlated with these individual and time effects. This paper proposes a pretest estimator for this two-way error component panel data regression model based on two Hausman tests. The first Hausman test is based upon the contrast between the TWFE and the TWRE estimators. The second Hausman test is based on the contrast between the two-way Hausman and Taylor (TWHT) estimator and the TWFE estimator. 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 the one-way pretest estimator to the two-way error component model.


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 randomeffects 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 fixedeffects 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 oneway 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).
Section 2 reviews the two-way Hausman and Taylor (1981) estimator first considered by Wyhowski (1994) and proposes a pretest estimator.Section 3 presents the Monte Carlo design, the results of the experiments and our conclusions.

The Two-Way Hausman and Taylor Estimator
Consider the two-way error component model: where y it is the it-th observation on the dependent variable, α denotes the constant, X ′ it represents 1 × k time-varying as well as individual-varying regressors, Z ′ i represents 1 × g time-invariant regressors, and and ν it ∼ I I N(0, σ 2 ν ) independent of each other and themselves.let n = NT denote the total number of observations.
In vector form, (1) can be written as where y ′ = (y 11, . . ., y 1T , y 21 , . . ., y 2T , . . ., y N1 , . . ., y NT ) ordered by i as the slow index and t as the fast index.ι NT is a vector of ones of dimension where ⊗ is the Kronecker product, I N is an identity matrix of dimension N, ι N a vector of ones of dimension N, µ ′ = (µ 1 , . . ., µ N ), λ ′ = (λ 1 , . . ., λ T ), and ν ′ = (ν 11, . . ., ν 1T , ν 21 , . . ., ν 2T , . . ., ν N1 , . . ., ν NT ).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 µ i and λ t .Wyhowski (1994) assumed that the researcher knows which Xs are correlated with µ i but not λ t , which Xs are correlated with λ t but not µ i , which Xs are correlated with both λ t and µ i , and which Xs are not correlated with both λ t and µ i .In this paper, we only know which Xs are not correlated with both effects.In particular, we consider the following model, where Z i represents cross-sectionally variant but time-invariant variables, W t are time-variant but cross-sectionally invariant variables, and X ′ it is the it-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 W 1 are assumed to be exogenous in that they are not correlated with µ i , λ t and ν it , while X 2 , Z 2 and W 2 are endogenous because they are correlated with µ i or λ t , but not ν it .The two-way fixed-effects (FE) model or Within transformation would sweep the intercepts α, µ i and λ t and remove the bias, but in the process, it would also sweep the Z i and W t 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 N → ∞ and T → ∞ and N/T 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 X 1 , Z 1 , W 1 is rejected by the data (see Baltagi 2023b).
Algorithm 1 Estimation of a two-way Hausman-Taylor model 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 Z ′ i s and W ′ t s, 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. 2 In empirical applications, the two tests should be used successively, as shown in Figure 1.After calculating the TWFE ( β w ), TWRE ( Θ f gls ) and TWHT ( Θ HT ) estimators, the first test is the Hausman test defined by H = q ′ var( β w ) − var( β f gls ) −1 q , where q = β f gls − β w , and β f gls is a subset of Θ f gls .Under H 0 (none of the individual effects or time effects are correlated with the regressors), H ∼ χ 2 k , 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 m = q ′ var( where q = β HT − β w , with β HT representing a subset of Θ HT , and ⊖ is the symbol of the generalized inverse.Under H 0 , m ∼ χ 2 l with l = 2k 1 − g 2 − h 2 , 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 Hausman test falls within the interval 0 and c 1 where c 1 is the 5% critical value for the χ 2 k statistics.This also means that I (0,c 1 ) ( H) = 0 and the second Hausman-Taylor test falls within the interval 0 and c 2 where c 2 is the 5% critical value for the χ 2 l statistics.This also means that I (0,c 2 ) ( m) = 0 and 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. (1978Judge et al. ( , 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 χ 2 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.

Monte Carlo Results
Following Baltagi et al. (2003), we generalize the Monte Carlo design from the one-way to the two-way model: where here, g 2 = 1).Z 1i and Z 2i are the time-invariant variables described below.W 1t and W 2t are the individual-invariant variables described below.
The X 1 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 71%, 23% and 6%.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 X 1,it variables are not correlated with µ i and λ t , and are generated as follows: where φ i , ϑ it , ϕ t and τ t are uniform on [−4, 4], ζ it and ξ it are uniform on [−2, 2], and Z 1i and W 1t are uniform on [−3, 3].We focus on the following two designs: Case 1-A two-way Hausman-Taylor world, where X 2 is correlated with µ i and λ t by design, and Z 2i is correlated with µ i as well as X 11,it , X 12,it , X 2,it .Also, W 2t is correlated with λ t as well as X 11,it , X 12,it , X 2,it .
In the above equations, χ i and ψ t are uniform on [−4, 4], and ϑ it is uniform on [−2, 2].Z 2i is correlated with X 11,it by the common term φ i , with X 12,i,t by the common term ϑ i and with X 2,it by the common term µ i .W 2t is correlated with X 11,it by the common term ϕ t , with X 12,i,t by the common term τ t and with X 2,it by the common term λ t .Case 2-A two-way random-effects world, where Z 2i and W 2t are not correlated with µ i and λ t , but are still correlated with X 11,it and X 12,it : where κ i and ϱ t are uniform on [−4, 4] and where X 2,it is not correlated with µ i and λ t .
Table 1 shows the choice of the pretest estimator for various values of (ρ 1 , ρ 2 ) in a Hausman-Taylor-type world when N = 300 and T = 100.For example, when (ρ 1 , ρ 2 ) = (0, 0), 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 (ρ 1 , ρ 2 ) ̸ = (0, 0), almost all replications chose the HT estimator.None selected RE, and between 9 and 14 replications selected FE.Note that as we vary (ρ 1 , ρ 2 ), 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 (ρ 1 , ρ 2 ) = (0.2, 0.7), the mean correlation between X 2,it and µ i is 0.59.This rises to 0.84 when (ρ 1 , ρ 2 ) = (0.6, 0.3).In contrast, the mean correlation between X 2,it and λ t drops from 0.54 to 0.29 for these two cases.The mean correlation between Z 2i and µ i is 0.19 and 0.32, and the mean correlation between W 2t and λ t is 0.34 and 0.23 for these two cases.We focus on the coefficients of the endogenous regressors X 2 , Z 2 and W 2 , i.e., β 2 , γ 2 and δ 2 .The results of the other coefficients are available upon request from the authors.Table 1 reports the bias and RMSE (in %).When (ρ 1 , ρ 2 ) = (0, 0), OLS performs well in terms of bias and RMSE for all coefficients.When (ρ 1 , ρ 2 ) ̸ = (0, 0), HT, pretest and FE are the best in terms of RMSE for β 2 , with HT and pretest performing the best for γ 2 and δ 2 .Table 1 also reports the frequency of rejections in 1000 replications for β 2 = 1, γ 2 = 1 and δ 2 = 1.This is assessed at the 5% 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 (ρ 1 , ρ 2 ) ̸ = (0, 0).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 β 2 , but it cannot estimate γ 2 and δ 2 .The pretest performs well, with a size between 5% and 6% for β 2 and γ 2 and between 5% and 7% for δ 2 .
Table 2 shows the choice of the pretest estimator for various values of (ρ 1 , ρ 2 ) in a random effects-type world when N = 300 and T = 100.For example, when (ρ 1 , ρ 2 ) = (0.4,0.5) 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 β 2 , γ 2 and δ 2 .When (ρ 1 , ρ 2 ) = (0, 0), 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 (ρ 1 , ρ 2 ) ̸ = (0, 0), in terms of RMSE, OLS performs poorly for all coefficients.RE is best, followed by the pretest and FE (only for β 2 ), and then, HT.For the frequency of rejections in 1000 replications for β 2 = 1, γ 2 = 1 and δ 2 = 1 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 (ρ 1 ρ 2 ) are large.This is as large as 84% for β 2 , 81% for γ 2 and 88% for δ 2 .
Tables 3 and 4 consider the two-way Hausman and Taylor world and two-way RE world for N = 200 and T = 100, so that N/T = 2, rather than 3 in the case of Tables 1 and 2. Comparing Tables 3 and 4 to Tables 1 and 2, respectively, T remains fixed at 100, while N decreases from 300 to 200.Tables 5 and 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 Tables 1 and 2 but with different magnitudes.
As expected, holding T fixed at 100 and increasing N from 200 to 300, the RMSE of β 2 decreases for both the HT and RE worlds.In Table 3, the RMSE of the HT estimator of β 2 is of the order 0.296 to 0.300 for (ρ 1 , ρ 2 ) ̸ = (0, 0).This magnitude drops to the order 0.234 to 0.235 in Table 1 as N increases from 200 to 300, holding T fixed at 100.This RMSE range drops even further to (0.171, 0.172) in Table 5 for N = 300 and T = 200, i.e., increasing both N and T. A similar decline in RMSE occurs for γ 2 for the HT estimator.The RMSE range is (1.037, 2.817) in Table 1 (N = 300, T = 100), compared to (1.272, 3.414) in Table 3 (N = 200, T = 100) and (1.004, 2.792) in Table 5 (N = 300, T = 200).Similarly, for the RE estimator, the RMSE range for β 2 decreases from (0.277, 0.290) in Table 4 (for N = 200, T = 100) to (0.219, 0.227) in Table 2 (for N = 300, T = 100), and decreases further to (0.165, 0.168) in Table 6 (for N = 300, T = 200).A similar decline in the RMSE happens for γ 2 for the RE estimator.The RMSE range is (0.834, 2.279) in Table 2 (N = 300, T = 100), compared to (0.983, 2.669) in Table 4 (N = 200, T = 100), and (0.824, 2.297) in Table 6 (N = 300, T = 200).For δ 2 , the RMSE performance improves as the N/T ratio declines.For the HT estimator, it is (2.053, 5.819) for Table 1 (N/T = 3) and drops to (2.025, 5.680) for Table 3 (N/T = 2) and (1.386, 3.918) for Table 5 (N/T = 1.5).For the RE estimator, it is (1.426, 4.019) for Table 2 (N/T = 3) and drops to (1.405, 3.935) for Table 4 (N/T = 2) and (0.976, 2.749) for Table 6 (N/T = 1.5). 3  In 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 (ρ 1 , ρ 2 ).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.