You perform two-way fixed-effects estimation by specifying the FIXTWO option in the MODEL statement. The error specification for the two-way fixed-effects model is
where the and
are nonrandom parameters to be estimated.
Estimation is similar to that for one-way fixed effects, for which a within transformation is used to convert the problem to OLS regression. For two-way models under the general case of unbalanced data, the within transformation is more complex.
Following Wansbeek and Kapteyn (1989) and Baltagi (2013, sec. 9.4), let and
be versions of
and
whose rows are sorted by time period, and by cross section within each time period. With the data sorted in this manner, define
to be the
design matrix for cross sections. Each row of
contains a 1 in the column that corresponds to that observation’s cross section, and 0s in the remaining columns. Similarly, define
to be the
design matrix for time periods. In balanced data,
and
.
Define the following:
The matrix provides the two-way within transformation. If the data are balanced, this amounts to transforming any data value
to
.
Applying the two-way within transformation means that you can use OLS regression of on
to obtain
,
, and fit statistics such as mean square error (MSE), provided that you adjust the error degrees of freedom to equal
.
Define the residual vector . Estimates of the time effects are
, and estimates of the cross-sectional effects are
, where
The full model that contains the intercept, N cross-sectional effects, and T time effects is overidentified, and simultaneous estimation of these quantities is not possible without restrictions. If you specify the PRINTFIXED option, the printed fixed effects reflect these restrictions.
If the model has an intercept, then the PRINTFIXED option output is parameterized as follows:
If the model does not include an intercept, then the PRINTFIXED option output is parameterized as follows:
Variance and covariance estimates for the intercept and printed fixed effects are obtained by the delta method, because each of these quantities is a linear transformation of and
.