---
title: Fixed Effects OLS for Binary Panel Data
url: https://www.emergentmind.com/topics/fixed-effects-ordinary-least-square-ols-regression-model
type: topic
---

# Fixed Effects OLS for Binary Panel Data

The fixed effects ordinary least squares (FE–OLS) regression model is a staple approach for estimating the impact of covariates in grouped or panel data where unobserved group-specific heterogeneity may confound inference. Of particular interest is its application to binary outcome data ($y_{gi}\in\{0,1\}$), frequently encountered in political science and related fields, and its comparison to fixed effects logit estimators. Key methodological and interpretive distinctions arise depending on variation in the dependent variable within groups.

## 1. Model Specification and Estimation

The FE–OLS model for grouped binary data is given by
\[
y_{gi} = X_{gi}\beta + \alpha_g + u_{gi},
\]
where $y_{gi}$ is a binary outcome for unit $i$ in group $g$, $X_{gi}$ is a $1\times k$ vector of covariates, $\beta$ is the $k\times 1$ coefficient vector, $\alpha_g$ is the group-specific intercept (capturing fixed effects), and $u_{gi}$ is an idiosyncratic error. The error is assumed exogenous ($E[u_{gi}\mid X, \alpha]=0$) and homoskedastic for correct OLS inference [1809.06505][1810.12105].

Estimation proceeds via the within-group (demeaned) transformation:
\[
y_{gi}-\bar y_g =(X_{gi}-\bar X_g)\beta + (u_{gi}-\bar u_g),
\]
which, after stacking, yields the FE–OLS estimator:
\[
\hat\beta_{\rm FE} = (\tilde X'\tilde X)^{-1}\tilde X'\tilde y.
\]
This estimator utilizes all groups, including those with no within-group variation in $y_{gi}$ [1809.06505][1810.12105].

## 2. The Role of Zero-Variation Groups

Groups with no within-group variation in the binary outcome—either all $y_{gi}=0$ (“ALL-0”) or all $y_{gi}=1$ (“ALL-1”)—produce distinct effects on estimation:
- For such groups, the within-transformation zeroes out all $y_{gi}-\bar y_g$, rendering the group-specific slope estimate $\hat\beta_g=0$.
- The full-sample FE–OLS estimator can thus be expressed as a weighted average:
  \[
  \hat\beta_{\rm full} = \sum_{g=1}^G w_g \hat\beta_g,
  \]
  where $w_g$ reflects each group's “information weight” and $\hat\beta_g=0$ in all-zero/all-one groups [1810.12105].
- This mechanism “shrinks” the nonzero group slopes toward zero in proportion to the prevalence of these zero-variation groups [1809.06505][1810.12105].

By contrast, fixed effects logit (FE–Logit) estimators must drop groups with no within-group variation because the likelihood for such groups is maximized only as $\alpha_g \to \pm\infty$, leading to nonfinite parameter estimates [1809.06505][1810.12105].

## 3. Comparison with Fixed Effects Logit Methodologies

FE–OLS and FE–Logit models differ fundamentally in their treatment of groups with no variation in $y_{gi}$:
- **FE–OLS** retains all groups, assigning those without $y$ variation a zero-slope estimate.
- **FE–Logit** (and Chamberlain’s conditional logit, CLogit) necessarily excludes such groups, as they provide no information for estimating $\beta$ in the likelihood framework.

This means the two estimators apply to different data subsets unless a restricted-sample FE–OLS is computed on the set $\mathcal{V}$ of groups with both $y_{gi}=0$ and $y_{gi}=1$. Empirically and analytically (for $k=1$:
\[
\hat\beta_{\rm mixed} = \left(\sum_{g\in\mathcal{V}}X_g'X_g\right)^{-1}\sum_{g\in\mathcal{V}}X_g'y_g,
\]
the restricted-sample FE–OLS closely matches the FE–Logit average marginal effect, while the full-sample FE–OLS is strictly smaller in magnitude [1810.12105].

## 4. Marginal Effects and Interpretation

For continuous $x$:
- **FE–OLS:** Marginal effect is constant and equals $\hat\beta_{\rm FE}$:
  \[
  \Pr(y_{gi}=1)\approx X_{gi}\hat\beta_{\rm FE}+\hat\alpha_g \implies \text{marginal effect} = \hat\beta_{\rm FE}.
  \]
- **FE–Logit:** Marginal effect is unit- and observation-specific:
  \[
  \frac{\partial \Pr(y_{gi}=1)}{\partial x_{gi}} = \hat\beta \hat p_{gi}(1-\hat p_{gi}), \quad \hat p_{gi} = [1+\exp(-X_{gi}\hat\beta-\hat\alpha_g)]^{-1},
  \]
  with the sample-average marginal effect (SAME):
  \[
  \widehat{\rm SAME}_{\rm FELogit} = \frac{1}{GN} \sum_{g,i}\hat\beta\hat p_{gi}(1-\hat p_{gi}).
  \]
- **Two-step improvement:** Estimate $\hat\beta$ by CLogit, fix $\beta$, re-estimate the $\{\alpha_g\}$, and use these to compute marginal effects. This approach is at least as accurate as FE–OLS for SAME, and offers notable improvements when group sizes are small or the number of groups is large [1809.06505].

## 5. Incidental Parameters and Asymptotic Regimes

Neyman–Scott’s “incidental parameters problem” arises when both $G \to \infty$ and $N$ is finite, causing maximum likelihood estimators of the fixed effects and slopes in non-linear models to be inconsistent. However, for typical applications where $G$ is fixed and $N\to\infty$ (e.g., a fixed set of U.S. states or counties), this issue is illusory and FE–Logit remains consistent. Chamberlain’s conditional logit was developed for the opposite regime but is useful even when $G$ is fixed [1809.06505].

## 6. Reporting and Empirical Practice

Methodological transparency requires explicit identification of the set of groups used for estimation. Recommended practice is to report:
1. The full-sample FE–OLS estimator ($\hat\beta_{\rm full}$), which imposes the untestable identifying assumption of zero slope in zero-variation groups.
2. The restricted-sample FE–OLS estimator ($\hat\beta_{\rm mixed}$) on $\mathcal{V}$, the subset with $y_{gi}$ variation.
3. The FE–Logit average marginal effect, which operates on the same subset.

The difference between (1) and (2) quantifies the sensitivity to the zero-slope assumption in all-zero/all-one groups. If the gap is substantial, researchers must justify the assumption or rationale for application-specific treatment [1810.12105].

## 7. Practical Guidance and Application Domain

- **FE–OLS suffices and is computationally trivial** when within-group samples are large ($N > 30$), the number of groups is moderate ($G < 50$), and attention focuses on coefficient sign or significance rather than precise marginal probabilities.
- **FE–Logit (or CLogit plus two-step estimation)** is strongly preferred when group sizes are small, group count is large, nonlinearity is of interest, or accurate sample-average marginal effects are essential. This approach avoids linear probability model’s out-of-$[0,1]$ predictions and heteroskedastic errors [1809.06505].

A principled reporting standard is to present both the full-sample and restricted-sample FE–OLS estimates alongside FE–Logit results, illuminating the impact of dropped zero-variation groups and ensuring appropriate contextualization of statistical inference [1810.12105].

---

**References**:  
[1809.06505]: Estimating grouped data models with a binary dependent variable and fixed effects: What are the issues  
[1810.12105]: Estimating grouped data models with a binary dependent variable and fixed effect via logit vs OLS: the impact of dropped units

Source: https://www.emergentmind.com/topics/fixed-effects-ordinary-least-square-ols-regression-model