The HPPANEL Procedure

Unbalanced Panels

Let ${\mb{X} _{*}}$ and ${\mb{y} _{*}}$ be the independent and dependent variables, respectively, that are arranged by time and by cross section within each time period. (Note that the input data set that the PANEL procedure uses must be sorted by cross section and then by time within each cross section.) Let ${\mi{M} _{t}}$ be the number of cross sections that are 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 that is obtained from the ${\mi{N} {\times } \mi{N} }$ identity matrix from which rows that correspond to cross sections that are 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 , \mb{D} _{T}\mb{j} _{N})}$. The matrix ${\mb{Z}}$ contains 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. For more information, see the section Two-Way Fixed-Effects Model in SAS/ETS 14.1 User's Guide.