The PANEL Procedure

Unbalanced Panels

Let ${\mb {X} _{*}}$ and ${\mb {y} _{*}}$ 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 year ${t}$ and let ${\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.

Let

\begin{align*}  {\bDelta }_{N}& = \mb {Z} ^{}_{1}\mb {Z} _{1}\\ {\bDelta }_{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} ^{}\\ \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}}^{} \end{align*}

The estimate of the regression slope coefficients is given by

\[  \tilde{{\beta }}_{s}= ( \mb {X} ^{}_{{\ast } s}\mb {PX} _{{\ast }s})^{-1} \mb {X} ^{}_{{\ast } s}\mb {Py} _{{\ast }}  \]

where ${\mb {X} _{{\ast } s}}$ is the ${\mb {X} _{{\ast }}}$ matrix without the vector of 1s.

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 residuals are given by ${\tilde{\mb {u} }=(\mb {I} _{M}-\mb {j} _{M} \mb {j} ^{}_{M}/ \mi {M} ) (\mb {y} _{{\ast }}-\mb {X} _{{\ast } s} \tilde{{\beta }}_{s}) }$ if there is an intercept in the model and by ${\tilde{\mb {u} }=\mb {y} _{{\ast }}-\mb {X} _{{\ast } s} \tilde{{\beta }}_{s} }$ if there is no intercept.

The actual implementation is quite different from the theory. The PANEL procedure transforms all series using the $\mb {P}$ matrix.

\[  \mb {\bar{v}}=\mb {P}\mb {v}  \]

The variable being transformed is $\mi {v} $, which could be $\mi {\mb {y}}$ or any column of $\mi {\mb {X}}$. After the data are properly transformed, OLS is run on the resulting series.

Given $\tilde{\beta }_{s}$, the next step is estimating the cross-sectional and time effects. Given that ${\bgamma }$ is the column vector of cross-sectional effects and ${\balpha }$ is the column vector of time effects,

\[  \tilde{{\balpha }} = \mb {Q} ^{-1}\bar{\mb {Z}} ^{}\mi {y} - \mb {Q} ^{-1}\bar{\mb {Z}}^{}\mb {X} _\mi {s} \tilde{\beta }_{s}  \]
\[  \tilde{{\bgamma }} = (\Theta _{1} + \Theta _{2}- \Theta _{3})\mi {y} -(\Theta _{1} + \Theta _{2}- \Theta _{3})\mb {X} _\mi {s} \tilde{\beta }_{s}  \]
\[  \Theta _{1} = \Delta _{N}^{-1}\mb {Z} ^{}_{1}  \]
\[  \Theta _{2} = \Delta _{N}^{-1}\mb {A} ^{}Q^{-1}\mb {Z} _{2}^{}  \]
\[  \Theta _{3} = \Delta _{N}^{-1}\mb {A} ^{}Q^{-1}\mb {A} \Delta _{N}^{-1}\mb {Z} _{1}^{}  \]

Given the cross-sectional and time effects, the next step is to derive the associated dummy variables. Using the NOINT option, the following equations give the dummy variables:

\[  D_ i^{C} = \hat{\gamma }_{i} + \hat{\alpha }_{T}  \]
\[  D_ t^{T} = \hat{\alpha }_{t}- \hat{\alpha }_{T}  \]

When an intercept is desired, the equations for dummy variables and intercept are:

\[  D_ i^{C} = \hat{\gamma }_{i}- \hat{\gamma }_{N}  \]
\[  D_ t^{T} = \hat{\alpha }_{t}- \hat{\alpha }_{T}  \]
\[  \mr {Intercept }= \hat{\gamma }_{N} + \hat{\alpha }_{T}  \]

The calculation of the covariance matrix is as follows:

\begin{eqnarray*}  \mr {Var}\left[\hat{\bgamma } \right] & =& \hat{\sigma }_{\epsilon }^{2}\left( \Delta _\emph {N} ^{-1}- {\Sigma }_{1} + {\Sigma }_{2} \right) \\ & +& (\Theta _{1} + \Theta _{2}- \Theta _{3}) \mr {Var}\left[{\tilde{\beta }}_{s}\right] (\Theta _{1} + \Theta _{2}- \Theta _{3})^{} \end{eqnarray*}

where

\[  \Sigma _{1} = \Delta _{N}^{-1}\mb {A} ^{}\mb {Q} ^{-1}\mb {A} \Delta _{N}^{-1}\mb {A} ^{}\mb {Q} ^{-1}\mb {A} \Delta _{N}^{-1}  \]
\[  \Sigma _{2} = \Delta _{N}^{-1}\mb {A} ^{}\mb {Q} ^{-1}\Delta _{T}\mb {Q} ^{-1}\mb {A} \Delta _{N}  \]
\[  \mr {Var}\left[\hat{{\balpha }} \right] = \hat{\sigma }_{\epsilon }^{2}\left(\mb {Q} ^{-1}\bar{\mb {Z}} ^{}\bar{\mb {Z}} \mb {Q} ^{-1}\right) + \left(\mb {Q} ^{-1}\bar{\mb {Z}} ^{}\mb {X} _\mi {s} \right)\mr {Var}\left[{\tilde{\beta }}_{s}\right] \left(\mb {X} _\mi {s} ^{}\bar{\mb {Z}} \mb {Q} ^{-1}\right) \]
\begin{eqnarray*}  \mr {Cov}\left[\hat{\balpha }, \hat{\bgamma }^{}\right] & =&  \hat{\sigma }_{\epsilon }^{2}{\Delta }_{N}^{-1} \left[\Strong{A} ^{}\Strong{Q} ^{-1}{\Delta }_{T}- \Strong{A} ^{}\Strong{Q} ^{-1}\Strong{A} {\Delta }_{N}^{-1}\Strong{A} ^{}\right]\Strong{Q} ^{-1} \\ & +& (\Theta _{1} + \Theta _{2}- \Theta _{3}) \mr {Var}\left[{\tilde{\beta }}_{s}\right] \left(\Strong{X} _\mi {s} ^{}\bar{\mb {Z}} \mb {Q} ^{-1}\right) \end{eqnarray*}
\[  \mr {Cov}\left[\hat{\bgamma },\tilde{\beta } \right] = (\Theta _{1} + \Theta _{2}- \Theta _{3}) \mr {Var}\left[{\tilde{\beta }}_{s}\right]  \]
\[  \mr {Cov}\left[\hat{\balpha },\tilde{\beta } \right] = \left(\mb {Q} ^{-1}\bar{\mb {Z}} ^{}\mb {X} _\mi {s} \right)\mr {Var}\left[{\tilde{\beta }}_{s}\right]  \]

Now you work out the variance covariance estimates for the dummy variables.

Variance Covariance of Dummy Variables with No Intercept

The variances and covariances of the dummy variables are given under the NOINT selection as follows:

\begin{align*}  \mr {Cov}\left(D_\mi {i} ^{C},D_\mi {j} ^{C}\right) & = \mr {Cov}\left(\hat{\gamma }_{i},\hat{\gamma }_{j} \right) + \mr {Cov}\left(\hat{\gamma }_{i},\hat{\alpha }_{T} \right) + \mr {Cov}\left(\hat{\gamma }_{j},\hat{\alpha }_{T} \right) + \mr {Var}\left(\hat{\alpha }_{T}\right)\\ \mr {Cov}\left(D_\mi {t} ^{T},D_\mi {u} ^{T}\right) & = \mr {Cov}\left(\hat{\alpha }_{t},\hat{\alpha }_{u} \right) - \mr {Cov}\left(\hat{\alpha }_{t},\hat{\alpha }_{T} \right) - \mr {Cov}\left(\hat{\alpha }_{u},\hat{\alpha }_{T} \right) + \mr {Var}\left(\hat{\alpha }_{T}\right)\\ \mr {Cov}\left(D_\mi {i} ^{C},D_\mi {t} ^{T}\right) & = \mr {Cov}\left(\hat{\gamma }_{i}\,  \hat{\alpha }_{t} \right) + \mr {Cov}\left(\hat{\gamma }_{i}, \hat{\alpha }_{T} \right) - \mr {Cov}\left(\hat{\gamma }_{i}, \hat{\alpha }_{T} \right) - \mr {Var}\left(\hat{\alpha }_{T}\right)\\ \mr {Cov}\left(D_\mi {i} ^ C, \tilde{\beta } \right) & =-\mr {Cov}\left(\hat{\gamma }_{i}, \tilde{\beta } \right) - \mr {Cov}\left(\hat{\alpha }_{T}, \tilde{\beta } \right)\\ \mr {Cov}\left(D_\mi {t} ^ T, \tilde{\beta }\right) & =-\mr {Cov}\left(\hat{\alpha }_{t}, \tilde{\beta }\right) + \mr {Cov}\left(\hat{\alpha }_{T}, \tilde{\beta } \right) \end{align*}

Variance Covariance of Dummy Variables with Intercept

The variances and covariances of the dummy variables are given as follows when the intercept is included:

\begin{align*}  \mr {Cov}\left(D_\mi {i} ^{C}, D_\mi {j} ^{C}\right) & = \mr {Cov}\left(\hat{\gamma }_{i}, \hat{\gamma }_{j} \right) - \mr {Cov}\left(\hat{\gamma }_{i}, \hat{\gamma }_{N} \right) - \mr {Cov}\left(\hat{\gamma }_{j}, \hat{\gamma }_{N} \right) + \mr {Var}\left(\hat{\gamma }_{N}\right)\\ \mr {Cov}\left(D_\mi {t} ^{T}, D_\mi {u} ^{T}\right) & = \mr {Cov}\left(\hat{\alpha }_{t}, \hat{\alpha }_{u} \right) - \mr {Cov}\left(\hat{\alpha }_{t}, \hat{\alpha }_{T} \right) - \mr {Cov}\left(\hat{\alpha }_{u}, \hat{\alpha }_{T} \right) + \mr {Var}\left(\hat{\alpha }_{T}\right)\\ \mr {Cov}\left(D_\mi {i} ^{C}, D_\mi {t} ^{T}\right) & = \mr {Cov}\left(\hat{\gamma }_{i}, \hat{\alpha }_{t} \right) - \mr {Cov}\left(\hat{\gamma }_{i}, \hat{\alpha }_{T} \right) - \mr {Cov}\left(\hat{\gamma }_{N}, \hat{\alpha }_{t} \right) + \mr {Cov}\left(\hat{\gamma }_{N}, \hat{\alpha }_{T} \right)\\ \mr {Cov}\left(D_\mi {i} ^ C, \mr {Intercept} \right) & = \mr {Cov}\left(\hat{\gamma }_{i}, \hat{\gamma }_{N} \right) + \mr {Cov}\left(\hat{\gamma }_{i}, \hat{\alpha }_{T} \right) - \mr {Cov}\left(\hat{\gamma }_{j}, \hat{\alpha }_{T} \right) - \mr {Var}\left(\hat{\gamma }_{N}\right)\\ \mr {Cov}\left(D_\mi {t} ^{T}, \mr {Intercept}\right) & = \mr {Cov}\left(\hat{\alpha }_{t}, \hat{\alpha }_{T} \right) + \mr {Cov}\left(\hat{\alpha }_{t}, \hat{\gamma }_{N} \right) - \mr {Cov}\left(\hat{\alpha }_{T}, \hat{\alpha }_{N} \right) - \mr {Var}\left(\hat{\alpha }_{T}\right)\\ \mr {Cov}\left(D_\mi {i} ^ C, \tilde{\beta }\right) & =-\mr {Cov}\left(\hat{\gamma }_{i}, \tilde{\beta } \right) - \mr {Cov}\left(\hat{\gamma }_{N}, \tilde{\beta } \right)\\ \mr {Cov}\left(D_\mi {t} ^ T, \tilde{\beta }\right) & =-\mr {Cov}\left(\hat{\alpha }_{t}, \tilde{\beta }\right) + \mr {Cov}\left(\hat{\alpha }_{T}, \tilde{\beta }\right)\\ \mr {Cov}\left(\mr {Intercept}, \tilde{\beta }_ f\right) & =-\mr {Cov}\left(\hat{\alpha }_{T}, \tilde{\beta } \right) - \mr {Cov}\left(\hat{\gamma }_{N}, \tilde{\beta } \right) \end{align*}