Tutorials › Econometrics (Graduate) › Choosing Between Fixed Effects And First Differences

Fixed and Random Effects · Tutorial 258 of 952

Choosing Between Fixed Effects And First Differences

Learn how fixed effects and first differences use panel variation, and how the covariance of the errors determines their relative precision.

Intermediate 9 min read

What You'll Learn

  • State the static panel assumptions under which fixed effects and first differences estimate the same slope.
  • Express each estimator as a regression on transformed data.
  • Compare their conditional variances using the within-unit error covariance.
  • Explain why fixed effects are at least as precise under independent, equal-variance errors.
  • Calculate examples where fixed effects or first differences have lower variance.
  • Recognize why no estimator is uniformly more precise for every covariance pattern.

Why Compare the Two Transformations?

Fixed effects and first differences both remove a time-constant unit effect, but they retain and weight the remaining within-unit information differently. The choice can therefore affect precision even when both estimators target the same slope. The key question is not simply how many observations each method uses: it is how the transformation interacts with the covariance of the errors over time.

The comparison below concerns a static panel with a common slope. It does not establish that either estimator is always preferable. Under independent, equal-variance errors, fixed effects have a standard efficiency advantage. With sufficiently persistent errors, first differences can instead be more precise for a particular regressor pattern.

Model and Estimators

Suppose there are \(N\) units observed in each of \(T\) periods. For unit \(i\) in period \(t\), consider

$$ y_{it}=\alpha_i+x_{it}'\beta+u_{it}. $$

Here \(y_{it}\) is the outcome, \(x_{it}\) is a vector of \(K\) regressors, \(\beta\) is a common slope vector, \(\alpha_i\) is an unrestricted time-constant unit effect, and \(u_{it}\) is the time-varying error. Assume a balanced panel, a common \(\beta\), and strict exogeneity: conditional on all regressors for unit \(i\) and its unit effect, the errors have mean zero. Assume units are independent for the variance calculations below. The within-unit covariance of \(u_{it}\), however, need not be the same for every comparison.

Write \(y_i\) for the \(T\)-vector of outcomes and \(X_i\) for the \(T\)-by-\(K\) matrix of regressors. Let \(M_T=I_T-\mathbf{1}\mathbf{1}'/T\) be the within-demeaning matrix, and let \(D\) be the first-difference matrix, so that \(Dy_i\) contains \(y_{i,t}-y_{i,t-1}\) for \(t=2,\ldots,T\). Both transformations remove \(\alpha_i\): \(M_T\mathbf{1}=0\) and \(D\mathbf{1}=0\).

Definition: The fixed-effects within estimator regresses demeaned outcomes on demeaned regressors. The first-difference estimator regresses changes in outcomes on changes in regressors. In matrix form,
$$ \hat{\beta}_{FE} = \left(\sum_{i=1}^{N}X_i'M_TX_i\right)^{-1} \sum_{i=1}^{N}X_i'M_Ty_i, \qquad \hat{\beta}_{FD} = \left(\sum_{i=1}^{N}(DX_i)'DX_i\right)^{-1} \sum_{i=1}^{N}(DX_i)'Dy_i. $$

These expressions require the relevant transformed regressors to have full column rank. Both estimators eliminate the unit effect, but their transformed errors are \(M_Tu_i\) and \(Du_i\), respectively. That difference is central to precision.

What Determines Relative Precision?

For a transparent comparison, first consider a single regressor and condition on the observed regressor values. Let \(q_{FE}=\sum_i x_i'M_Tx_i\) and \(q_{FD}=\sum_i (Dx_i)'Dx_i\), both positive. If the within-unit error covariance matrix is \(\Omega\), and it is common across independent units, then

$$ \operatorname{Var}(\hat{\beta}_{FE}\mid X) = q_{FE}^{-2}\sum_{i=1}^{N}x_i'M_T\Omega M_Tx_i, \qquad \operatorname{Var}(\hat{\beta}_{FD}\mid X) = q_{FD}^{-2}\sum_{i=1}^{N}(Dx_i)'D\Omega D'(Dx_i). $$

Thus, the comparison depends on both the regressor paths and the error covariance. With several regressors, the corresponding conditional variance is a matrix; precision then concerns the variance of particular coefficient contrasts or an explicitly chosen comparison criterion.

Worked Example: The Two-Period Estimators Coincide

Consider two hypothetical units observed for two periods, with one regressor. Unit A has \(x_{A1}=1,\ x_{A2}=3,\ y_{A1}=10,\ y_{A2}=16\). Unit B has \(x_{B1}=2,\ x_{B2}=5,\ y_{B1}=7,\ y_{B2}=16\). Compare the pooled FD and FE slope calculations.

For FD, the summed cross-product of changes is \(2(6)+3(9)=39\), and the summed squared regressor changes are \(2^2+3^2=13\). Therefore,

$$ \hat{\beta}_{FD} = \frac{(2)(6)+(3)(9)}{2^2+3^2} = \frac{39}{13} = 3. $$

With two periods, each unit’s demeaned regressor vector is proportional to \((-1,1)'\), and its demeaned outcome vector is proportional to the corresponding first difference. The within cross-product for each unit is therefore one-half of the product of its changes, and the within regressor sum of squares is one-half of the squared change. The common factor of one-half cancels in the pooled slope:

$$ \hat{\beta}_{FE} = \frac{\tfrac12(2)(6)+\tfrac12(3)(9)} {\tfrac12(2^2)+\tfrac12(3^2)} = \frac{19.5}{6.5} = 3. $$

This equality holds for the slope estimates in a two-period panel whenever the relevant regressor changes identify the slope. It is an algebraic equivalence, not a claim that either transformation is more precise. Their estimates are the same, so their precision comparison is the same as well.

Independent Errors: Why Fixed Effects Have the Advantage

Suppose \(u_i\) has covariance \(\sigma^2 I_T\): errors have a common variance and are uncorrelated across periods, conditional on the regressors. On the within-demeaned subspace, the covariance of \(M_Tu_i\) is \(\sigma^2 M_T\). The fixed-effects regression is therefore ordinary least squares with spherical errors on the space that remains after removing the unit effects.

The Gauss–Markov result implies that, under these conditions, the within estimator has minimum variance among linear unbiased estimators of the common slope in the model with unit effects. First differencing still gives a linear unbiased estimator under strict exogeneity, but its transformed errors are not spherical when \(T>2\). In fact, their covariance is

$$ \operatorname{Var}(Du_i\mid X) = \sigma^2 DD', $$

which has \(2\sigma^2\) on the diagonal and \(-\sigma^2\) on the immediately adjacent off-diagonals. Ordinary least squares on these changes does not use that covariance structure to weight the observations. It is generally less efficient than fixed effects in this setting, though the two estimators coincide when \(T=2\).

A short calculation illustrates the difference. With one regressor and independent errors, fixed effects has conditional variance \(\sigma^2/q_{FE}\). In a panel where every unit has the same regressor path \((0,0,1)'\), the FE slope weights that unit’s three errors by \((-1/2,-1/2,1)\). The FD slope uses only the final change, weighting its errors by \((0,-1,1)\). The squared weights sum to \(1.5\) for FE and \(2\) for FD. With independent errors, that gives FE the lower variance in this example.

Worked Example: Fixed Effects with Independent Errors

Suppose 100 hypothetical units each have the fixed regressor path \(x_i=(0,0,1)'\), and the errors are independent over units and periods with variance \(4\) outcome-units squared. Assume strict exogeneity. The regressor varies within each unit, and the repeated path makes the conditional variance calculation especially direct.

For each unit, demeaning gives \(M_3x_i=(-1/3,-1/3,2/3)'\), so \(x_i'M_3x_i=2/3\). Across 100 units, \(q_{FE}=100(2/3)=200/3\). The FE error weights for each unit are \((-1/2,-1/2,1)\), whose squared sum is \(1.5\). Thus,

$$ \operatorname{Var}(\hat{\beta}_{FE}\mid X) = \frac{100(1.5)(4)}{(200/3)^2} = 0.06. $$

For FD, the regressor changes are \((0,1)'\). The first difference contributes no regressor variation, and the second contributes one unit of squared variation per unit. The slope is consequently the average of the 100 final-period outcome changes, and its variance is

$$ \operatorname{Var}(\hat{\beta}_{FD}\mid X) = \frac{100(2)(4)}{100^2} = 0.08. $$

The conditional standard errors are \(\sqrt{0.06}=0.245\) and \(\sqrt{0.08}=0.283\), respectively, in outcome units per regressor unit. Under these assumptions and this regressor pattern, FE is more precise.

Persistent Errors: When First Differences Can Win

Positive serial correlation changes the comparison. Differencing replaces \(u_{it}\) with \(u_{it}-u_{i,t-1}\). If adjacent errors move together, much of their shared variation cancels. Demeaning also removes a unit’s common component, but it does not generally produce the same cancellation or error weights as differencing.

There is no universal rule that positive serial correlation favors FD for every regressor path. The relevant question is how the covariance affects the actual estimator weights. The next example keeps the regressor pattern and sample size from the independent-error example and changes only the error covariance.

Worked Example: First Differences with Strong Persistence

Keep \(N=100\) and \(x_i=(0,0,1)'\). Now suppose each unit’s errors have an AR(1)-type covariance matrix with marginal variance \(4\) and correlation \(0.9^{|t-s|}\) between periods \(t\) and \(s\):

$$ \Omega = 4 \begin{pmatrix} 1&0.9&0.81\\ 0.9&1&0.9\\ 0.81&0.9&1 \end{pmatrix}. $$

As before, FE gives each unit error weights \(a=(-1/2,-1/2,1)'\). Its variance contribution per unit, before averaging across units, is

$$ a'\Omega a = 4\left(1.5-0.5(0.9)-(0.9)^2\right) = 4(0.24) = 0.96. $$

For FD, the only identifying regressor change is the final one, so the slope uses \(u_{i3}-u_{i2}\). Its error variance per unit is

$$ \operatorname{Var}(u_{i3}-u_{i2}) = 4+4-2(4)(0.9) = 0.8. $$

Because the units are independent, averaging over 100 units gives \(\operatorname{Var}(\hat{\beta}_{FE}\mid X)=0.96/100=0.0096\), while \(\operatorname{Var}(\hat{\beta}_{FD}\mid X)=0.8/100=0.0080\). The corresponding standard errors are \(0.0980\) and \(0.0894\) outcome units per regressor unit. Here FD is more precise: the highly correlated adjacent errors in the identifying change largely cancel.

A Practical Comparison

The calculations lead to a useful, qualified summary. Under independent, equal-variance errors and the stated linear model, FE is at least as precise as FD among linear unbiased estimators. With persistent errors, differencing can reduce the contribution of common adjacent error movements and may deliver lower variance. Other covariance patterns and regressor paths can change the result again.

Precision is not the only consideration. Both transformations require within-unit regressor variation; neither can identify a slope on a time-invariant regressor after removing \(\alpha_i\). If the conditional mean-zero assumption fails, the fact that one estimator has a smaller variance does not make it unbiased. Inference must also account for the panel’s error dependence: an estimator’s point estimate and its standard error are separate issues.

Common Mistake

  • Wrong reasoning: “First differences use fewer transformed observations, so they must be less precise,” or, conversely, “differencing removes persistent errors, so it must always be more precise.”
  • Correction: Compare the conditional variances implied by the regressor paths and the within-unit error covariance. Under independent errors, FE has the efficiency advantage described above. Under sufficiently persistent errors, FD can have lower variance in some designs. Neither slogan is a general ranking.
Key takeaway: Fixed effects and first differences remove the same time-constant unit effect, but they apply different weights to the remaining errors. Their relative precision depends on the error covariance and the regressor paths—not on a universal preference for one transformation.

Check Your Understanding

Use the model and assumptions in this tutorial to answer the following questions.

  1. Why do both within demeaning and first differencing remove a time-constant unit effect?
  2. With two periods, why do the fixed-effects and first-difference slope estimates coincide?
  3. Under independent, equal-variance errors, what feature of the within transformation supports the efficiency result for fixed effects?
  4. In the persistent-error example, which difference identifies the slope, and why does its error variance fall as adjacent-error correlation rises?
  5. Why is it not correct to conclude that first differences are always more precise whenever errors are positively serially correlated?
Clinical Biostats