1. INTRODUCTION
Spatial models deal with correlation across spatial units, usually in a cross-section setting. However, Anselin (1988) also considered spatial panel data models that allow for random effects across these units. See also Baltagi, Song, and Koh (2003) and Kapoor, Kelejian, and Prucha (2005) for two recent studies on testing and estimation in these models and Case (1991) and Holtz-Eakin (1994) for two empirical applications. This note focuses on a panel data regression model with spatial autoregressive disturbances and random effects where the weight matrix is normalized and has equal elements. This is motivated by Kelejian and Prucha (2002) and Kelejian, Prucha, and Yuzefovich (2005), who use this weight matrix in the context of a spatially lagged dependent variable model. Kelejian et al. (2005) argue that such a weighting matrix having blocks of equal elements might be considered when units are equally distant within certain neighborhoods but unrelated between neighborhoods. Section 2 introduces a panel regression model with spatial autoregressive (SAR) disturbances and random effects. We show that for the equal weight matrix case, one can derive a simple weighted least squares transformation that obtains generalized least squares (GLS) on this model as a simple ordinary least squares (OLS). For the special case of a spatial panel model with no random effects, we obtain two sufficient conditions where GLS on this model is equivalent to OLS. Section 3 extends these results to other types of spatial error specifications, including the spatial moving average (SMA) and spatial error components (SEC) cases and also an alternative panel data regression model with spatially correlated error components suggested by Kapoor et al. (2005).
2. THE MODEL
Consider the following panel data regression model:

where yti is the observation on the ith region for the tth time period, Xti denotes the k × 1 vector of observations on the nonstochastic regressors and uti is the regression disturbance. Here α is a scalar and β is a k × 1 vector of slope parameters. In vector form, the disturbance vector of (1) is assumed to have random region effects and SAR remainder disturbances:

with

where ut′ = (ut1,…,utN) and εt and νt are similarly defined. Here μ′ = (μ1,μ2,…, μN) denote the vector of random region effects, which are assumed to be iid(0,σμ2), λ is the scalar SAR coefficient with |λ| < 1, whereas νti ∼ iid(0,σν2). We assume that μ and ν are independent. The term WN is an N × N weighting matrix with zero elements across the diagonal and equal elements (1/(N − 1)) off the diagonal. In other words, the disturbance for each unit is related to an average of the (N − 1) disturbances of the remaining units. Such a weighting matrix was recently considered by Kelejian and Prucha (2002), Lee (2002), and Kelejian et al. (2005) and would naturally arise if all units are neighbors to each other and there is no other reasonable or observable measure of distance between them. Kelejian and Prucha (2002) consider the case of a spatially lagged dependent variable model with a row normalized weighting matrix with equal elements. They show that OLS and two-stage least squares (2SLS) are inconsistent unless panel data are available. Kelejian et al. (2005) give exact small-sample results that corroborate the earlier asymptotic findings. In addition, they demonstrate that for the spatial panel data case with fixed effects across time, OLS and 2SLS are both inconsistent. Lee (2002), on the other hand, shows that OLS can be consistent in an economic spatial environment where each unit can be influenced aggregately by a significant portion of units in the population.
One can rewrite (3) as

where BN = IN − λWN. The model (1) can be rewritten in matrix notation as

where y is of dimension NT × 1, ιNT is a vector of ones of dimension NT, X is NT × k, u is NT × 1, and Z = (ιNT,X). Here X is assumed to be of full column rank, and its elements are assumed to be bounded in absolute value. The disturbance term can be written in vector form as

where ν′ = (ν1′,ν2′,…, νT′) and u is similarly defined, ιT is a vector of ones of dimension T and IT is an identity matrix of dimension T, and [otimes ] denotes the Kronecker product. Under these assumptions, the variance-covariance matrix of u can be written as

Kelejian and Prucha (2002) showed that WN can be written as

where JN is a matrix of ones and IN is an identity matrix, both of dimension N. Defining JN = JN /N and EN = IN − JN, and replacing JN and IN by their equivalent terms NJN and (EN + JN) and collecting like terms (see Wansbeek and Kapteyn, 1982), one gets

with

Therefore

Note that WN is symmetric and

where c1 = (N − 1)2/(N − 1 + λ)2 and c2 = 1/(1 − λ)2.
Replacing JT and IT by their equivalent terms TJT and (ET + JT) in (7), one gets

Collecting like terms, we obtain the spectral decomposition of Ω,

Hence

and
Note that if λ = 0, so that there is no spatial autocorrelation, then c1 = c2 = 1 and Ω in (13) reduces to the familiar variance-covariance matrix of the random effects panel data model given by Ω = (Tσμ2 + σν2)(JT [otimes ] IN) + σν2(ET [otimes ] IN) (see Baltagi, 2005). Premultiplying the regression model in (5) by

from (15), one gets a similar transformation to the one suggested by Fuller and Battese (1973) for the random effects panel data model. In fact

will have typical elements yti* = (yti − θ1 yt. − θ2 y.i + θ3 y..) where yt. denotes the sample average over regions, y.i denotes the sample average over time, and y.. denotes the average over the entire sample. The θ's can be easily obtained from the corresponding (c1,c2,σμ2,σν2) parameters. For example, θ1 is the coefficient corresponding to (IT [otimes ] JN), which can be verified to be

, θ2 is the coefficient corresponding to (JT [otimes ] IN), which can be verified to be

, and θ3 is the coefficient corresponding to (JT [otimes ] JN), which can be verified to be

. If λ = 0, then

, which reduces yti* to (yti − θ2 y.i). This is the familiar Fuller and Battese (1973) random effects transformation that allows us to obtain GLS as weighted least squares.
If σμ2 = 0, i.e., the case of no random effects, the variance-covariance matrix in (7) reduces to

which from (11) reduces to

Hence

and

so that the typical element of

is yti* = (yti − θ1 yt.) where

. Note that as

.
A special case of this model is the cross-section spatial regression model with (T = 1) and equal weight matrix given by (8). In this case, one can show that OLS is equivalent to GLS as long as there is a constant in the regression. To prove this, note that the model in (5) becomes

where ZN = (ιN, XN) and γ = (α,β)′. Here yN is a vector of observations on the dependent variable and ιN is a vector of ones, both of dimension N, and XN is an N × K matrix of observations on the K explanatory variables. The disturbance vector is assumed to follow a spatial autoregressive process

where WN is an N × N equal weighting matrix given in (8). In fact, one can prove that the Zyskind (1967) necessary and sufficient condition for OLS to be equivalent to GLS on (20) is satisfied. This calls for PZΣ = ΣPZ, where Z = ZN = (ιN, XN) is the matrix of regressors in (20) and Σ = E(uNuN′) = σν2Ω is the variance-covariance matrix of the disturbances given in (21). It is straightforward to show that Ω = c1 EN + c2 JN and

because PZιN = ιN, PZ JN = JN, and PZ EN = PZ − JN. Similarly,

Hence, PZΩ = ΩPZ.
In fact, another necessary and sufficient condition for OLS to be equivalent to GLS, which relies on Ω−1, is given by Milliken and Albohali (1984), and this condition calls for Z′Ω−1(IN − PZ) = 0. Here

and using the fact that JN(IN − PZ) = 0, we get

Hence

because Z′PZ = Z′. Note that

and this, in general, is not equal to the usual formula for

computed by regression packages, i.e., σν2(Z′Z)−1, unless λ = 0, which is the case of no spatial correlation.
For the spatial panel regression with equal weights, this result is not necessarily true as long as σμ2 > 0. Two special cases where OLS on (5) is the same as GLS, i.e.,

, are the following: (i) the trivial case where σμ2 = 0 and λ = 0 (in fact, when λ = 0, c1 = c2 = 1, θ1 = 0, and yti* = yti and GLS reduces to OLS); also, (ii) when the matrix of regressors X is invariant across time, i.e., when X = ιT [otimes ] XN, with XN being the N × k matrix of exogenous regressors that is invariant across time. To show this, we prove that the Zyskind (1967) necessary and sufficient condition for OLS to be equivalent to GLS on (5) is satisfied. This calls for PZΩ = ΩPZ, where Z = ιT [otimes ] ZN = ιT [otimes ] (ιN, XN) is the matrix of regressors in (5) and Ω is the variance-covariance matrix of the disturbances given in (17). It is straightforward to show that PZ = JT [otimes ] PZN and that PZNιN = ιN, PZN JN = JN, and PZN EN = PZN − JN. Hence

Similarly,

Hence, PZΩ = ΩPZ.
In fact, another necessary and sufficient condition for OLS to be equivalent to GLS, which relies on Ω−1, is given by Milliken and Albohali (1984), and this condition calls for Z′Ω−1(ITN − PZ) = 0. Using (18), and the fact that JN(IN − PZN) = 0, we get
Hence
because ιT′JT = ιT′ and ZN′PZN = ZN′.
An anonymous referee pointed out that an alternative derivation of these results can be obtained using Lemma 2.1 of Magnus (1982). This lemma was derived in the context of a multivariate error component model, but when applied to the model considered in this paper, one common theme is the following: if WN = α1 AN + α2(IN − AN) with α1 ≠ α2, and AN is a symmetric idempotent matrix, then all powers of WN (also negative powers), its eigenvalues, and determinant can all be easily calculated. Here, we have IN − λWN = β1 AN + β2(IN − AN), with β1 = 1 − λα1 and β2 = 1 − λα2. Assuming that λα1 ≠ 1 and λα2 ≠ 1, we get (IN − λWN)−1 = (1/β1)AN + (1/β2)(IN − AN). Hence Ω = (IN − λWN)−2 = (1/β12)AN + (1/β22)(IN − AN). Applying the Milliken and Albohali (1984) necessary and sufficient condition that calls for Z′Ω−1(IN − PZ) = 0, we get Z′Ω−1(IN − PZ) = (β12 − β22)Z′AN(IN − PZ) = 0, which is [hArr ] Z′AN(IN − PZ) = 0. In the special case where AN = JN, we see that OLS is equivalent to GLS if and only if Z′ιN = 0 or (IN − PZ)ιN = 0, i.e., if and only if the regressors are measured in deviations from the mean or the regression contains a constant.
3. EXTENSIONS
So far, we have considered the spatial autoregressive (SAR) specification for the disturbances. An alternative specification is the spatial moving average (SMA) specification. Anselin (2003) classifies the spatial covariance structure induced by SAR as global and that by SMA as local. In this case, the model given by (1) and (2) is the same, but the disturbances in (3) become

In vector form, the panel disturbances in (6) become

with variance covariance matrix

because WN given by (9) is symmetric. In fact,

where d1 = (N − 1 − λ)2/(N − 1)2 and d2 = (1 + λ)2.
Replacing JT and IT by their equivalent terms TJT and (ET + JT) in (34), and collecting like terms, we obtain

Hence, we get the same results for the SMA specification as for the SAR specification when the weight matrix is equal. The only difference between (36) and (13) is d1 and d2 rather than c1 and c2. Similarly, Ω−1 and Ω−1/2 are the same as (14) and (15) with d1 and d2 replacing c1 and c2. The same holds true for the Fuller and Battese type transformation described following (15). Note that if λ = 0, so that there is no spatial autocorrelation, then d1 = d2 = 1 and Ω in (36) reduces to the familiar variance-covariance matrix of the random effects panel data model. If σμ2 = 0, i.e., the case of no random effects, the variance-covariance matrix in (34) reduces to

Hence, Ω−1 and Ω−1/2 are the same as in (18) and (19) with d1 and d2 replacing c1 and c2. The Fuller and Battese transformation given following (19) is now

with typical element yti* = (yti − θ1 yt.) where

. Note that as

.
Kelejian and Robinson (1995) considered an alternative spatial error components (SEC) specification that differs from the SAR and SMA specifications. In this case, the model given by (1) and (2) is the same, but the disturbances in (3) become

where ψt is an (N × 1) vector of spillover error components. The two component vectors ψt and νt are assumed to consist of independent and identically distributed (i.i.d.) terms with respective variances σψ2 and σν2 and are uncorrelated. In vector form, the panel disturbances in (6) become

with variance-covariance matrix

because WN given by (9) is symmetric. In fact,

where b1 = (σν2 + (λ2σψ2/(N − 1)2)) and b2 = (σν2 + λ2σψ2). The rest of the derivations are the same as before with b1 and b2 replacing c1 and c2. Note that as

.
For the cross-section (T = 1) spatial regression model with SMA or SEC disturbances and an equal weight matrix, one can easily show that OLS is equivalent to GLS as long as there is a constant in the model; the proof is left to the reader. For the spatial panel regression with equal weights, this result is not necessarily true as long as σμ2 > 0. Two cases where OLS is the same as GLS are once again (i) the trivial case where σμ2 = 0 and λ = 0 or (ii) when the matrix of regressors X is invariant across time. The proofs for the SMA and SEC cases are the same as that for the SAR case and are left for the reader. The key for these results is the fact that (11) for SAR, (35) for SMA, and (41) for SEC are all linear combinations of EN and JN. These matrices are idempotent, are orthogonal to each other, and sum to IN. Alternatively, one can apply Lemma 2.1 of Magnus (1982) to obtain the same results.
Next, we consider an alternative panel data model with spatially correlated error components suggested by Kapoor et al. (2005). The regression model is the same as (1), but the SEC structure given by (2) and (3) becomes

with

where μ and ν are the same as before, i.e., iid(0,σμ2) and iid(0,σν2) independent of each other and among themselves. Performing the spatial Cochrane–Orcutt type transformation on (5) one gets

with

and y*(λ), X*(λ), and Z*(λ) defined similarly. The variance-covariance matrix Ωε = E(εε′) = (Tσμ2 + σν2)(JT [otimes ] IN) + σν2(ET [otimes ] IN) is the usual panel data error components random effects variance-covariance matrix. GLS on (44) can be obtained as OLS on the Fuller–Battese transformed equation (44), i.e., after premultiplying it by σνΩε−1/2 = (ET [otimes ] IN) + (σν /σ1)(JT [otimes ] IN), where

. In this case,

For the equal weight matrix given in (8), (IN − λWN) is given following (9) and can be rewritten as (IN − λWN) = a1 EN + a2 JN, where a1 = (N − 1 + λ)/(N − 1) and a2 = (1 − λ). Substituting this expression in (46) yields
Once again, we see that for the Kapoor et al. (2005) specification, with an equal weight matrix, GLS on (44) can be written as a weighted combination similar to that following (15), i.e., yti** = a1(yti − θ1 yt. − θ2 y.i + θ3 y..) where yt. denotes the sample average over regions, y.i denotes the sample average over time, and y.. denotes the average over the entire sample. The θ's can be easily obtained from the corresponding (a1,a2,σμ,σν) parameters. For example, θ1 is the coefficient corresponding to (IT [otimes ] JN), which can be verified to be (1 − (a2 /a1)), θ2 is the coefficient corresponding to (JT [otimes ] IN), which can be verified to be (1 − (σν /σ1)), and θ3 is the coefficient corresponding to (JT [otimes ] JN), which can be verified to be (1 − (a2 /a1) − (σν /σ1) + (a2σν /a1σ1)). If λ = 0, a1 = a2 = 1, then θ1 = θ3 = 0 and θ2 = (1 − (σν /σ1)), which reduces yti** to (yti − θ2 y.i). This is the familiar Fuller and Battese (1973) random effects transformation.
If σμ2 = 0, i.e., the case of no random effects, then σν = σ1, θ2 = θ3 = 0, and θ1 = (1 − (a2 /a1)), which reduces yti** to a1(yti − θ1 yt.). In fact, y**(λ) from (47) reduces to

Note that a1θ1 = (a1 − a2). Therefore, yti** is a weighted combination of yti and yt.. For this model, OLS is the same as GLS for the trivial case where σμ2 = 0 and λ = 0. The more interesting case where OLS on (44) is equivalent to GLS is the case where the matrix of regressors X is invariant across time. The proof is along the same lines as before and is left for the reader. In fact, one can easily show that when X = ιT [otimes ] XN, with XN being the N × k matrix of exogenous regressors that is invariant across time, both the Zyskind (1967) and the Milliken and Albohali (1984) necessary and sufficient conditions are satisfied for this model.
4. CONCLUSION
For spatial panel models with a weight matrix that is row normalized and has equal weights within a block but otherwise uncorrelated across blocks, we showed that GLS can be obtained as a simple weighted least squares transformation involving the means of the observations over time and over units. This is similar to the Fuller and Battese (1973) transformation for the random effects model in panel data with no spatial correlation. In addition, we showed that OLS is equivalent to GLS if there are no random or spatial effects or if the regressors vary across units but are invariant over time. We also showed that these results for the equal weight matrix hold whether we use the SAR specification, the SMA specification, the SEC specification, or the alternative panel data regression model with spatially correlated error components suggested by Kapoor et al. (2005).