CPANEL Procedure
Two-Way Fixed-Effects Model (FIXTWO Option)
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. Assume the identifiability restriction
.
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
If the model includes an intercept, then , and the
are shifted to exclude
.
Variance and covariance estimates for ,
, and
are obtained by the delta method, because each of these quantities is a linear transformation of
and
.