Panel Simple Linear Regression

Statistics
Introduced by
Hsiao (1986); Baltagi (seminal textbook treatments)
Year
1986
Type
Linear regression (panel data)
Family
Regression / GLM

What does it do?

Panel simple linear regression models a continuous outcome as a linear function of a single predictor using data that track the same entities (individuals, firms, countries) across multiple time periods.

It separates within-entity variation from between-entity variation, enabling control for unobserved time-invariant characteristics that would confound a plain cross-sectional regression.

The intuition behind the method

Imagine measuring a student's test score and study hours every semester for several years. A plain regression mixes up differences between students with changes within the same student over time. Panel regression lets you strip out each student's fixed characteristics — innate ability, family background — and ask: when this particular student studied more, did their score rise? This within-entity comparison is the core advantage of the panel approach, even with only one predictor.

History

Panel regression methods were developed in econometrics and are now a standard tool in applied work. Textbook treatments such as Wooldridge (2010) and Baltagi (2021) set out the framework, including the within (fixed-effects) estimator and the choice between fixed and random effects. The single-predictor case is a special case of these general panel regression methods.

When to use it

Use panel simple linear regression when you have one continuous outcome, one continuous predictor, and repeated observations on the same entities over time. Fixed effects is the natural choice when you suspect entity-specific characteristics that are correlated with the predictor; random effects can be more efficient when that correlation is absent (see the effect-choice step). Do not use it when the predictor does not vary within entities, since fixed effects removes it, or when you need to estimate the effect of a time-invariant predictor. Very short panels are permitted (T = 2 is the minimum for fixed effects), but they give imprecise within-entity estimates, particularly when the number of entities is also small. If other observed variables plausibly confound the relationship, use panel multiple linear regression instead.

Limitations and considerations

  • Fixed effects absorb time-invariant predictors, so their coefficients cannot be estimated under this specification.
  • The slope is identified only from within-entity changes in x; when x hardly changes over time for most entities, the estimate is imprecise.
  • Controls only for unobserved time-invariant heterogeneity; time-varying confounders stay in the error term and can bias the slope.
  • The within estimate describes how the outcome changes as x changes within entities, which can differ from the cross-sectional relationship between entities.
  • In short panels where a lagged outcome is added as a predictor, fixed-effects estimation is subject to Nickell bias.
  • Consistency requires strict exogeneity of x, meaning x must be uncorrelated with the error in every period, not only the current one. Feedback from the outcome to the predictor violates this condition and biases the fixed-effects slope even after entity effects are removed; contemporaneous exogeneity alone is not sufficient.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Removes all time-invariant unobserved entity characteristics from the slope by demeaning within entity, so the slope is not driven by fixed differences between entities.
  • The fixed-effects slope remains consistent when entity effects are correlated with the predictor, provided the predictor is strictly exogenous within each entity.
  • Uses only over-time variation within each entity, so the slope answers a specific question: how the outcome moves when the predictor moves for the same entity.
  • The within transformation works with unbalanced panels, because each entity's means are computed from the periods it actually has.
  • Computationally light: the estimator is OLS applied to demeaned data.

Applications

  • Estimating the effect of a single policy variable (e.g., minimum wage) on an outcome (e.g., employment) across states or countries over time.
  • Tracking the within-firm relationship between one input (e.g., R&D spending) and one output (e.g., productivity) using multi-year firm data.
  • Studying how a single environmental factor (e.g., temperature anomaly) predicts an outcome (e.g., crop yield) across regions and years.
  • Examining within-student or within-school variation in a single instructional variable and its link to test performance in education research.
  • Modelling the relationship between a single financial indicator and stock returns for a panel of companies over multiple quarters.

How it works

How it works

1

Each observation is indexed by entity i and time period t. The entity-specific intercept alpha_i absorbs all time-invariant unobserved characteristics of that entity. The single slope beta captures how the outcome changes with the predictor, net of those entity effects.

Formula
y_{it} = \alpha_i + \beta x_{it} + \varepsilon_{it}
2

The fixed-effects (within) estimator demeans both the outcome and the predictor by their entity-specific time averages. This removes alpha_i from the equation, so beta is identified from over-time variation within each entity. alpha_i may be correlated with x, but x must be uncorrelated with the idiosyncratic error in every period for the same entity.

Formula
(y_{it} - \bar{y}_i) = \beta(x_{it} - \bar{x}_i) + (\varepsilon_{it} - \bar{\varepsilon}_i)
3

After demeaning, beta is estimated by OLS on the transformed data. The fixed-effects estimator is algebraically equivalent to including a dummy variable for each entity, but the demeaning approach is computationally efficient for large panels.

Formula
\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}
4

Choose fixed effects (FE) when entity effects may be correlated with the predictor; the Hausman test formalises this choice. Random effects (RE) is more efficient when entity effects are uncorrelated with the predictor, but its estimates are biased when that assumption fails. Pooled OLS ignores entity effects altogether, so it is biased whenever they are correlated with the predictor.

5

Standard errors should be clustered at the entity level to account for within-entity serial correlation across time periods. Clustered standard errors remain valid under heteroskedasticity of unknown form and arbitrary serial correlation within entities, provided the number of entities is reasonably large. With a small number of entities, cluster-robust standard errors can be unreliable, and small-sample or bootstrap corrections such as the wild cluster bootstrap should then be considered. The slope beta is the average change in the outcome, in units of y per unit of x, associated with a one-unit change in x within the same entity. This is a within-entity association and supports a causal reading only under strict exogeneity. The within R-squared reports the share of within-entity variation in the outcome explained by the predictor, not the share of total variation.

Common pitfalls

  • Failing to cluster standard errors at the entity level understates their size and inflates t-statistics; with few clusters, clustered standard errors can be unreliable and the corrections noted in the inference step should be considered.
  • Using pooled OLS or random effects when the Hausman test rejects RE: when entity effects are correlated with x, both estimators are inconsistent for the slope.
  • Including a time-invariant predictor with fixed effects: the variable is perfectly collinear with the entity dummies and will be dropped.
  • Ignoring Nickell bias when adding a lagged outcome as a predictor in short panels; dynamic panel GMM (Arellano-Bond) is the usual alternative.
  • Treating an unbalanced panel as balanced without checking whether missingness is related to the outcome; if entities drop out because of the outcome, estimates suffer from attrition bias.

Frequently asked questions

Should I use fixed effects or random effects?

Run the Hausman test. If it rejects the null hypothesis that the entity effects are uncorrelated with the predictor at conventional significance levels, fixed effects is the consistent choice and random effects estimates would be biased. If it does not reject, this is not proof that the entity effects are uncorrelated with the predictor, because the test has limited power in finite samples. Random effects may then be considered for its efficiency, but only if its no-correlation assumption is supported on theoretical grounds and the predictor varies enough within entities.

Why must I cluster standard errors?

Observations from the same entity are correlated over time. Ordinary (non-clustered) standard errors treat them as independent, which dramatically overstates precision. Clustering at the entity level corrects for this within-entity dependence.

What if my single predictor barely varies within entities?

Fixed effects identify the slope only from within-entity changes. If the predictor is nearly time-invariant for most entities, the within variation is small and the fixed-effects estimator will have very large standard errors, effectively uninformative. Consider random effects if entity effects and the predictor are plausibly uncorrelated, or acknowledge the identification limitation.

Can I use this with only two time periods per entity?

Yes. T = 2 is the minimum for fixed effects. With exactly two periods, the within estimator gives the same slope as first differencing. The estimate can be computed, but it is imprecise when the number of entities is also small.

When should I add more predictors?

If other observed variables confound the relationship between your predictor and outcome, include them; that is panel multiple linear regression. Omitting relevant time-varying confounders biases the slope even with fixed effects controlling for unobserved time-invariant heterogeneity.

Related methods

Sources

  1. Wooldridge, J. M. (2010). Econometric Analysis of Cross Section and Panel Data (2nd ed.). MIT Press.

    ISBN: 978-0262232586
  2. Baltagi, B. H. (2021). Econometric Analysis of Panel Data (6th ed.). Springer.

    ISBN: 978-3030534875