Tutorials › Econometrics (Graduate) › Why Correlated Random Effects Recover Fixed-Effects Slopes

Fixed and Random Effects · Tutorial 266 of 952

Why Correlated Random Effects Recover Fixed-Effects Slopes

Learn how adding unit means separates within-unit slope information from between-unit differences, reproducing fixed-effects slopes while retaining time-invariant regressors.

Intermediate 11 min read

What You'll Learn

  • State the balanced-panel conditions for the Mundlak–fixed-effects slope equality
  • Derive the equality by separating within-unit and between-unit variation
  • Explain how unit means and time-invariant regressors remain in the transformed model
  • Distinguish a within slope from a between association
  • Identify when the equality or the time-invariant coefficient interpretation can fail

Why the Mundlak Specification Can Match Fixed Effects

Fixed effects estimates the association between changes in a regressor within a unit and changes in that unit’s outcome. In doing so, it removes every time-invariant unit characteristic—including observed regressors that do not change over time. The Mundlak correlated-random-effects specification offers a different route: it includes each time-varying regressor’s unit mean in a random-effects model. Under the balanced-panel conditions developed here, this addition makes the coefficient on each time-varying regressor exactly the fixed-effects slope.

The key is a separation of information. After quasi-demeaning, each regressor consists of a within-unit deviation and a scaled unit mean. The deviations sum to zero within each unit, so they are orthogonal to the unit-level variables in the model. Including the means lets the regression account for the between-unit component without letting it alter the within-unit slope.

Model and Conditions

Definition: Consider a balanced panel with \(N\) units observed in each of the same \(T\) periods. Let \(y_{it}\) be the outcome, \(x_{it}\) a \(K\)-vector of time-varying regressors, and \(z_i\) a vector of time-invariant regressors. Write \(\bar{x}_i=T^{-1}\sum_{t=1}^T x_{it}\) for the unit mean. A Mundlak specification is $$ y_{it}=x_{it}'\beta+\bar{x}_i'\pi+z_i'\gamma+c_i+\varepsilon_{it}. $$ Here \(\beta\) is the coefficient vector of interest, \(\pi\) captures the additional association with unit means, and \(\gamma\) is the coefficient vector for the time-invariant regressors. In the conventional random-effects GLS formulation, \(c_i\) has variance \(\sigma_c^2\), \(\varepsilon_{it}\) has variance \(\sigma_\varepsilon^2\), and the error covariance is compound symmetric. For the usual interpretation of the CRE model, the residual unit effect \(c_i\) and idiosyncratic errors must satisfy the relevant orthogonality and exogeneity assumptions. Assume also that the time-varying regressors have within-unit variation sufficient to identify \(\beta\).

The Mundlak means are formed from all time-varying regressors whose relationship with the unit effect is being represented. The familiar random-effects quasi-demeaning factor in this balanced setting is

$$ \theta=1-\sqrt{\frac{\sigma_\varepsilon^2}{\sigma_\varepsilon^2+T\sigma_c^2}}. $$

For \(0\leq\theta<1\), quasi-demeaning replaces each variable \(v_{it}\) by \(v_{it}-\theta\bar{v}_i\), where \(\bar{v}_i\) is its unit mean. The factor is common across units because the panel is balanced and the variance components are common.

Worked Example: Separating a Regressor Into Its Two Components

Suppose a hypothetical unit has \(x_{i1}=2\) and \(x_{i2}=6\). Its mean is \(\bar{x}_i=(2+6)/2=4\), so its within deviations are \(-2\) and \(2\). If \(\theta=0.5\), the quasi-demeaned regressor values are $$ x_{i1}-\theta\bar{x}_i=2-0.5(4)=0,\qquad x_{i2}-\theta\bar{x}_i=6-0.5(4)=4. $$

These values can also be written as the within deviation plus the remaining scaled mean: \(-2+0.5(4)=0\) and \(2+0.5(4)=4\). The within deviations still sum to zero, while the mean component remains in the transformed data for the CRE regression to model.

Deriving the Equality of Slopes

For any unit, decompose a time-varying regressor into its deviation from its mean and its mean: \(x_{it}=(x_{it}-\bar{x}_i)+\bar{x}_i\). The same decomposition applies to the outcome. After quasi-demeaning, the transformed values are

$$ x_{it}-\theta\bar{x}_i=(x_{it}-\bar{x}_i)+(1-\theta)\bar{x}_i, \qquad y_{it}-\theta\bar{y}_i=(y_{it}-\bar{y}_i)+(1-\theta)\bar{y}_i. $$

The transformed regression includes the unit means and the time-invariant regressors. Within each unit, these variables are constant across periods after transformation. The following orthogonality is the crucial fact:

$$ \sum_{t=1}^T(x_{it}-\bar{x}_i)=0,\qquad \sum_{t=1}^T(y_{it}-\bar{y}_i)=0. $$
Theorem: In a balanced panel, when the Mundlak random-effects GLS regression includes the means of all time-varying regressors and the time-invariant regressors, the coefficient \(\hat{\beta}\) on \(x_{it}\) equals the fixed-effects within estimator, provided the within-regressor matrix has full column rank. This is a finite-sample algebraic equality for the stated GLS transformation; it does not by itself establish that either estimator has a causal interpretation.

To see why, consider the transformed regression’s residual for unit \(i\) and period \(t\). Its within-unit component is \((y_{it}-\bar{y}_i)-(x_{it}-\bar{x}_i)'\beta\). The remaining component is constant over \(t\): it collects the transformed unit mean, time-invariant regressors, and any unit-level fitted terms. When squared residuals are summed over periods, the cross-product between these components vanishes because the within component sums to zero. Thus the least-squares criterion separates into a within part and a between part.

The within part is exactly the criterion minimized by fixed effects:

$$ \sum_{i=1}^N\sum_{t=1}^T \left[(y_{it}-\bar{y}_i)-(x_{it}-\bar{x}_i)'\beta\right]^2. $$

The between part is minimized using the unit means and time-invariant regressors. Because the two parts have no cross-product, changing the coefficients that fit between-unit differences cannot change the minimizing value of \(\beta\) in the within part. This proves the equality.

1
Quasi-demean.
Each time-varying regressor becomes its within deviation plus \((1-\theta)\bar{x}_i\). Unit-level regressors remain constant across periods after transformation.
2
Separate the components.
The within deviations sum to zero within each unit, so their cross-products with unit-level terms are zero.
3
Minimize the within criterion.
The coefficient on \(x_{it}\) must minimize the same within sum of squares as the fixed-effects estimator.

Worked Example: Matching a Fixed-Effects Slope

Consider a hypothetical balanced panel with three units observed twice. The table gives \(x_{it}\) and \(y_{it}\).

UnitPeriod\(x_{it}\)\(y_{it}\)
A112
A235
B124
B247
C145
C268

For A, the means are \(\bar{x}_A=2\) and \(\bar{y}_A=3.5\), giving deviations \((-1,1)\) and \((-1.5,1.5)\). For B, the means are \(3\) and \(5.5\), with the same deviations. For C, the means are \(5\) and \(6.5\), again with the same deviations. Therefore the fixed-effects slope is $$ \hat{\beta}_{FE} =\frac{\sum_i\sum_t(x_{it}-\bar{x}_i)(y_{it}-\bar{y}_i)} {\sum_i\sum_t(x_{it}-\bar{x}_i)^2} =\frac{3(3)}{3(2)} =\frac{9}{6} =1.5. $$

If these data are fit with the balanced-panel Mundlak GLS specification, including \(\bar{x}_i\), the quasi-demeaned objective separates into the within criterion above and a between criterion. Hence the coefficient on \(x_{it}\) is also \(1.5\), regardless of the between fit, as long as the model is identified. The reported equality concerns the slope, not necessarily its standard error: the estimated covariance matrix depends on the inferential procedure used.

Why Time-Invariant Regressors Can Remain

Fixed effects subtracts each unit’s time average. For a time-invariant regressor \(z_i\), this gives \(z_i-\bar{z}_i=0\), so its coefficient cannot be identified from within-unit changes. In quasi-demeaned CRE, however, the regressor becomes

$$ z_i-\theta z_i=(1-\theta)z_i. $$

As long as \(\theta<1\), this is not zero. The transformed model can therefore estimate a coefficient on \(z_i\) using between-unit differences, conditional on the included unit means and other regressors. This is not a within-unit effect: it compares units that differ in \(z_i\), after accounting for the other modeled differences. Its interpretation depends on the assumptions that make those between-unit comparisons informative. If the unit effect is correlated with \(z_i\) in ways not represented by the model, the coefficient need not have the desired structural interpretation.

Worked Example: Retaining a Time-Invariant Regressor

Suppose a hypothetical balanced panel has four units with \((\bar{x}_i,z_i)\) equal to \((0,0),(1,0),(0,1),(1,1)\). Their outcome means are \(10,12,13,15\), respectively. The unit means satisfy $$ \bar{y}_i=10+2\bar{x}_i+3z_i. $$

The four combinations allow the between-unit coefficients to be separated: increasing \(\bar{x}_i\) by one at either value of \(z_i\) is associated with a two-unit increase in \(\bar{y}_i\), and increasing \(z_i\) by one at either value of \(\bar{x}_i\) is associated with a three-unit increase. Thus the between regression has coefficients 2 on \(\bar{x}_i\) and 3 on \(z_i\).

If \(\theta=0.6\), the transformed time-invariant regressor is \(0.4z_i\), not zero. For instance, a unit with \(z_i=1\) contributes \(0.4\) in each transformed period, while a unit with \(z_i=0\) contributes zero. The CRE regression can therefore estimate the between association with \(z_i\), whereas fixed effects would remove it entirely. These between coefficients illustrate what the design can identify; they do not alone verify the exogeneity assumptions needed for a causal claim.

What the Equality Does—and Does Not—Mean

The Mundlak mean coefficient \(\pi\) is not the fixed-effects slope. In the conditional mean of the Mundlak model, the coefficient on \(x_{it}\) is \(\beta\), while the coefficient on \(\bar{x}_i\) is \(\pi\). For a comparison that changes both \(x_{it}\) and its unit mean, the combined model terms matter. The equality result says that \(\beta\), the coefficient on the period-specific regressor conditional on the included means, matches the within slope.

The equality also does not make the CRE and fixed-effects models identical for every purpose. CRE retains between-unit information and can estimate time-invariant coefficients; fixed effects does not. Standard errors can differ depending on the covariance assumptions and the method used to estimate uncertainty. The equality is about the coefficient estimate under the balanced-panel GLS transformation and complete inclusion of the relevant means.

Worked Example: Omitting the Unit Mean Can Change the Slope

Consider a hypothetical two-period panel with two units. Their regressor means are \(-1\) and \(1\), and each unit’s within deviations are \((-1,1)\). Suppose the outcome satisfies \(y_{it}=2x_{it}+4\bar{x}_i\). The fixed-effects slope is 2, since the within outcome deviations are twice the within regressor deviations.

Now quasi-demean with \(\theta=0.5\), but omit \(\bar{x}_i\) from the regression. Across the four observations, the within deviations have \(\sum(x_{it}-\bar{x}_i)^2=4\); the unit means have \(\sum\bar{x}_i^2=4\). The transformed regressor is the within deviation plus \(0.5\bar{x}_i\). The transformed outcome is twice the within deviation plus \(3\bar{x}_i\), because its unit mean is \(6\bar{x}_i\). The cross-products between within deviations and unit means sum to zero. Thus the slope from a transformed regression that omits the mean is $$ \frac{2(4)+(0.5)(3)(4)}{4+(0.5)^2(4)} =\frac{14}{5} =2.8. $$

It differs from the fixed-effects slope of 2 because the regression has allowed the between-unit component to contribute to the coefficient on \(x_{it}\). Including \(\bar{x}_i\) gives that component its own coefficient and restores the within slope.

Common Pitfalls and Scope

  • Assuming any random-effects regression reproduces fixed effects. The equality depends on including the means of the relevant time-varying regressors. Omitting them can mix within and between information.
  • Calling the time-invariant coefficient a within effect. Its identifying variation is between units, not within units. Its interpretation requires appropriate assumptions about residual unit heterogeneity.
  • Extending the result without checking the panel structure. The derivation uses a balanced panel and a common quasi-demeaning factor. In unbalanced panels, the transformation and weighting can vary with observation patterns, so the equality need not hold in this form.
  • Treating coefficient equality as proof of exogeneity. The algebra shows how the estimators’ slopes coincide under the specified setup. It does not show that regressors are exogenous, that the model is correctly specified, or that a coefficient is causal.

The practical value of the CRE formulation is its combination of a within slope for time-varying regressors and estimable between-unit coefficients for time-invariant regressors. The unit means are the device that keeps the between component from changing the within slope; the assumptions supporting the between comparisons remain a separate issue.

Check Your Understanding

Use the decomposition into within deviations and unit means to answer these questions.

  1. Why does the cross-product between a unit’s within deviations and any time-constant transformed regressor equal zero?
  2. What happens to a time-invariant regressor under quasi-demeaning when \(\theta<1\), and why does fixed effects remove it?
  3. In the Mundlak model, which coefficient equals the fixed-effects slope: the coefficient on \(x_{it}\) or the coefficient on \(\bar{x}_i\)?
  4. Why can omitting a unit mean cause the quasi-demeaned coefficient to combine within and between information?
  5. Does the equality of the CRE and fixed-effects slopes establish that the time-invariant coefficient has a causal interpretation? Explain.
Clinical Biostats