Assume that the data are balanced (for example, all cross sections have T observations). Then you can write the following:


where the symbols:
and are the dependent variable (a scalar) and the explanatory variables (a vector whose columns are the explanatory variables not including a constant), respectively
and are cross section means
and are time means
and are the overall means
The twoway fixedeffects model is simply a regression of on . Therefore, the twoway is given by:

The calculations of cross section dummy variables, time dummy variables, and intercepts follow in a fashion similar to that used in the oneway model.
First, you obtain the net crosssectional and time effects. Denote the crosssectional effects by and the time effects by . These effects are calculated from the following relations:


Denote the crosssectional dummy variables and time dummy variables with the superscript C and T. Under the NOINT option the following equations give the dummy variables:


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



The sum of squared errors is:

The estimated error variance is:

With or without a constant, the variance covariance matrix of is given by:

The variances and covariances of the dummy variables are given with the NOINT specification as follows:

















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



















