Panel Data and Fixed Effects

Using Repeated Observations to Control for Unobserved Heterogeneity

Fei Huang, UNSW Sydney

Where This Chapter Fits

Step 4: Do you observe the same units before and after treatment?

  • You arrive here when: No experiment, instrument, or cutoff is available, but you observe units repeatedly.
  • This chapter: Comparing units with themselves: fixed effects remove every confounder that does not change over time.
  • Next: Chapter 9: when treatment is a policy that switches on for some units at a known date.

See the design flowchart in Chapter 1.

In Practice: Panel Fixed Effects

Practitioner Summary

  • Use it when: you observe the same units repeatedly and their treatment changes over time
  • What you need: a panel with enough within-unit variation in treatment
  • What must hold: strict exogeneity: no confounders that change over time, and no feedback from past outcomes to treatment
  • Checks to run: residual variation after fixed effects; leads of treatment; selection into the panel; alternative fixed-effect structures; clustering at the level of treatment (wild bootstrap if clusters are few)
  • In R: feols(y ~ d + x | unit + time, data, cluster = ~unit), fepois() for counts
  • Telling a manager: “We compare each branch with itself in other periods, so nothing permanent about a branch can explain the result.”

Motivation

Do Hot Places Learn Less?

A Cross-Sectional Puzzle (Park et al. 2020)

Across countries: a 1°F increase in average annual temperature is associated with 0.02 SD lower PISA math scores.

Across US counties: students in the hottest decile score about 0.12 SD lower on grades 3–8 math tests.

Question: Is this relationship causal?

Why We Cannot Trust the Cross Section

Hot places differ from cool places in many ways:

  • Income, poverty, and school funding
  • Racial and ethnic composition (and historical discrimination)
  • Institutions, industry mix, urbanization
  • Disease burden, agricultural dependence

All of these affect test scores and are correlated with climate. A regression of scores on temperature across places mixes the effect of heat with the effect of everything else that differs across places.

The Panel Data Idea

Compare Units to Themselves

If we observe the same unit at multiple points in time, we can ask:

Does a student score lower after an unusually hot school year than the same student scored after an unusually cool school year?

  • The student’s ability, family background, neighborhood, and the region’s climate are the same in both comparisons.
  • Anything that is fixed over time cancels out, even if we never measure it.

This is the logic of fixed effects (FE).

Where Fixed Effects Fit in the Toolkit

Method Handles observed confounders Handles unobserved confounders Key assumption
RCT ✓ ✓ Random assignment
Matching / PSM ✓ ✗ Selection on observables
IV ✓ ✓ Exclusion restriction
RDD ✓ ✓ (near cutoff) Continuity at the cutoff
Fixed effects ✓ Only time-invariant Strict exogeneity
DiD ✓ Time-invariant + common shocks Parallel trends

Panel Data Basics

What Is Panel Data?

Definition

A panel (longitudinal) dataset observes the same units i = 1, \dots, N at multiple times t = 1, \dots, T.

  • Units: individuals, students, workers, firms, postcodes, counties, countries
  • Time: days, test sittings, tournament rounds, years
  • Balanced panel: every unit observed in every period
  • Unbalanced panel: some units missing in some periods (very common)

Not a panel: repeated cross sections, where different individuals are sampled each period (e.g., an annual survey that draws a new sample each year). These support group-level FE (e.g., state FE) but not individual FE.

Data Structure: Long Format

Code
# Panel data should be stored in "long" format: one row per unit-period
# Example: students who took the PSAT more than once
#
#  student_id  school  take  test_year  heat_prior_yr  score
#  1001        A       1     2008       71.2           -0.10
#  1001        A       2     2009       74.8           -0.05
#  1002        A       1     2008       71.2            0.35
#  1002        A       2     2009       74.8            0.31
#  2001        B       1     2010       63.5            0.62
#  2001        B       2     2011       62.1            0.97

library(tidyr)
# Converting from wide to long
panel_long <- pivot_longer(
  wide_data,
  cols = starts_with("score_"),
  names_to = "take",
  names_prefix = "score_",
  values_to = "score"
)

Sources of Variation in a Panel

Decomposing Variation

Any variable D_{it} can be split into:

D_{it} = \underbrace{\bar{D}_i}_{\text{between (across units)}} + \underbrace{(D_{it} - \bar{D}_i)}_{\text{within (over time, for one unit)}}

  • Between variation: Miami is hotter than Boston (on average)
  • Within variation: Boston had a hotter year in 2012 than in 2011

Cross-sectional regressions use mainly between variation. Fixed effects regressions use only within variation.

The causal question becomes: Is the within variation as good as random?

The Fixed Effects Model

The Model

Unobserved Effects Model

Y_{it} = \alpha_i + \tau D_{it} + X_{it}'\beta + \varepsilon_{it}

  • Y_{it}: outcome for unit i at time t
  • D_{it}: treatment or exposure (binary or continuous, e.g., temperature)
  • X_{it}: observed time-varying controls
  • \alpha_i: unit fixed effect: everything about unit i that does not change over time (ability, location, climate, management quality…)
  • \varepsilon_{it}: idiosyncratic shocks

The problem: \alpha_i is unobserved and likely correlated with D_{it}.

Why Pooled OLS Fails

Omitted Variable Bias

If we ignore \alpha_i and run pooled OLS of Y_{it} on D_{it}, the error term is (\alpha_i + \varepsilon_{it}):

\text{plim}\ \hat{\tau}_{\text{pooled}} = \tau + \frac{\text{Cov}(D_{it}, \alpha_i)}{\text{Var}(D_{it})}

Example (heat and learning):

  • \alpha_i = family and school resources
  • Hotter places have, on average, fewer resources: \text{Cov}(D_{it}, \alpha_i) < 0
  • Pooled OLS overstates the harm from heat

The bias does not shrink with more data. A larger cross section only gives a more precise estimate of the wrong number.

Removing \alpha_i: The Within Transformation

Demeaning Removes Anything Fixed

Average the model over time for each unit: \bar{Y}_i = \alpha_i + \tau \bar{D}_i + \bar{X}_i'\beta + \bar{\varepsilon}_i

Subtract from the original:

\underbrace{(Y_{it} - \bar{Y}_i)}_{\ddot{Y}_{it}} = \tau \underbrace{(D_{it} - \bar{D}_i)}_{\ddot{D}_{it}} + \ddot{X}_{it}'\beta + \ddot{\varepsilon}_{it}

\alpha_i is gone. Run OLS on demeaned data.

In practice, software does this for you (feols(y ~ d | unit, data)). Adding a dummy for every unit, or taking first differences, gives the same or closely related answers; see Going Deeper at the end of the chapter.

Whose Effect Does Fixed Effects Estimate?

Only Units That Change Treatment Count

  • Units whose treatment never changes (always or never treated) contribute nothing to the estimate; with time fixed effects they still help estimate the common time shocks
  • Units whose treatment varies more over time get more weight
  • So if effects differ across units, fixed effects give a weighted average that leans towards the units with the most variation, not the simple average effect (formula in Going Deeper)

Always ask: whose effect is the estimate weighting most heavily?

Two-Way Fixed Effects (TWFE)

Adding Time Fixed Effects

Y_{it} = \alpha_i + \lambda_t + \tau D_{it} + X_{it}'\beta + \varepsilon_{it}

  • \lambda_t: time fixed effects absorb shocks common to all units in period t
    • Recessions, national policy changes, test difficulty in a given year, secular warming trends
  • Identifying variation: deviations of D_{it} from both the unit mean and the period mean

Example: Without year FE, a nationwide warming trend combined with a nationwide trend in test scores would be attributed to heat. Year FE remove this.

TWFE and Difference-in-Differences

When D_{it} is a binary policy that switches on at a given date, TWFE is the regression form of difference-in-differences. With staggered adoption and heterogeneous effects, TWFE can produce badly weighted averages, in which some treatment effects even receive negative weights (Goodman-Bacon 2021; Chaisemartin and D’Haultfœuille 2020). We cover this in detail in the DiD lecture.

A Worked Example: State and Year Fixed Effects

Does Raising the Minimum Wage Reduce Employment?

A panel of states s observed over years t:

\text{Employment}_{st} = \alpha_s + \lambda_t + \beta \,\text{MinWage}_{st} + \varepsilon_{st}

Term Absorbs
Year FE \lambda_t Anything hitting all states in year t: national recessions, interest rates, federal policy, nationwide trends
State FE \alpha_s Persistent state differences: industry mix, cost of living, unionization, politics
\beta Identified from states changing their minimum wage at different times, relative to their own average and to the national year average

What It Still Assumes

No state-specific, time-varying shocks correlated with minimum-wage changes. If a state raises its minimum wage because its labour market is booming, strict exogeneity fails. Chapter 9 develops the event-study and DiD tools built for this setting.

Richer Fixed Effects: Interactions

FE Do Not Have to Be “Unit” and “Year”

Modern applications often use interacted fixed effects to make comparisons more local:

Fixed effect Comparison it forces
Student Same student, different test sittings
Postcode × month-year Same postcode, different days of the same month
Cohort × test date × take number Students taking the same test on the same date for the same time
Player + round + move number Same player, at the same stage of the game
Firm Same firm, different trading days

Rule of thumb: each additional FE removes a potential confounder and removes identifying variation. Choose them by asking what comparison do I believe is as good as random?

Identification

The Key Assumption: Strict Exogeneity

Strict Exogeneity

E[\varepsilon_{it} \mid D_{i1}, \dots, D_{iT}, X_{i1}, \dots, X_{iT}, \alpha_i] = 0 \quad \text{for all } t

In words: after removing the unit’s permanent characteristics (and common time shocks), the shocks to the outcome are unrelated to the treatment in any period, past, present, or future.

Equivalent intuition: the within-unit variation in treatment is as good as randomly assigned.

What Strict Exogeneity Rules Out

Threats to FE Identification

1. Time-varying confounders Something changes over time for unit i and affects both D_{it} and Y_{it}. Example: a local recession reduces both school AC maintenance and family resources.

2. Feedback / reverse causality Past outcomes affect future treatment: Y_{i,t-1} \rightarrow D_{it}. Example: a firm whose stock price fell cuts emissions. A worker who was injured changes jobs.

3. Anticipation and dynamic effects Future treatment affects current outcomes, or past treatment still matters today.

4. Lagged dependent variables Including Y_{i,t-1} as a regressor with unit FE violates strict exogeneity mechanically. This is the Nickell bias, of order 1/T (Nickell 1981).

5. Selection into the panel Whether unit i appears in period t depends on the treatment. Example: hot weather discourages students from retaking the test.

Why Weather Is the Ideal FE Treatment

The “Weather Design” (Dell et al. 2014; Hsiang 2016)

Three of this chapter’s case studies (Künn et al. 2023; Park et al. 2020; Ireland et al. 2023) use weather or air quality fluctuations as the treatment.

  • Climate (long-run averages) is correlated with everything: income, institutions, culture
  • Weather (deviations from the local norm) is plausibly random: no one chooses whether next Tuesday is 35°C

Unit (location) fixed effects remove climate. Time fixed effects remove seasonality and trends. What remains is weather, which is as close to a natural experiment as observational data get.

Caveat: weather effects ≠ climate effects. People adapt to persistent changes (AC, schedules, migration) in ways they cannot adapt to a single hot day.

Checking the Assumption

Diagnostic Toolkit

Check What it tests Used in
Placebo leads: future treatment should not predict current outcomes Reverse causality, spurious trends Park et al. (2020)
Selection tests: regress panel entry/attrition on treatment Selection into the sample Park et al. (2020)
Unit-specific trends: add \alpha_i \times t or region × t Smooth time-varying confounders Park et al. (2020)
Alternative FE structures: results stable? Sensitivity to the comparison Ireland et al. (2023)
Add potential confounders: pollution, precipitation, traffic Correlated time-varying shocks All four
Placebo outcomes or periods: heat on weekends, in summer Mechanism and specificity Park et al. (2020)
IV using a different source of variation Remaining endogeneity Künn et al. (2023)

Dynamic Effects: Leads and Lags

Treatment Need Not Act Only in the Same Period

Y_{it} = \alpha_i + \lambda_t + \sum_{k=-K}^{L} \beta_k \, D_{i,t-k} + \varepsilon_{it}

  • Lags (k > 0): effects can persist or accumulate. Park et al. (2020) find that hot school days two to four years before the test also lower scores, so the cumulative effect of a warmer climate is larger than the one-year estimate
  • Leads (k < 0): future treatment cannot cause today’s outcome. A significant lead signals reverse causality, anticipation, or a spurious trend. Park et al.’s (2020) future-temperature placebo is this test
  • When the treatment is a policy that switches on once and stays on, this becomes an event study, the central tool of Chapter 9

Practical Issues

How Much Variation Is Left?

Fixed Effects Can Absorb Most of Your Variation

Always report the residual standard deviation of the treatment after partialling out the fixed effects.

Park et al. (2020): after student and cohort × test date × take FE, a 1 SD change in average school-day temperature is only about 1°F, and 1 SD in days above 90°F is about 3 days.

Why it matters:

  • Effects are identified from small, local fluctuations
  • Extrapolating to large climate change scenarios requires assuming linearity and no adaptation
  • Precision depends on residual variation, not raw variation

Measurement Error Is Amplified by FE

Attenuation Bias Gets Worse

If treatment is measured with error, D^{obs}_{it} = D_{it} + u_{it}, OLS is attenuated by the factor

\frac{\text{Var}(\ddot{D}_{it})}{\text{Var}(\ddot{D}_{it}) + \text{Var}(\ddot{u}_{it})}

Demeaning removes much of the true signal (which is persistent) but little of the noise (which is not). The signal-to-noise ratio falls, so FE estimates are more attenuated than cross-sectional ones.

Park et al. (2020) evidence: restricting to schools within 5 miles of a weather station (less measurement error) raises the estimated effect by about 25%.

What You Cannot Estimate with Unit FE

Time-Invariant Variables Are Absorbed

With unit FE you cannot estimate the effect of anything that does not vary within unit:

  • Gender, race, birthplace (individual FE)
  • Long-run climate, geography (location FE)
  • Industry (firm FE, if firms do not switch)

But you can estimate interactions between a time-invariant characteristic and a time-varying treatment:

Y_{it} = \alpha_i + \lambda_t + \tau D_{it} + \delta (D_{it} \times \text{Black}_i) + \varepsilon_{it}

This is how Park et al. (2020) show heat harms Black and Hispanic students’ learning about three times as much as white students’.

Inference: Clustering Standard Errors

Errors Are Correlated Within Units and Within Shocks

  • The same student’s scores are correlated over time → cluster by unit
  • All students near the same weather station receive the same heat shock → cluster by level of treatment variation (Abadie et al. 2023)
  • Nearby stations have correlated weather → consider spatial correlation (Conley 1999) or cluster at a coarser level (e.g., state)
Paper Clustering level Why
Park et al. (2020) Weather station Treatment assigned at station level
Ireland et al. (2023) Postcode Unit of observation and treatment
Künn et al. (2023) Round × year (21 clusters) All players in a round share the same air

Few clusters (fewer than ~40–50): cluster-robust SEs are biased downward. Use the wild cluster bootstrap (Cameron et al. 2008).

Nonlinear Effects: Temperature Bins

Flexible Treatment: Bins

Rather than a linear term in temperature, count the days in each temperature bin:

Y_{it} = \alpha_i + \lambda_t + \sum_{b \neq \text{ref}} \beta_b \cdot \text{Days}^{(b)}_{it} + \varepsilon_{it}

Each \beta_b is the effect of replacing one day in the reference bin with one day in bin b. Both Park et al. (2020) and Ireland et al. (2023) use this to show damages that rise steeply at high temperatures.

Count Outcomes

Count Outcomes: Poisson Fixed Effects

For counts with many zeros (e.g., injury claims per postcode-day), use Poisson pseudo-maximum likelihood with FE:

E[Y_{it} \mid \cdot] = \exp(\alpha_i + \tau D_{it} + X_{it}'\beta)

  • \tau is a semi-elasticity: 100 \cdot \tau ≈ percent change in Y per unit of D
  • Consistent even if the data are not Poisson, as long as the mean is correctly specified (Wooldridge 1999)
  • Groups with all-zero outcomes carry no information and are dropped automatically

Simulation

Simulating the Bias and the Fix

Code
library(fixest)
setFixest_notes(FALSE)
set.seed(2026)

# Helper: "estimate (SE)" for the heat coefficient
heat_est <- function(m) {
  b <- coef(m)[grep("heat", names(coef(m)))][1]
  sprintf("%.4f (%.4f)", b, se(m)[names(b)])
}

N <- 1000   # students
n_t <- 4    # test sittings

# Long-run climate of each student's location (°F)
climate <- rnorm(N, mean = 65, sd = 5)

# Unobserved resources: lower in hotter places (the confounder)
alpha <- -0.05 * (climate - 65) + rnorm(N, 0, 0.3)

panel <- expand.grid(id = 1:N, t = 1:n_t)
year_shock <- c(0, 1.5, -1, 0.5)   # nationwide hot/cool years

panel$heat  <- climate[panel$id] + year_shock[panel$t] + rnorm(nrow(panel), 0, 1)
true_tau    <- -0.02
panel$score <- alpha[panel$id] + 0.1 * panel$t + true_tau * panel$heat +
               rnorm(nrow(panel), 0, 0.1)

# 1. Pooled OLS: confounded by alpha
m_pooled <- feols(score ~ heat + i(t), data = panel, cluster = ~id)

# 2. Unit fixed effects only
m_fe     <- feols(score ~ heat | id, data = panel, cluster = ~id)

# 3. Two-way fixed effects
m_twfe   <- feols(score ~ heat | id + t, data = panel, cluster = ~id)

# 4. First differences
panel    <- panel[order(panel$id, panel$t), ]
m_fd     <- feols(d(score) ~ d(heat), data = panel,
                  panel.id = ~id + t, cluster = ~id)

# Pooled OLS is over 3x too large. TWFE and FD recover the truth.
# Unit FE alone is slightly off: the year shocks happen to correlate with the score trend.
data.frame(
  model    = c("Pooled OLS", "Unit FE", "Two-way FE", "First differences"),
  estimate = sapply(list(m_pooled, m_fe, m_twfe, m_fd), heat_est),
  truth    = true_tau
)
              model         estimate truth
1        Pooled OLS -0.0693 (0.0018) -0.02
2           Unit FE -0.0256 (0.0016) -0.02
3        Two-way FE -0.0185 (0.0019) -0.02
4 First differences -0.0198 (0.0014) -0.02

Simulation: When FE Fails

Code
# Add a TIME-VARYING confounder: local economic shocks
# Bad economic years -> schools defer AC maintenance (more heat exposure)
#                    -> families have fewer resources (lower scores)
panel$econ_shock <- rnorm(nrow(panel), 0, 1)
panel$heat_ec    <- panel$heat - 0.8 * panel$econ_shock
panel$score_ec   <- alpha[panel$id] + 0.1 * panel$t + true_tau * panel$heat_ec +
                    0.05 * panel$econ_shock + rnorm(nrow(panel), 0, 0.1)

m_twfe_bad  <- feols(score_ec ~ heat_ec | id + t, data = panel, cluster = ~id)
m_twfe_ctrl <- feols(score_ec ~ heat_ec + econ_shock | id + t, data = panel,
                     cluster = ~id)

# FE cannot remove a confounder that varies within unit over time.
# Only measuring and controlling for it (or a better design) helps.
# This is why Park et al. control for county payroll in weather-exposed industries.
data.frame(
  model    = c("TWFE", "TWFE + econ_shock control"),
  estimate = sapply(list(m_twfe_bad, m_twfe_ctrl), heat_est),
  truth    = true_tau
)
                      model         estimate truth
1                      TWFE -0.0435 (0.0015) -0.02
2 TWFE + econ_shock control -0.0192 (0.0018) -0.02

Case Studies

Case Studies at a Glance

Paper Journal Question Panel Key fixed effects
Künn, Palacios & Pestel (2023) Management Science Does indoor air pollution impair expert decisions? Player × move Player; year; round; move
Ardia, Bluteau, Boudt & Inghelbrecht (2023) Management Science Do climate concerns move green vs. brown stocks? Firm × trading day Firm
Brynjolfsson, Li & Raymond (2025) QJE Does a generative AI assistant raise productivity? Agent × month Agent; month; tenure
Supplementary: Park, Goodman, Hurwitz & Smith (2020) AEJ: Economic Policy Does heat reduce learning? Student × test sitting Student; cohort × date × take
Supplementary: Ireland, Johnston & Knott (2023) J. Health Economics Does heat cause workplace injuries? Postcode × day Postcode × month-year

Case Study 1: Indoor Air Quality and Decisions

Künn, Palacios & Pestel (2023), Management Science (Künn et al. 2023)

Question: Does poor indoor air quality reduce the quality of strategic decisions by skilled individuals?

Setting: Official chess tournaments in Germany (2017–2019); 7 rounds per tournament, 3 tournaments → 21 rounds

Data:

  • ~30,000 moves by 121 players in 609 games
  • Each move scored by the Stockfish chess engine → objective measure of decision quality (error relative to the optimal move; indicator for a “meaningful error”)
  • Indoor PM2.5, CO2, temperature, humidity, and noise from sensors installed inside the venue

Why chess? Decisions are complex, objectively measurable, and highly incentivized (rating points, prize money). The same players repeatedly face the same task.

Case Study 1: Specification

Player Fixed Effects Model

Y_{ijtrm} = \alpha + \delta \cdot \text{PM2.5}_{tr} + X_{ijtrm}'\beta + \eta_i + \gamma_t + \lambda_r + \theta_m + V_{ijtrm}

  • i player, j opponent, t year, r round, m move
  • \eta_i: player FE: ability, age, experience, baseline health
  • \gamma_t: year FE: tournament-edition differences
  • \lambda_r: round FE: dynamics over the 8-week tournament
  • \theta_m: move FE: game phase (e.g., players err more near the time control at move 40 regardless of air quality)
  • X: other indoor conditions (CO2, temperature, humidity, noise), Elo difference with opponent and its square, points so far, board position before the move

Identifying assumption: players do not control when games are scheduled or the venue’s conditions, and opponents are assigned by tournament rules, so the remaining variation in PM2.5 is as good as random.

Case Study 1: Inference with Few Clusters

Only 21 Distinct Values of the Treatment

PM2.5 is measured once per round (during the second hour). All ~30,000 moves share only 21 values of the treatment.

  • Errors are correlated within a round (shared air, shared conditions)
  • Standard errors are clustered at the round × year level → 21 clusters
  • Conventional cluster-robust SEs are unreliable with so few clusters
  • The authors use wild cluster bootstrap p-values (Cameron et al. 2008)

Effective sample size: 30,000 observations ≠ 30,000 independent pieces of information about the treatment. The effective sample size is closer to the number of independent treatment shocks.

Case Study 1: Results

Main Findings

  • +10 μg/m³ PM2.5 (≈ 0.75 SD) → +2.1 percentage points probability of a meaningful error (+26% relative to the 8% baseline)
  • Equivalent to the player performing as if ~220 Elo points weaker
  • Effects concentrated at moves 31–40, just before the time control: +3.2 pp (+28%). Time pressure amplifies the damage from pollution
  • Larger effects for players facing a stronger opponent
  • Robustness: controls for traffic, attrition, nonlinear weather controls
  • Validation: an IV strategy using outdoor PM driven by wind direction and a replication using the German Chess Bundesliga (2003–2019) produce similar patterns

Case Study 1: What to Copy

Practices to Reuse

  • Choose a setting with an objective, repeated outcome. Engine-scored chess moves measure decision quality move by move.
  • Count independent shocks. There are 30,000 moves but only 21 rounds of air, so cluster by round and use the wild bootstrap.
  • Back up fixed effects with a different source of variation: wind-driven outdoor pollution as an instrument, and a replication in another league.

Case Study 1: Discussion Questions

  1. Why include move FE? What spurious result might appear without them?
  2. With year FE and round FE included, how much independent variation in PM2.5 remains across the 21 rounds? How would you show this to a reader?
  3. Indoor PM2.5 mostly comes from outdoor sources. What outdoor time-varying factors (traffic, weather) might affect both PM2.5 and player performance? How do the authors address them?
  4. Why is the IV approach a useful complement to the FE design here?
  5. Chess players are not typical workers. What does this setting tell us about managers and other knowledge workers, and what does it not tell us?

Case Study 1: Suggested Answers (1–2)

  1. Errors are more frequent at certain stages of a game, such as the moves before the time control. If high-pollution rounds happened to have more late-game moves, pollution would appear to cause errors through game length alone.
  2. There are 21 round values. With 3 year effects and 7 round effects, about 21 − 3 − 7 + 1 = 12 degrees of freedom remain for PM2.5. Show it with the standard deviation of PM2.5 after removing year and round effects, or a plot of the residual values.

Case Study 1: Suggested Answers (3–4)

  1. Traffic and weather (temperature, pressure, humidity) can raise pollution and affect players. The authors control for indoor temperature, humidity, CO2, and noise, add traffic and flexible weather controls, and use an instrument based on wind direction.
  2. Wind direction changes outdoor pollution reaching the venue for reasons unrelated to the players or the room. It addresses indoor sources linked to crowding, and it can also reduce bias from error in the indoor measurements.

Case Study 1: Suggested Answers (5)

  1. It shows that skilled decisions under time pressure get worse with poor air, which is relevant to offices and control rooms. It does not show effects on team decisions, long exposures, tasks without time pressure, or how much people adapt.

Case Study 2: Climate Concerns and Stock Returns

Ardia, Bluteau, Boudt & Inghelbrecht (2023), Management Science (Ardia et al. 2023)

Question: Do green firms outperform brown firms on days when concern about climate change rises unexpectedly? (A test of the model in Pástor et al. (2021).)

Data:

  • Daily returns of S&P 500 firms, Jan 2010 – Jun 2018
  • Firm greenness: GHG emissions intensity (tonnes CO2e per $1M revenue), lagged one year to avoid look-ahead bias
  • A new daily Media Climate Change Concerns (MCCC) index from 10 major US newspapers and 2 newswires
  • UMC_t: unexpected concern = prediction error from an autoregressive model of MCCC with financial, energy, and macro controls

Case Study 2: Specification

Firm Fixed Effects with a Common Shock × Firm Exposure

r_{i,t} = c_i + \gamma^{lGHG}\, lGHG_{i,t} + \left(\gamma^{UMC} + \gamma^{UMC}_{lGHG}\, lGHG_{i,t}\right) UMC_t + \beta_i'\,\text{CTRL}_t + \epsilon_{i,t}

  • r_{i,t}: excess return of firm i on day t
  • c_i: firm FE (firm-specific average return)
  • lGHG_{i,t}: cross-sectionally standardized log emissions intensity
  • UMC_t: daily unexpected change in climate concerns (common to all firms)
  • \beta_i: firm-specific loadings on market, factor, energy, and macro controls
  • Parameter of interest: \gamma^{UMC}_{lGHG}: do higher-emitting firms react more negatively to climate concern shocks? Prediction: < 0

Case Study 2: Results

Main Findings

  • Portfolio level: a one-unit increase in UMC raises the daily green-minus-brown return by 7.2 basis points; brown stocks fall more than green stocks rise
  • Firm panel: \hat\gamma^{UMC}_{lGHG} \approx -0.022 to -0.027, highly significant across four sets of controls
  • The effect holds within industries and for firms that do not disclose emissions (using imputed industry averages)
  • Strongest for transition-risk themes (business impact, societal debate); physical-risk effects appear mainly at the finer topic level
  • Monthly decomposition points mainly to a discount-rate channel

Case Study 2: What Fixed Effects Can and Cannot Do Here

The Authors Explicitly Avoid a Causal Interpretation

This case is useful precisely because the FE do less work here:

  • The treatment is a pure time series. UMC_t is the same for every firm on a given day. Firm FE remove permanent differences between firms, but cannot address confounders that hit the market on the same day as a climate news shock.
  • Reverse causality / feedback: stock market moves could generate climate news (the authors filter market-related articles and use the AR prediction error to reduce this).
  • Identification comes from the interaction: do high-emission firms react differently from low-emission firms to the same shock? This is an exposure design, similar in spirit to shift-share or “continuous DiD” designs.

Case Study 2: What If We Add Date Fixed Effects?

Extension to Discuss

If we add date FE \lambda_t, the main effect \gamma^{UMC} is absorbed (it does not vary across firms on a given day), but \gamma^{UMC}_{lGHG} remains identified, and any market-wide confounder on climate-news days is removed.

r_{i,t} = c_i + \lambda_t + \gamma^{lGHG}\, lGHG_{i,t} + \gamma^{UMC}_{lGHG}\, (lGHG_{i,t} \times UMC_t) + \epsilon_{i,t}

What would remain as a threat? (Hint: news days that differentially affect energy-intensive industries for reasons unrelated to climate concern, e.g., oil price shocks.)

Case Study 2: What to Copy

Practices to Reuse

  • When treatment is a market-wide time series, use differential exposure. The same news shock should hit high-emission firms harder.
  • Use the unexpected part of a news index, not its level.
  • Be explicit about what the design supports. The authors avoid causal language; adding date fixed effects is one way to go further.

Case Study 2: Discussion Questions

  1. Why do the authors use the unexpected component of the concern index rather than its level?
  2. Firm FE absorb a firm’s average return. What does the lGHG_{i,t} coefficient then capture, given that emissions intensity changes slowly within firm?
  3. The model allows firm-specific loadings \beta_i on the controls. Why is this more flexible than a common \beta?
  4. Compare to Park et al. (2020, Supplementary Case A): in both papers a common shock (weather / news) interacts with heterogeneous exposure (AC / emissions). What is the analogue of the triple-difference AC design here?
  5. Would you call this paper a policy evaluation? What policy questions could it inform (e.g., climate disclosure rules, carbon pricing announcements)?

Case Study 2: Suggested Answers (1–3)

  1. Prices should react to news, not to what investors already expected. The predictable part of the concern index is already in prices and may move with other market conditions; the surprise is closer to new information.
  2. With firm fixed effects it is identified only from changes in a firm’s emissions intensity relative to other firms, which are small and slow. It says little about the cross-sectional carbon premium and is imprecisely estimated.
  3. Firms differ in their exposure to the market, other risk factors, and energy prices. A common slope would push those differences into the error, which could be correlated with emissions and with climate news.

Case Study 2: Suggested Answers (4–5)

  1. Interact the climate shock with changes in a firm’s own emissions intensity over time: does the same firm react less to climate news after it becomes greener? That uses within-firm variation, like Park et al.’s (2020) within-school changes in air conditioning.
  2. Not a policy evaluation in the usual sense: there is no policy treatment. It informs policy by showing that investors price climate concern, which matters for disclosure rules and for how carbon-price announcements could affect firms’ cost of capital.

Case Study 3: Generative AI at Work

Brynjolfsson, Li & Raymond (2025), QJE (Brynjolfsson et al. 2025)

Question: Does a generative AI assistant raise the productivity of customer-support workers?

Setting: a Fortune 500 software firm. An assistant built on GPT-3 reads live customer chats and suggests replies; agents can accept, edit, or ignore them.

Panel: 5,172 agents observed monthly, 89% outside the US. Main outcome: resolutions per hour.

Why fixed effects are needed: AI access was rolled out agent by agent, and managers chose who went first. Agents who eventually got access were already more productive beforehand (2.0 vs. 1.7 resolutions per hour). A cross-sectional comparison would credit AI with that gap.

Case Study 3: How the Estimate Changes as Fixed Effects Are Added

The Estimate Shrinks as Fixed Effects Are Added

Fixed effects Effect of AI access on resolutions per hour
Year-month + location +0.47 (+24%)
+ Agent +0.37
+ Agent tenure (months on the job) +0.30 (+15%), the preferred estimate
  • Agent FE remove permanent differences between agents. Treated agents were already more productive before access, so the drop from 0.47 to 0.37 is consistent with stronger agents getting access earlier
  • Tenure FE account for experience, which changes over time: new agents improve quickly whether or not they have AI. AI access cannot change tenure, so it is a valid control, not a bad control
  • Identifying variation: the same agent before vs. after access, compared with agents in the same month and at the same tenure who do not (yet) have access
  • Standard errors clustered by agent, the level at which access was assigned

Case Study 3: What Fixed Effects Cannot Fix

Two Remaining Threats, and How the Authors Respond

Selection on trends: if managers onboarded agents who were about to improve anyway, agent FE do not help. The authors instrument each agent’s access date with the date the first member of their team got access, and report a small randomized pilot with similar effects.

Staggered timing with dynamic effects: access arrives in different months, and effects could change with experience of the tool. Static TWFE can then be biased; the authors confirm the result with heterogeneity-robust event-study estimators. Chapter 9 treats this paper as a difference-in-differences case study.

Main Findings

  • +15% resolutions per hour on average; about +30% for the least skilled and newest agents
  • Little gain, and a small quality decline, for the most skilled agents
  • Productivity stays higher even during AI outages, consistent with learning

Case Study 3: What to Copy

Practices to Reuse

  • Show how the estimate moves as fixed effects are added (0.47 → 0.37 → 0.30): a simple way to show selection.
  • Control for time-varying traits the treatment cannot change (tenure), never for ones it can (hours worked).
  • Name what fixed effects cannot fix (selection on trends) and bring separate evidence: a team-level instrument and a randomized pilot.

Case Study 3: Discussion Questions

  1. Why does the estimate fall when agent FE are added? What does that tell you about who got AI access first?
  2. Tenure varies over time. Why is it a legitimate control here, whereas “hours worked” would not be?
  3. Which agents contribute to identifying the effect, and which only help estimate the month and tenure effects?
  4. What specific manager behaviour would violate strict exogeneity?
  5. Compare with Case Study 1: there, nobody controls the air in the room; here, managers chose who was treated. How does that change how much you trust fixed effects alone?

Case Study 3: Suggested Answers (1–3)

  1. Agent fixed effects remove permanent differences between agents. The estimate falls because agents who got access had higher productivity to begin with, so stronger agents tended to get access earlier.
  2. Tenure increases by one month every month whatever happens, and AI access cannot change it. Hours worked could respond to AI access, so controlling for them would remove part of the effect (a bad control).
  3. Agents whose access status changes while they are observed identify the effect. Agents who never get access, or have it throughout, only help estimate the month and tenure effects.

Case Study 3: Suggested Answers (4–5)

  1. Giving access to agents after an unusually bad month, so they recover anyway; choosing agents expected to improve; or giving treated agents easier chats after access.
  2. When nobody chooses the treatment, within-unit variation is plausibly as good as random. When managers choose, selection on trends is possible, so fixed effects need support from other evidence, such as the team-level instrument and the pilot.

Supplementary Case Studies

Two Weather Panels Beyond the FT50 List

The next two papers appear in field journals rather than FT50 journals. They are included because they show fixed-effect choices the main cases do not:

  • Student vs. school fixed effects, and why the choice matters for selection (Park et al. 2020, AEJ: Economic Policy)
  • Postcode × month-year fixed effects with a Poisson model for count data, using Australian workers’ compensation records (Ireland et al. 2023, Journal of Health Economics)

Both are also the source of several examples earlier in this chapter.

Supplementary Case A: Heat and Learning

Park, Goodman, Hurwitz & Smith (2020), AEJ: Economic Policy (Park et al. 2020)

Question: Does cumulative heat exposure during the school year reduce learning?

Data:

  • PSAT scores for ~10 million students who took the test at least twice (21 million scores, high school classes of 2001–2014)
  • Daily max temperature from ~3,000 NOAA weather stations, matched to each high school
  • New survey-based measures of school air conditioning (AC)

Why panel data? Hot regions (the South) have lower scores and differ in income, race, and school resources. The cross section cannot separate heat from these factors.

Supplementary Case A: Specification

Student Fixed Effects Model

\text{Score}_{iscyn} = \beta\,\text{Heat}_{sy} + \eta_i + \gamma_{cyn} + \epsilon_{iscyn}

  • i student, s school, c graduating class, y test year, n take number
  • \text{Heat}_{sy}: average daily max temperature on school days in the 365 days before the test
  • \eta_i: student FE: ability, family background, school, location, and climate
  • \gamma_{cyn}: cohort × test year × take number FE: test difficulty on a given date, practice effects from retaking, national trends

Identifying variation: the same student’s score after a hotter vs. cooler school year, relative to all other students taking the test on the same date for the same time.

Standard errors: clustered by weather station, the level at which heat varies.

Supplementary Case A: Design Choices Worth Discussing

Why Student FE Instead of School FE? (Footnote 15)

School FE would require that who takes the PSAT at a school does not change over time in ways correlated with heat. Empirically, PSAT-taking expanded to more students over the period, especially in regions with different warming trends. Student FE avoid this selection margin entirely, because each student is compared only with themselves.

Trade-off: only retakers identify \beta. Retakers are more advantaged than the average test-taker (higher-income ZIP codes, more college-educated mothers), though they are geographically similar.

Selection Tests

  • Within-school fluctuations in heat do not predict the number or demographic composition of first-time test-takers
  • Heat does not predict whether a student retakes the test

Supplementary Case A: Results

Main Findings

  • A 1°F hotter school year lowers PSAT scores by about 0.002 SD (≈ 1% of a typical year’s learning gain)
  • Hot days: each additional school day in the 90s (°F), relative to one in the 60s, reduces achievement by about one-sixth of a percent of a year’s learning
  • Robust to controls for precipitation, test-day weather, pollution, local economic conditions (county payroll in weather-exposed industries), and state-specific trends
  • Placebo: heat in the years after the test does not predict scores
  • Mechanism: summer and weekend heat have little effect; only school-day heat matters, which points to disrupted instructional time
  • Heterogeneity (interaction with time-invariant traits): effects are about three times larger for Black and Hispanic students and can explain roughly 3–7% of the racial achievement gap
  • AC: a triple-difference design (student FE + within-school changes in AC over time) suggests air conditioning largely offsets heat’s impact

Supplementary Case A: What to Copy

Practices to Reuse

  • Pick the fixed effects that remove the selection you fear. Student, not school, fixed effects, because who took the test changed over time.
  • Test selection into the sample directly: heat does not predict who takes or retakes the test.
  • Use mechanism placebos. Summer and weekend heat have little effect, pointing to lost school time.

Supplementary Case A: Discussion Questions

  1. The cross-country slope is about −0.02 SD per °F; the within-student estimate is about −0.002 SD per °F. What does the gap tell you about omitted variable bias in the cross section?
  2. Only retakers identify \beta. To whom does the estimate apply? How would you assess external validity?
  3. Why does the null effect of summer heat strengthen the causal interpretation?
  4. The paper notes that FE estimates capture short-to-medium-run effects. What long-run adaptations (teacher sorting, building upgrades) would they miss?
  5. Why cluster by weather station rather than by student?

Supplementary Case A: Suggested Answers (1–2)

  1. The within-student estimate is about a tenth of the cross-country slope, so most of the cross-sectional association reflects differences between places (income, institutions, schools), not heat. The comparison is rough, since the tests and units differ.
  2. To students who take the PSAT more than once, who are more advantaged than average. Compare retakers with all takers, check whether effects vary with income, or reweight to the wider population.

Supplementary Case A: Suggested Answers (3–4)

  1. If heat only proxied for local economic or health shocks, summer and weekend heat would also predict scores. They do not, which points to lost learning on school days.
  2. Air conditioning installed over time, changes to school calendars, teachers moving, and families moving. Fixed-effect estimates from year-to-year swings may overstate long-run damage if people adapt, or understate it if harm accumulates.

Supplementary Case A: Suggested Answers (5)

  1. Heat varies at the weather-station level, so all students near a station share the same shocks and their errors are correlated. Clustering by student would treat those shocks as independent and understate standard errors.

Supplementary Case B: Heat and Worker Health

Ireland, Johnston & Knott (2023), Journal of Health Economics (Ireland et al. 2023)

Question: Does high ambient temperature cause occupational injuries and illnesses?

Data:

  • 2.16 million workers’ compensation claims from Victoria, Australia’s mandatory, no-fault scheme, 1985–2020
  • Daily claims aggregated to 694 postcodes → a postcode × day panel (3.5 million observations; 71% of postcode-days have zero claims)
  • Daily max temperature interpolated to postcode centroids (residual inverse distance weighting)

Why this setting? Mandatory insurance gives near-complete coverage of serious claims, over 35 years, in a state with large day-to-day temperature swings (often more than 20°C within a postcode-month).

Supplementary Case B: Specification

Poisson Model with Postcode × Month-Year FE

E[\text{claims}_{pt} \mid X] = \exp\left(\beta \cdot \text{maxtemp}_{pt} + \phi_{pm} + \gamma' X_{pt}\right)

  • p postcode, t day, m month-year
  • \phi_{pm}: postcode × month-year FE: 1 FE for each postcode in each month of each year
    • Absorbs local industry mix, workforce size, seasonality, local economic conditions, and any slow-moving changes
  • X_{pt}: day-of-week dummies, precipitation
  • Sample: weekdays; postcode-months with zero claims on every day are dropped (no within variation)

Identifying variation: day-to-day temperature differences within the same postcode in the same month.

Supplementary Case B: Results

Main Findings

  • 1°C higher daily max → 0.24% more claims (≈ 0.5 extra claims/day statewide)
  • A day at 33–36°C has about 5.3% more claims than a day at 18–21°C
  • Effects concentrated among laborers and tradespersons (0.35%), especially in agriculture and construction
  • No evidence of adaptation: the effect for high-risk workers is stable across five-year periods since 1985 and largest in 2015–2019
  • Within manual occupations, female, older, and higher-earning workers are most affected

Supplementary Case B: Sensitivity to the FE Structure

Ireland et al. (2023), Table 2

Specification Semi-elasticity (%)
Postcode × month-year FE (main) 0.24 (0.020)
+ PM2.5 control 0.20 (0.021)
+ Calendar-date FE 0.27 (0.020)
Separate postcode × month FE and month-year FE 0.22 (0.021)

Stable estimates across FE structures are reassuring evidence that the result does not depend on one particular comparison.

Supplementary Case B: What to Copy

Practices to Reuse

  • For counts with many zeros, use Poisson fixed effects, not the log of the outcome plus one.
  • Use interacted fixed effects to make comparisons local: a hot day vs. a mild day in the same postcode and month.
  • Report a table of estimates across fixed-effect structures, so readers see the result does not hinge on one comparison.

Supplementary Case B: Discussion Questions

  1. Why is the outcome a count and the estimator Poisson rather than OLS on log claims? What happens to postcode-days with zero claims under each approach?
  2. The authors exclude PM2.5 from the preferred specification because industrial activity, itself affected by accidents and heat, contributes to pollution. Is pollution a confounder or a bad control (a mediator)?
  3. The number of workers at risk each day is unobserved and may fall on hot days. What does the estimate therefore measure: the effect on risk per worker, or the net effect after behavioral adjustment?
  4. Days above 36°C show smaller effects than 33–36°C. Name two explanations (policy thresholds that stop work? measurement?) and how you would test them.

Supplementary Case B: Suggested Answers (1–2)

  1. Most postcode-days have zero claims, and the log of zero is undefined. OLS on logs drops those days or needs an arbitrary transformation such as log(y + 1). Poisson keeps zero days and gives a percentage effect; only postcode-months with no claims at all drop out, because they carry no information.
  2. Both are possible. If heat raises industrial activity or accidents that create pollution, pollution lies on the path from heat to claims and is a bad control. If weather drives both heat and pollution, it is a confounder. The authors report both versions (0.24 without, 0.20 with).

Supplementary Case B: Suggested Answers (3–4)

  1. The net effect: claims change through risk per worker and through fewer people working or shorter hours on hot days. If exposure falls on hot days, the effect on risk per worker is larger than the estimate.
  2. Work may stop on extreme days, through employer rules or agreements, so fewer people are exposed; and very hot days are rare, so estimates are imprecise and temperature interpolation is noisiest at the extremes. Test with data on hours, occupations covered by stop-work rules, and the confidence intervals.

Comparing the Designs

Absorbed by FE Remaining identifying variation Main remaining threat
Künn Player skill and health; game phase; tournament dynamics Round-to-round indoor PM2.5 Few independent shocks; outdoor co-pollutants
Ardia Firm average return Same-day shock × firm emissions intensity Market-wide confounders on news days; feedback
Brynjolfsson Agent ability; month shocks; experience Same agent before vs. after AI access Managers selecting agents on trends
Park Student ability, background, location, climate; test-date difficulty Year-to-year school-day heat for the same student Time-varying local shocks; measurement error
Ireland Postcode industry mix, workforce, seasonality, local economy in that month Day-to-day temperature within postcode-month Unobserved hours worked; extreme-heat work stoppages

Implementing the Case Study Specifications

Code
library(fixest)

# Case 1 — Künn et al.: player + year + round + move FE, few clusters
m_kunn <- feols(meaningful_error ~ pm25 + co2 + temp + humidity + noise +
                  elo_diff + I(elo_diff^2) + points_so_far + pawn_prev |
                  player + year + round + move,
                data = chess, cluster = ~round_year)
# Wild cluster bootstrap p-value (e.g., fwildclusterboot in R, boottest in Stata)
# fwildclusterboot::boottest(m_kunn, param = "pm25", clustid = "round_year", B = 9999)

# Case 2 — Ardia et al.: firm FE with shock x exposure interaction
m_ardia <- feols(ret ~ lghg + umc + lghg:umc + mkt + hml + smb | firm,
                 data = stocks)
# Extension: date FE absorb umc main effect; interaction still identified
m_ardia_dfe <- feols(ret ~ lghg + lghg:umc | firm + date,
                     data = stocks, cluster = ~firm + date)

# Case 3 — Brynjolfsson et al.: the fixed-effects ladder
m_bryn <- feols(rph ~ ai_access | csw(year_month + location, agent, tenure_months),
                data = agents, cluster = ~agent)   # csw() adds FE step by step

# Supplementary A — Park et al.: student FE + cohort x test-date x take FE
m_park <- feols(score ~ heat_school_days | student_id + cohort^test_date^take,
                data = psat, cluster = ~weather_station)

# Supplementary B — Ireland et al.: Poisson with postcode x month-year FE
m_ireland <- fepois(claims ~ maxtemp + precip + i(day_of_week) |
                      postcode^month_year,
                    data = claims_daily, cluster = ~postcode)

Best Practices

Checklist for a Fixed Effects Analysis

Before Estimating

  1. State the comparison your FE impose in plain language (“same student, different years”)
  2. Argue why the remaining variation is as good as random. Which confounders could vary within unit over time?
  3. Pick the FE structure to match that argument, not to maximize R^2
  4. Decide the clustering level from how treatment is assigned

After Estimating

  1. Report residual variation in treatment after FE
  2. Show robustness to alternative FE structures, trends, and controls
  3. Run placebo tests: leads of treatment, placebo outcomes or periods
  4. Test for selection into the panel and attrition
  5. Discuss whose effect is estimated (who has within variation?) and over what time horizon
  6. Separate short-run weather effects from long-run climate effects when relevant

Common Pitfalls

Mistakes to Avoid

  • “I included fixed effects, so it’s causal.” FE only remove time-invariant confounders
  • Adding a lagged outcome with unit FE in short panels (Nickell bias)
  • Controlling for mediators (“bad controls”), e.g., controlling for hours worked when estimating heat’s effect on output
  • Over-saturating FE until almost no variation remains, then over-interpreting a noisy estimate
  • Clustering too finely (e.g., by individual when treatment varies by region)
  • Ignoring few clusters
  • Using binary staggered TWFE without checking for heterogeneous-effect problems (Chapter 9)
  • Extrapolating from small within-unit fluctuations to large permanent changes

Summary

Key Concepts:

  • Panel data let us compare units to themselves
  • Fixed effects remove all time-invariant confounders, observed or not
  • Identification requires strict exogeneity: within-unit variation is as good as random

Practical Lessons:

  • Interacted FE (e.g., postcode × month) make comparisons more local
  • More FE → less bias from slow-moving confounders, but less variation and more measurement-error attenuation
  • Cluster at the level of treatment variation; use the wild bootstrap with few clusters

Summary: Lessons from the Case Studies

  • Pollution and weather shocks + person or location FE give credible natural experiments (Künn; Park; Ireland)
  • When people choose who is treated, unit FE remove selection on levels but not on trends (Brynjolfsson)
  • When the treatment is a common time series, FE alone are not enough (Ardia)
  • Interactions with time-invariant traits reveal heterogeneity (race, occupation, skill)

Next Steps

  1. Read: Künn et al. (2023) Sections 3–4; Brynjolfsson et al. (2025) Section IV
  2. Practice: Run the simulation, then extend it with heterogeneous effects \tau_i and check what TWFE estimates
  3. Assignment: Choose one case study and write a one-page referee report on its identification strategy
  4. Next Class: Difference-in-differences, where TWFE meets policy adoption

Going Deeper (Optional)

Potential Outcomes Interpretation

Connecting to the Causal Framework

Write potential outcomes for unit i at time t under treatment level d:

Y_{it}(d) = \alpha_i + \lambda_t + \tau d + \varepsilon_{it}

The observed outcome is Y_{it} = Y_{it}(D_{it}).

Implicit assumptions in this model:

  1. Additivity: unit and time heterogeneity enter as level shifts
  2. Constant effect: \tau is the same for all i, t (we relax this later)
  3. No carryover: Y_{it} depends on D_{it} but not on D_{i,t-1} (unless we model it)
  4. No interference: unit i’s outcome does not depend on unit j’s treatment (SUTVA)

Fixed effects allow selection on time-invariant unobservables: units can choose their treatment based on \alpha_i.

Other Ways to Remove \alpha_i

Least Squares Dummy Variables (LSDV)

Include a dummy for every unit: Y_{it} = \sum_j \alpha_j \mathbb{1}[i=j] + \tau D_{it} + \varepsilon_{it}

Numerically identical \hat\tau to the within estimator (Frisch–Waugh–Lovell theorem).

First Differences (FD)

\Delta Y_{it} = Y_{it} - Y_{i,t-1} = \tau \Delta D_{it} + \Delta X_{it}'\beta + \Delta \varepsilon_{it}

Identical to FE when T = 2. With T > 2 they differ in efficiency, depending on the serial correlation in \varepsilon_{it}.

The Within Estimator and Its Weights

What FE Actually Computes

\hat{\tau}_{FE} = \frac{\sum_i \sum_t (D_{it} - \bar{D}_i)(Y_{it} - \bar{Y}_i)}{\sum_i \sum_t (D_{it} - \bar{D}_i)^2}

Implications:

  • Units with no within variation in D (always treated or never treated) contribute nothing to \hat\tau (with time fixed effects they still help estimate the common time shocks)
  • Units with more within variation get more weight
  • If each unit has its own effect \tau_i (constant over time) and strict exogeneity holds, unit FE estimate a variance-weighted average of unit-specific effects, not the simple ATE:

\operatorname{plim}_{N \to \infty} \hat\tau_{FE} = \frac{E\big[\text{Var}_i(D)\,\tau_i\big]}{E\big[\text{Var}_i(D)\big]}, \qquad \text{Var}_i(D) = \frac{1}{T}\sum_t (D_{it} - \bar D_i)^2

Always ask: whose effect is the FE estimate weighting most heavily?

Fixed Effects vs. Random Effects

Random Effects (RE)

RE treats \alpha_i as a random draw uncorrelated with D_{it} and uses GLS for efficiency.

  • But \text{Cov}(\alpha_i, D_{it}) \neq 0 is the reason for using panel data
  • In causal work, RE is rarely credible
  • Hausman test: compares FE and RE; a significant difference rejects RE (with caveats about power and clustering)

Correlated random effects (Mundlak, 1978): add the unit means \bar{D}_i as regressors. The coefficient on D_{it} equals the FE estimate, and time-invariant variables can still be included, although their coefficients are causal only under further assumptions (Mundlak 1978).

References

Abadie, Alberto, Susan Athey, Guido W Imbens, and Jeffrey M Wooldridge. 2023. “When Should You Adjust Standard Errors for Clustering?” The Quarterly Journal of Economics 138 (1): 1–35.
Ardia, David, Keven Bluteau, Kris Boudt, and Koen Inghelbrecht. 2023. “Climate Change Concerns and the Performance of Green Vs. Brown Stocks.” Management Science 69 (12): 7607–32. https://doi.org/10.1287/mnsc.2022.4636.
Brynjolfsson, Erik, Danielle Li, and Lindsey Raymond. 2025. “Generative AI at Work.” The Quarterly Journal of Economics 140 (2): 889–942. https://doi.org/10.1093/qje/qjae044.
Cameron, A Colin, Jonah B Gelbach, and Douglas L Miller. 2008. “Bootstrap-Based Improvements for Inference with Clustered Errors.” The Review of Economics and Statistics 90 (3): 414–27.
Chaisemartin, Clément de, and Xavier D’Haultfœuille. 2020. “Two-Way Fixed Effects Estimators with Heterogeneous Treatment Effects.” American Economic Review 110 (9): 2964–96. https://doi.org/10.1257/aer.20181169.
Conley, Timothy G. 1999. “GMM Estimation with Cross Sectional Dependence.” Journal of Econometrics 92 (1): 1–45.
Dell, Melissa, Benjamin F Jones, and Benjamin A Olken. 2014. “What Do We Learn from the Weather? The New Climate-Economy Literature.” Journal of Economic Literature 52 (3): 740–98.
Goodman-Bacon, Andrew. 2021. “Difference-in-Differences with Variation in Treatment Timing.” Journal of Econometrics 225 (2): 254–77.
Hsiang, Solomon. 2016. “Climate Econometrics.” Annual Review of Resource Economics 8: 43–75.
Ireland, Andrew, David Johnston, and Rachel Knott. 2023. “Heat and Worker Health.” Journal of Health Economics 91: 102800. https://doi.org/10.1016/j.jhealeco.2023.102800.
Künn, Steffen, Juan Palacios, and Nico Pestel. 2023. “Indoor Air Quality and Strategic Decision Making.” Management Science 69 (9): 5354–77. https://doi.org/10.1287/mnsc.2022.4643.
Mundlak, Yair. 1978. “On the Pooling of Time Series and Cross Section Data.” Econometrica 46 (1): 69–85.
Nickell, Stephen. 1981. “Biases in Dynamic Models with Fixed Effects.” Econometrica 49 (6): 1417–26.
Park, R. Jisung, Joshua Goodman, Michael Hurwitz, and Jonathan Smith. 2020. “Heat and Learning.” American Economic Journal: Economic Policy 12 (2): 306–39. https://doi.org/10.1257/pol.20180612.
Pástor, Ľuboš, Robert F Stambaugh, and Lucian A Taylor. 2021. “Sustainable Investing in Equilibrium.” Journal of Financial Economics 142 (2): 550–71.
Wooldridge, Jeffrey M. 1999. “Distribution-Free Estimation of Some Nonlinear Panel Data Models.” Journal of Econometrics 90 (1): 77–97.