The PANEL Procedure

Two-Way Random-Effects Model

The specification for the two-way random-effects model is

\[  u_{it}={\nu }_{i}+e_{t} + {\epsilon }_{it}  \]

As in the one-way random-effects model, the PANEL procedure provides four options for variance component estimators. Unlike the one-way random-effects model, unbalanced panels present some special concerns.

Let ${\mb{X} _{*}}$ and ${\mb{y} _{{\ast }}}$ be the independent and dependent variables arranged by time and by cross section within each time period. (Note that the input data set used by the PANEL procedure must be sorted by cross section and then by time within each cross section.) Let ${\mi{M} _{t}}$ be the number of cross sections observed in time ${t}$ and ${\sum _{t}\mi{M} _{t}=\mi{M} }$. Let ${\mb{D} _{t}}$ be the ${\mi{M} _{t}{\times } \mi{N} }$ matrix obtained from the ${\mi{N} {\times } \mi{N} }$ identity matrix from which rows that correspond to cross sections not observed at time ${t}$ have been omitted. Consider

\[  \mb{Z} =(\mb{Z} _{1}, \mb{Z} _{2})  \]

where ${\mb{Z} _{1}=( \mb{D} ^{'}_{1}, \mb{D} ^{'}_{2},\ldots .. \mb{D} ^{'}_{T})^{'} }$and ${\mb{Z} _{2}=\mr{diag}(\mb{D} _{1}\mb{j} _{N},\mb{D} _{2}\mb{j} _{N},\ldots \ldots \mb{D} _{T}\mb{j} _{N})}$.

The matrix $\mb{Z} $ gives the dummy variable structure for the two-way model.

For notational ease, let

\[  {\Delta }_{N}= \mb{Z} ^{'}_{1} \mb{Z} _{1}, {\Delta }_{T}= \mb{Z} ^{'}_{2}\mb{Z} _{2}, \mb{A} = \mb{Z} ^{'}_{2}\mb{Z} _{1}  \]
\[  \bar{\mb{Z}}=\mb{Z} _{2}-\mb{Z} _{1} {\Delta }^{-1}_{N}\mb{A} ^{'}  \]
\[  \bar{\Delta }_{1}=\mb{I} _{M}-\mb{Z} _{1} {\Delta }^{-1}_{N}\mb{Z} ^{'}_{1}  \]
\[  \bar{\Delta }_{2}=\mb{I} _{M}-\mb{Z} _{2} {\Delta }^{-1}_{T}\mb{Z} ^{'}_{2}  \]
\[  \mb{Q} ={\Delta }_{T}-\mb{A} {\Delta }^{-1}_{N} \mb{A} ^{'}  \]
\[  \mb{P} =(\mb{I} _{M}- \mb{Z} _{1} {\Delta }^{-1}_{N} \mb{Z} ^{'}_{1}) - \bar{\mb{Z}}\mb{Q}^{-1}\bar{\mb{Z}}^{'}  \]

Fuller and Battese’s Method

The Fuller and Battese method for estimating variance components can be obtained by setting VCOMP = FB (with the option RANTWO). FB is the default method for a RANTWO model with balanced panel. If RANTWO is requested without specifying the VCOMP= option, PROC PANEL proceeds under the Fuller and Battese method.

Following the discussion in Baltagi, Song, and Jung (2002), the Fuller and Battese method forms the estimates as follows.

The estimator of the error variance is

\[  \hat{{\sigma }}^{2}_{{\epsilon }}= \tilde{\mb{u} }^{'}\mb{P} \tilde{\mb{u} }/(\mi{M}-\mi{T}-\mi{N} +1-(\mi{K} -1))  \]

where $\mb{P} $ is the Wansbeek and Kapteyn within estimator for unbalanced (or balanced) panel in a two-way setting.

The estimator of the error variance is the same as that in the Wansbeek and Kapteyn method.

Consider the expected values

\begin{eqnarray*}  \emph{E} (q_{N}) & =&  {\sigma }^{2}_{{\epsilon }}\left[M - T - K + 1 \right] \\ & +&  {\sigma }^{2}_{{\nu }}\left[ M - T - \mr{tr}\left(\Strong{X}_{s}^{'}{\bar{\Delta }}_{2}\Strong{Z}_{1}\Strong{Z}_{1}^{'}{\bar{\Delta }}_{2}\Strong{X}_{s} \left(\Strong{X}_{s}^{'}{\bar{\Delta }}_{2}\Strong{X}_{s}\right)^{-1}\right)\right]\\ \emph{E} (q_{T}) & =&  {\sigma }^{2}_{{\epsilon }}\left[M - N - K + 1 \right] \\ & +&  {\sigma }^{2}_{e}\left[ M - N - \mr{tr}\left(\Strong{X}_{s}^{'}{\bar{\Delta }}_{1}\Strong{Z}_{2}\Strong{Z}_{2}^{'}{\bar{\Delta }}_{1}\Strong{X}_{s} \left(\Strong{X}_{s}^{'}{\bar{\Delta }}_{1}\Strong{X}_{s}\right)^{-1}\right)\right] \end{eqnarray*}

Just as in the one-way case, there is always the possibility that the (estimated) variance components will be negative. In such a case, the negative components are fixed to equal zero. After substituting the group sum of the within residuals for $(q_{N})$, the time sums of the within residuals for $(q_{T})$, and $\hat{{\sigma }}^{2}_{{\epsilon }}$, the two equations are solved for $\hat{{\sigma }}^{2}_{{\nu }}$ and $\hat{{\sigma }}^{2}_{e}$.

Wansbeek and Kapteyn’s Method

The Wansbeek and Kapteyn method for estimating variance components can be obtained by setting VCOMP = WK. The following methodology, outlined in Wansbeek and Kapteyn (1989) is used to handle both balanced and unbalanced data. The Wansbeek and Kapteyn method is the default for a RANTWO model with unbalanced panel. If RANTWO is requested without specifying the VCOMP= option, PROC PANEL proceeds under the Wansbeek and Kapteyn method if the panel is unbalanced.

The estimator of the error variance is

\[  \hat{{\sigma }}^{2}_{{\epsilon }}= \tilde{\mb{u} }^{'}\mb{P} \tilde{\mb{u} }/(\mi{M}-\mi{T}-\mi{N} +1-(\mi{K} -1))  \]

where the ${\tilde{\mb{u} }}$ are given by $\tilde{\mb{u}} =(\mb{I} _{M}-\mb{j} _{M} \mb{j} {’}_{M}/\mi{M} ) (\mb{y} _{\ast }-\mb{X} _{{\ast } s} ( \mb{X} {’}_{{\ast } s} \mb{PX} _{{\ast } s})^{-1} \mb{X} _{{\ast } s}{’}\mb{P} \mb{y} _{\ast })$ if there is an intercept and by ${\tilde{\mb{u} }=(\mb{y} _{{\ast }}-\mb{X} _{{\ast } s} ( \mb{X} {’}_{{\ast } s} \mb{PX} _{{\ast } s})^{-1} \mb{X} {’}_{{\ast } s}\mb{Py} _{{\ast }} }$ if there is not.

The estimation of the variance components is performed by using a quadratic unbiased estimation (QUE) method that involves computing on quadratic forms of the residuals ${\tilde{\mb{u} } }$, equating their expected values to the realized quadratic forms, and solving for the variance components.

Let

\[  q_{N}=\tilde{\mb{u} }^{'} \mb{Z_{2}} {\Delta }^{-1}_{T} \mb{Z} _{2}^{'}\tilde{\mb{u} } \]
\[ q_{T}=\tilde{\mb{u} }^{'}\mb{Z} _{1} {\Delta }^{-1}_{N}\mb{Z} _{1}^{'}\tilde{\mb{u} }  \]

The expected values are

\[ \mi{E} (q_{N})=(\mi{T} +k_{N}- (1+k_{0})){\sigma }^{2} + (\mi{T}- \frac{{\lambda }_{1}}{\mi{M} }) {\sigma }^{2}_{{\nu }} + (\mi{M}- \frac{{\lambda }_{2}}{\mi{M} }) {\sigma }^{2}_{e} \]
\begin{eqnarray*}  \emph{E} (q_{T}) & =&  (\emph{N} +k_{T}- (1+k_{0})){\sigma }^{2} \\ & +&  ( \emph{M}- \frac{{\lambda }_{1}}{\emph{M} }) {\sigma }^{2}_{{\nu }} + (\emph{N}- \frac{{\lambda }_{2}}{\emph{M} }) {\sigma }^{2}_{e} \end{eqnarray*}

where

\[  k_{0}= \mb{j} ^{'}_{M} \mb{X} _{{\ast } s}( \mb{X} ^{'}_{{\ast } s} \mb{PX} _{{\ast } s})^{-1} \mb{X} ^{'}_{{\ast } s} \mb{j} _{M} / \mi{M} \]
\[  k_{N}= \mr{tr}( ( \mb{X} ^{'}_{{\ast } s} \mb{PX} _{{\ast } s})^{-1} \mb{X} ^{'}_{{\ast } s} \mb{Z} _{2} {\Delta }^{-1}_{T} \mb{Z} _{2}^{'}\mb{X} _{{\ast } s} ) \]
\[  k_{T}= \mr{tr}( ( \mb{X} ^{'}_{{\ast } s} \mb{PX} _{{\ast } s})^{-1} \mb{X} ^{'}_{{\ast } s} \mb{Z} _{1} {\Delta }^{-1}_{N}\mb{Z} _{1}^{'} \mb{X} _{{\ast } s} ) \]
\[  {\lambda }_{1} = \mb{j} ^{'}_{M} \mb{Z} _{1} \mb{Z} ^{'}_{1} \mb{j} _{M} \]
\[  {\lambda }_{2}= \mb{j} ^{'}_{M} \mb{Z} _{2} \mb{Z} ^{'}_{2} \mb{j} _{M}  \]

The quadratic unbiased estimators for ${\sigma ^{2}_{\nu }}$ and ${\sigma }^{2}_{e}$ are obtained by equating the expected values to the quadratic forms and solving for the two unknowns.

When the NOINT option is specified, the variance component equations change slightly. In particular, the following is true (Wansbeek and Kapteyn, 1989):

\[ \mi{E} (q_{N})=(\mi{T} +k_{N}){\sigma }^{2} + \mi{T} {\sigma }^{2}_{{\nu }} + \mi{M} {\sigma }^{2}_{e} \]
\[ \mi{E} (q_{T})=(\mi{N} +k_{T}){\sigma }^{2} + \mi{M} {\sigma }^{2}_{{\nu }} + \mi{N} {\sigma }^{2}_{e} \]

Wallace and Hussain’s Method

The Wallace and Hussain method for estimating variance components can be obtained by setting VCOMP = WH. Wallace and Hussain’s method is by far the most computationally intensive. It uses the OLS residuals to estimate the variance components. In other words, the Wallace and Hussain method assumes that the following holds:

\[  {q}_{\epsilon } = \tilde{\mb{u}} _{OLS}^{'}\mb{P} \tilde{\mb{u}} _{OLS} \]
\[ {q}_{N} = \tilde{\mb{u}} _{OLS}^{'}\mb{Z} _{2}\Delta _{T}^{-1}\mb{Z} _{2}^{'}\tilde{\mb{u}} _{OLS} \]
\[  {q}_{T} = \tilde{\mb{u}} _{OLS}^{'}\mb{Z} _{1}\Delta _{N}^{-1}\mb{Z} _{1}^{'}\tilde{\mb{u}} _{OLS} \]

Taking expectations yields

\[  \mi{E} ({q}_{\epsilon }) = \mi{E} \left(\tilde{\mb{u}} _{OLS}^{'}\mb{P} \tilde{\mb{u}} _{OLS}\right) = \delta _{11}\sigma _{\epsilon }^{2}+\delta _{12}\sigma _{\nu }^{2}+\delta _{13}\sigma _{e}^{2} \]
\[  \mi{E} ({q}_{N}) = \mi{E} \left(\tilde{\mb{u}} _{OLS}^{'}\mb{Z} _{2}\Delta _{T}^{-1}\mb{Z} _{2}^{'}\tilde{\mb{u}} _{OLS}\right) = \delta _{21}\sigma _{\epsilon }^{2}+\delta _{22}\sigma _{\nu }^{2}+\delta _{23}\sigma _{e}^{2} \]
\[  \mi{E} ({q}_{T}) = \mi{E} \left(\tilde{\mb{u}} _{OLS}^{'}\mb{Z} _{1}\Delta _{N}^{-1}\mb{Z} _{1}^{'}\tilde{\mb{u}} _{OLS}\right) = \delta _{31}\sigma _{\epsilon }^{2}+\delta _{32}\sigma _{\nu }^{2}+\delta _{33}\sigma _{e}^{2} \]

where the $\delta _{js}$ constants are defined by

\[  \delta _{11} = M - N - T + 1 - \mr{tr}\left(\mb{X}^{'}\mb{P}\mb{X}\left(\mb{X}^{'}\mb{X}\right)^{-1}\right) \]
\[  \delta _{12} = \mr{tr}\left(\mb{X}^{'}\mb{Z}_{1}\mb{Z}_{1}^{'}\mb{X}\left(\mb{X}^{'}\mb{X}\right)^{-1} \left(\mb{X}^{'}\mb{P}\mb{X}\left(\mb{X}^{'}\mb{X}\right)^{-1}\right)\right) \]
\[  \delta _{13} = \mr{tr}\left(\mb{X}^{'}\mb{Z}_{2}\mb{Z}_{2}^{'}\mb{X}\left(\mb{X}^{'}\mb{X}\right)^{-1} \left(\mb{X}^{'}\mb{P}\mb{X}\left(\mb{X}^{'}\mb{X}\right)^{-1}\right)\right) \]
\[  \delta _{21} = T - \mr{tr}\left(\mb{X}^{'}\mb{Z}_{2}\Delta _{T}^{-1}\mb{Z}_{2}^{'}\mb{X}\left(\mb{X}^{'}\mb{X}\right)^{-1}\right) \]
\begin{eqnarray*}  \delta _{22} & =&  T - 2\mr{tr}\left(\Strong{X}^{'}\Strong{Z}_{2}\Delta _{T}^{-1}\Strong{Z}_{2}^{'}\Strong{Z}_{1}\Strong{Z}_{1}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\right) \\ & +&  \mr{tr}\left(\Strong{X}^{'}\Strong{Z}_{2}\Delta _{T}^{-1}\Strong{Z}_{2}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\Strong{X}^{'}\Strong{Z}_{1}\Strong{Z}_{1}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\right) \end{eqnarray*}
\begin{eqnarray*}  \delta _{23} & =&  T - 2\mr{tr}\left(\Strong{X}^{'}\Strong{Z}_{2}\Strong{Z}_{2}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\right) \\ & +&  \mr{tr}\left(\Strong{X}^{'}\Strong{Z}_{2}\Delta _{T}^{-1}\Strong{Z}_{2}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\Strong{X}^{'}\Strong{Z}_{2}\Strong{Z}_{2}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\right) \end{eqnarray*}
\[  \delta _{31} = N - \mr{tr}\left(\mb{X}^{'}\mb{Z}_{1}\Delta _{N}^{-1}\mb{Z}_{1}^{'}\mb{X}\left(\mb{X}^{'}\mb{X}\right)^{-1}\right) \]
\begin{eqnarray*}  \delta _{32} & =&  M - 2\mr{tr}\left(\Strong{X}^{'}\Strong{Z}_{1}\Strong{Z}_{1}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\right) \\ & +&  \mr{tr}\left(\Strong{X}^{'}\Strong{Z}_{1}\Delta _{N}^{-1}\Strong{Z}_{1}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\Strong{X}^{'}\Strong{Z}_{1}\Strong{Z}_{1}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\right) \end{eqnarray*}
\begin{eqnarray*}  \delta _{33} & =&  N - 2\mr{tr}\left(\Strong{X}^{'}\Strong{Z}_{1}\Delta _{N}^{-1}\Strong{Z}_{1}^{'}\Strong{Z}_{2}\Strong{Z}_{2}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\right) \\ & +&  \mr{tr}\left(\Strong{X}^{'}\Strong{Z}_{1}\Delta _{N}^{-1}\Strong{Z}_{1}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\Strong{X}^{'}\Strong{Z}_{2}\Strong{Z}_{2}^{'}\Strong{X}\left(\Strong{X}^{'}\Strong{X}\right)^{-1}\right) \end{eqnarray*}

The PANEL procedure solves this system for the estimates $\hat{\sigma }_{\epsilon }$, $\hat{\sigma }_{\nu }$, and $\hat{\sigma }_{e}$. Some of the estimated variance components can be negative. Negative components are set to zero and estimation proceeds.

Nerlove’s Method

The Nerlove method for estimating variance components can be obtained with by setting VCOMP = NL.

The estimator of the error variance is

\[  \hat{{\sigma }}^{2}_{{\epsilon }}= \tilde{\mb{u} }^{'}\mb{P} \tilde{\mb{u} }/\mi{M}  \]

The variance components for cross section and time effects are:

\[  { \hat{{\sigma }}^{2}_{{\nu }} } = \sum _\mi {i = 1} ^\mi {N} \frac{\left(\gamma _\mi {i}- \bar{\gamma }\right)^2}{\mi{N}- 1} \mbox{ where } \gamma _\mi {i} \mbox{ is the }i\text {th } \mbox{cross section effect} \]

and

\[  { \hat{{\sigma }}^{2}_{e} } = \sum _\mi {i = 1} ^\mi {T} \frac{\left(\alpha _\mi {t}- \bar{\alpha }\right)^2}{\mi{T}- 1} \mbox{ where } \alpha _\mi {i} \mbox{ is the }t\text {th } \mbox{time effect} \]

Transformation and Estimation

After you calculate the estimates of the variance components, you can proceed to the final estimation. If the panel is balanced, partial mean deviations are used:

\[  \tilde{y}_\mi {it} = y_\mi {it}- \theta _{1} \bar{y}_\mi {i \cdot } - \theta _{2} \bar{y}_\mi {\cdot t} + \theta _{3} \bar{y}_\mi {\cdot \cdot }  \]
\[  \tilde{x}_\mi {it} = x_\mi {it}- \theta _{1} \bar{x}_\mi {i \cdot } - \theta _{2} \bar{x}_\mi {\cdot t} + \theta _{3} \bar{x}_\mi {\cdot \cdot }  \]

The $\theta $ estimates are obtained from:

\[  \theta _{1} = 1 - \frac{\sigma _{\epsilon }}{\sqrt {T\sigma _{\nu }^{2} + \sigma _{\epsilon }^{2}}}  \]
\[  \theta _{2} = 1 - \frac{\sigma _{\epsilon }}{\sqrt {N\sigma _{e}^{2} + \sigma _{\epsilon }^{2}}}  \]
\[  \theta _{3} = \theta _{1} + \theta _{2} + \frac{\sigma _{\epsilon }}{\sqrt {T\sigma _{\nu }^{2} + N\sigma _{e}^{2} + \sigma _{\epsilon }^{2}}}- 1;  \]

With these partial deviations, PROC PANEL uses OLS on the transformed series (including an intercept if you want).

The case of an unbalanced panel is somewhat more complicated. You could naively substitute the variance components in the equation below:

\[  \Omega = {\sigma }^{2}_{{\epsilon }}\mb{I} _{M} + {\sigma }^{2}_{{\nu }}\mb{Z} _{1} \mb{Z} ^{'}_{1} + {\sigma }^{2}_{e}\mb{Z} _{2} \mb{Z} ^{'}_{2}  \]

After inverting the expression for $\Omega $, it is possible to do GLS on the data (even if the panel is unbalanced). However, the inversion of $\Omega $ is no small matter because the dimension is at least $\frac{M(M+1)}{2}$.

Wansbeek and Kapteyn show that the inverse of $\Omega $ can be written as

\[  \sigma _{\epsilon }^{2}\Omega ^{-1} = \mb{V}- \mb{V}\mb{Z}_2\tilde{\mb{P}}^{-1}\mb{Z}_2^{'}\mb{V}  \]

with the following:

\begin{eqnarray*}  \Strong{V} & =&  \Strong{I}_ M - \Strong{Z}_1\tilde{\Delta }_{N}^{-1}\Strong{Z}_1’ \\ \tilde{\Strong{P}} & =&  \tilde{\Delta }_{T}- \Strong{A}\tilde{\Delta }_{N}^{-1}\Strong{A}^{'} \\ \tilde{\Delta }_{N} & =&  \Delta _{N} + \left(\frac{\sigma _{\epsilon }^{2}}{\sigma _{\nu }^{2}}\right)\Strong{I}_{N} \\ \tilde{\Delta }_{T} & =&  \Delta _{T} + \left(\frac{\sigma _{\epsilon }^{2}}{\sigma _{e}^{2}}\right)\Strong{I}_{T} \end{eqnarray*}

Computationally, this is a much less intensive approach.

By using the inverse of the covariance matrix of the error, it becomes possible to complete GLS on the unbalanced panel.