The specification for the two-way random-effects model is
As it does for the one-way random-effects model, the HPPANEL procedure provides four options for variance component estimators. However, unbalanced panels present some special concerns that do not occur for one-way random-effects models.
Let and be the independent and dependent variables 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 be the number of cross sections that are observed in time , and let . Let be the matrix that is obtained from the identity matrix from which rows that correspond to cross sections that are not observed at time have been omitted. Consider
where and .
The matrix contains the dummy variable structure for the two-way model.
For notational ease, let
PROC HPPANEL provides four methods to estimate the variance components. For more information, see the section Two-Way Random-Effects Model in SAS/ETS 13.2 User's Guide.
After the estimates of the variance components are calculated, you can proceed to the final estimation. If the panel is balanced, partial mean deviations are used as follows
The estimates are obtained from
With these partial deviations, PROC HPPANEL uses OLS on the transformed series (including an intercept if you want).
The case of an unbalanced panel is somewhat more complicated. Wansbeek and Kapteyn show that the inverse of can be written as
with the following:
By using the inverse of the covariance matrix of the error, it becomes possible to complete GLS on the unbalanced panel.