Fixed effects model

In statistics, a fixed effects model is a statistical model in which the model parameters are fixed or non-random quantities. This is in contrast to random effects models and mixed models in which all or some of the model parameters are considered as random variables. In many applications including econometrics and biostatistics a fixed effects model refers to a regression model in which the group means are fixed (non-random) as opposed to a random effects model in which the group means are a random sample from a population. Generally, data can be grouped according to several observed factors. The group means could be modeled as fixed or random effects for each grouping. In a fixed effects model each group mean is a group-specific fixed quantity.

In panel data where longitudinal observations exist for the same subject, fixed effects represent the subject-specific means. In panel data analysis the term fixed effects estimator (also known as the within estimator) is used to refer to an estimator for the coefficients in the regression model including those fixed effects (one time-invariant intercept for each subject).

Qualitative description

Such models assist in controlling for unobserved heterogeneity when this heterogeneity is constant over time. This heterogeneity can be removed from the data through differencing, for example by taking a first difference which will remove any time invariant components of the model.

There are two common assumptions made about the individual specific effect: the random effects assumption and the fixed effects assumption. The random effects assumption (made in a random effects model) is that the individual-specific effects are uncorrelated with the independent variables. The fixed effect assumption is that the individual-specific effects are correlated with the independent variables. If the random effects assumption holds, the random effects model is more efficient than the fixed effects model. However, if this assumption does not hold, the random effects model is not consistent. The Durbin–Wu–Hausman test is often used to discriminate between the fixed and the random effects model.

Formal description

Classical Representation

Consider the linear unobserved effects model for $N$ observations and $T$ time periods:

$y_{it}=X_{it}\mathbf {\beta } +\alpha _{i}+u_{it}$ for $t=1,..,T$ and $i=1,...,N$ Where:

• $y_{it}$ is the dependent variable observed for individual $i$ at time $t$ .
• $X_{it}$ is the time-variant $1\times k$ (the number of independent variables) regressor vector.
• $\beta$ is the $k\times 1$ matrix of parameters.
• $\alpha _{i}$ is the unobserved time-invariant individual effect. For example, the innate ability for individuals or historical and institutional factors for countries.
• $u_{it}$ is the error term.

Unlike $X_{it}$ , $\alpha _{i}$ cannot be directly observed.

Unlike the random effects model where the unobserved $\alpha _{i}$ is independent of $X_{it}$ for all $t=1,...,T$ , the fixed effects (FE) model allows $\alpha _{i}$ to be correlated with the regressor matrix $X_{it}$ . Strict exogeneity with respect to the idiosyncratic error term $u_{it}$ , however, is still required.

Since $\alpha _{i}$ is not observable, it cannot be directly controlled for. The FE model eliminates $\alpha _{i}$ by demeaning the variables using the within transformation:

$y_{it}-{\overline {y_{i}}}=\left(X_{it}-{\overline {X_{i}}}\right)\beta +\left(\alpha _{i}-{\overline {\alpha _{i}}}\right)+\left(u_{it}-{\overline {u_{i}}}\right)\implies {\ddot {y_{it}}}={\ddot {X_{it}}}\beta +{\ddot {u_{it}}}$ where ${\overline {X_{i}}}={\frac {1}{T}}\sum \limits _{t=1}^{T}X_{it}$ and ${\overline {u_{i}}}={\frac {1}{T}}\sum \limits _{t=1}^{T}u_{it}$ .

Since $\alpha _{i}$ is constant, ${\overline {\alpha _{i}}}=\alpha _{i}$ and hence the effect is eliminated. The FE estimator ${\hat {\beta }}_{FE}$ is then obtained by an OLS regression of ${\ddot {y}}$ on ${\ddot {X}}$ .

At least three alternatives to the within transformation exist with variations.

One is to add a dummy variable for each individual $i>1$ (omitting the first individual because of multicollinearity). This is numerically, but not computationally, equivalent to the fixed effect model and only works if the sum of the number of series and the number of global parameters is smaller than the number of observations. The dummy variable approach is particularly demanding with respect to computer memory usage and it is not recommended for problems larger than the available RAM, and the applied program compilation, can accommodate.

Second alternative is to use consecutive reiterations approach to local and global estimations. This approach is very suitable for low memory systems on which it is much more computationally efficient than the dummy variable approach.

The third approach is a nested estimation whereby the local estimation for individual series is programmed in as a part of the model definition. This approach is the most computationally and memory efficient, but it requires proficient programming skills and access to the model programming code; although, it can be programmed even in SAS.

Finally, each of the above alternatives can be improved if the series-specific estimation is linear (within a nonlinear model), in which case the direct linear solution for individual series can be programmed in as part of the nonlinear model definition.

Generalization with input uncertainty

When there is input uncertainty for the $y$ data, $\delta y$ , then the $\chi ^{2}$ value, rather than the sum of squared residuals, should be minimized. This can be directly achieved from substitution rules:

${\frac {y_{it}}{\delta y_{it}}}=\mathbf {\beta } {\frac {X_{it}}{\delta y_{it}}}+\alpha _{i}{\frac {1}{\delta y_{it}}}+{\frac {u_{it}}{\delta y_{it}}}$ ,

then the values and standard deviations for $\mathbf {\beta }$ and $\alpha _{i}$ can be determined via classical ordinary least squares analysis and variance-covariance matrix.

Equality of Fixed Effects (FE) and First Differences (FD) estimators when T=2

For the special two period case ($T=2$ ), the FE estimator and the FD estimator are numerically equivalent. This is because the FE estimator effectively "doubles the data set" used in the FD estimator. To see this, establish that the fixed effects estimator is: ${FE}_{T=2}=\left[(x_{i1}-{\bar {x}}_{i})(x_{i1}-{\bar {x}}_{i})'+(x_{i2}-{\bar {x}}_{i})(x_{i2}-{\bar {x}}_{i})'\right]^{-1}\left[(x_{i1}-{\bar {x}}_{i})(y_{i1}-{\bar {y}}_{i})+(x_{i2}-{\bar {x}}_{i})(y_{i2}-{\bar {y}}_{i})\right]$ Since each $(x_{i1}-{\bar {x}}_{i})$ can be re-written as $(x_{i1}-{\dfrac {x_{i1}+x_{i2}}{2}})={\dfrac {x_{i1}-x_{i2}}{2}}$ , we'll re-write the line as:

${FE}_{T=2}=\left[\sum _{i=1}^{N}{\dfrac {x_{i1}-x_{i2}}{2}}{\dfrac {x_{i1}-x_{i2}}{2}}'+{\dfrac {x_{i2}-x_{i1}}{2}}{\dfrac {x_{i2}-x_{i1}}{2}}'\right]^{-1}\left[\sum _{i=1}^{N}{\dfrac {x_{i1}-x_{i2}}{2}}{\dfrac {y_{i1}-y_{i2}}{2}}+{\dfrac {x_{i2}-x_{i1}}{2}}{\dfrac {y_{i2}-y_{i1}}{2}}\right]$ $=\left[\sum _{i=1}^{N}2{\dfrac {x_{i2}-x_{i1}}{2}}{\dfrac {x_{i2}-x_{i1}}{2}}'\right]^{-1}\left[\sum _{i=1}^{N}2{\dfrac {x_{i2}-x_{i1}}{2}}{\dfrac {y_{i2}-y_{i1}}{2}}\right]$ $=2\left[\sum _{i=1}^{N}(x_{i2}-x_{i1})(x_{i2}-x_{i1})'\right]^{-1}\left[\sum _{i=1}^{N}{\frac {1}{2}}(x_{i2}-x_{i1})(y_{i2}-y_{i1})\right]$ $=\left[\sum _{i=1}^{N}(x_{i2}-x_{i1})(x_{i2}-x_{i1})'\right]^{-1}\sum _{i=1}^{N}(x_{i2}-x_{i1})(y_{i2}-y_{i1})={FD}_{T=2}$ Hausman–Taylor method

Need to have more than one time-variant regressor ($X$ ) and time-invariant regressor ($Z$ ) and at least one $X$ and one $Z$ that are uncorrelated with $\alpha _{i}$ .

Partition the $X$ and $Z$ variables such that ${\begin{array}{c}X=[{\underset {TN\times K1}{X_{1it}}}\vdots {\underset {TN\times K2}{X_{2it}}}]\\Z=[{\underset {TN\times G1}{Z_{1it}}}\vdots {\underset {TN\times G2}{Z_{2it}}}]\end{array}}$ where $X_{1}$ and $Z_{1}$ are uncorrelated with $\alpha _{i}$ . Need $K1>G2$ .

Estimating $\gamma$ via OLS on ${\widehat {di}}=Z_{i}\gamma +\varphi _{it}$ using $X_{1}$ and $Z_{1}$ as instruments yields a consistent estimate.

Testing fixed effects (FE) vs. random effects (RE)

We can test whether a fixed or random effects model is appropriate using a Durbin–Wu–Hausman test.

$H_{0}$ : $\alpha _{i}\perp X_{it},Z_{i}$ $H_{a}$ : $\alpha _{i}\not \perp X_{it},Z_{i}$ If $H_{0}$ is true, both ${\widehat {\beta }}_{RE}$ and ${\widehat {\beta }}_{FE}$ are consistent, but only ${\widehat {\beta }}_{RE}$ is efficient. If $H_{a}$ is true, ${\widehat {\beta }}_{FE}$ is consistent and ${\widehat {\beta }}_{RE}$ is not.

${\widehat {Q}}=$ ${\widehat {\beta }}_{RE}-{\widehat {\beta }}_{FE}$ ${\widehat {HT}}=T{\widehat {Q}}^{\prime }[Var({\widehat {\beta }}_{FE})-Var({\widehat {\beta }}_{RE})]^{-1}{\widehat {Q}}\sim \chi _{K}^{2}$ where $K=\dim(Q)$ The Hausman test is a specification test so a large test statistic might be indication that there might be errors-in-variables (EIV) or our model is misspecified. If the FE assumption is true, we should find that ${\widehat {\beta }}_{LD}\approx {\widehat {\beta }}_{FD}\approx {\widehat {\beta }}_{FE}$ .

A simple heuristic is that if $\left\vert {\widehat {\beta }}_{LD}\right\vert >\left\vert {\widehat {\beta }}_{FE}\right\vert >\left\vert {\widehat {\beta }}_{FD}\right\vert$ there could be EIV.

Steps in Fixed Effects Model for sample data

1. Calculate group and grand means
2. Calculate k=number of groups, n=number of observations per group, N=total number of observations (k x n)
3. Calculate SS-total (or total variance) as: (Each score - Grand mean)^2 then summed
4. Calculate SS-treat (or treatment effect) as: (Each group mean- Grand mean)^2 then summed x n
5. Calculate SS-error (or error effect) as (Each score - Its group mean)^2 then summed
6. Calculate df-total: N-1, df-treat: k-1 and df-error k(n-1)
7. Calculate Mean Square MS-treat: SS-treat/df-treat, then MS-error: SS-error/df-error
8. Calculate obtained f value: MS-treat/MS-error
9. Use F-table or probability function, to look up critical f value with a certain significance level
10. Conclude as to whether treatment effect significantly affects the variable of interest