Skip to content

Method | Fixed Effects Model & Random Effects Model

Posted on:March 20, 2024

Table of contents

1. Fixed Effects Model

1.1 Motivation

1.2 Model Specification

yit=xitTβ+ϵit=xitTβ+αi+uit\begin{align*} y_{it} &= \mathbf{x}_{it}^T \beta + \epsilon_{it} \\ &= \mathbf{x}_{it}^T \beta + \alpha_i + u_{it} \end{align*}

1.3 Model Estimation

Two different estimation processes lead to two different but equivalent estimators.

1) Within Estimator

Let:

yˉi=1Tt=1Tyitxˉi=1Tt=1Txituˉi=1Tt=1Tuit\bar{y}_i = \frac{1}{T}\sum_{t=1}^T y_{it},\bar{\mathbf{x}}_i = \frac{1}{T}\sum_{t=1}^T \mathbf{x}_{it},\bar{u}_i = \frac{1}{T}\sum_{t=1}^T u_{it}

Then:

yityˉi=(xitxˉi)Tβ+(uituˉi)y_{it}-\bar{y}_i = (\mathbf{x}_{it}-\bar{\mathbf{x}}_i)^T \beta + (u_{it}-\bar{u}_i)

Hence, we can regress yityˉiy_{it} - \bar{y}_i on xitxˉi\mathbf{x}_{it}-\bar{\mathbf{x}}_i. The fixed effects estimator is also called the within estimator.

2) LSDV Estimator

We can also formulate the model into following form:

yit=xitTβ+αi+uit=xitTβ+α1+(α2α1)I(i=2)++(αnα1)I(i=n)+uit\begin{align*} y_{it}&=\mathbf{x}^T_{it}\beta + \alpha_i + u_{it}\\ &=\mathbf{x}^T_{it}\beta + \alpha_1 + (\alpha_2-\alpha_1)I(i=2)+ \cdots + (\alpha_n-\alpha_1)I(i=n) + u_{it} \end{align*}

In this case, we can regress yity_{it} on xitT,I(i=2),I(i=3),...,I(i=n)\mathbf{x}^T_{it}, I(i=2), I(i=3), ... , I(i=n). This is called the least squares dummy variables regression (LSDV) . It can be proved that within estimator is identical to LSDV estimator.

1.4 Strong Exogeneity

In order to get consistent estimators in FEM case, x\mathbf{x} need to be strictly exogenous:

Cov(xit,uit)=0Cov(xiτ,uit)=0for τ=1,2,...,TCov(\mathbf{x}_{it}, u_{it}) = \mathbf{0}\\Cov(\mathbf{x}_{i\tau}, u_{it}) = \mathbf{0}\quad \text{for}\ \tau = 1,2,..., T

This is a pretty strong assumption!

1.5 Time Fixed Effects & Entity Fixed Effects

What we have discussed pertains to what we call entity fixed effects, where the fixed effects remain constant over time but vary across entities. It can be expressed as αi\alpha_i in the model. Another type of fixed effects is time fixed effects, where the fixed effects remain constant across entities but vary over time. The model just changes the entity fixed effects αi\alpha_i into time fixed effects γt\gamma_t:

yit=xitTβ+γt+uity_{it} = \mathbf{x}_{it}^T \beta + \gamma_t+ u_{it}

The estimation approach is identical to that of the model with entity fixed effects.

However, we should remember that although we employ an entity and time fixed effects model, we are still unable to completely eliminate all omitted variable bias, as there may still be some omitted variables that vary across entities and change over time.

1.6 R Example

2. Random Effects Model

2.1 Motivation

2.2 Model Specification

The model form is the same as that of the fixed effects model:

yit=xitTβ+ϵit=xitTβ+αi+uit\begin{align*} y_{it} &= \mathbf{x}_{it}^T \beta + \epsilon_{it} \\ &= \mathbf{x}_{it}^T \beta + \alpha_i + u_{it} \end{align*}

However, the settings are quite different:

2.3 Model Estimation

Why are the error terms correlated here? let Var(αi)=σα2, Var(uit)=σu2Var(\alpha_i) = \sigma_{\alpha}^2,\ Var(u_{it}) = \sigma_{u}^2

Cov(ϵit,ϵis)=Cov(αi+uit, αi+uis)=Var(αi)+Cov(uit,uis)=σα2+0=σα2\begin{align*} Cov(\epsilon_{it}, \epsilon_{is}) &= Cov(\alpha_i + u_{it},\ \alpha_i + u_{is}) \\ &= Var(\alpha_i) + Cov(u_{it}, u_{is}) \\ &= \sigma_{\alpha}^2 + 0\\ &= \sigma_{\alpha}^2 \end{align*}

We can see that the error terms from different times within the same individual are correlated. Hence, we have to resort to GLS to get a good estimate for β\beta. The transformation multiplier for GLS is:

λ=1σασα2+Tσu2\lambda = 1 - \frac{\sigma_{\alpha}}{\sqrt{\sigma^2_{\alpha} + T\sigma^2_u}}

Then do the data transformation:

yitλyˉi=(xitλxˉi)Tβ+(ϵitλϵˉi)y_{it}-\lambda \bar{y}_i = (\mathbf{x}_{it}-\lambda \bar{\mathbf{x}}_i)^T \beta + (\epsilon_{it}-\lambda \bar{\epsilon}_i)

We can use multiple ways to estimate λ and then transform the data. Finally, use OLS to do estimation on the transformed data, getting β^RE\hat{\beta}^{RE}.

3. References