Definition: Panel data (also called longitudinal data) consists of observations on the same individuals (entities) over multiple time periods.
Panel Data Structure:
| Entity | Time | Y | X₁ | X₂ | ... | Xₖ |
|---|---|---|---|---|---|---|
| 1 | 1 | y₁₁ | x₁₁₁ | x₂₁₁ | ... | xₖ₁₁ |
| 1 | 2 | y₁₂ | x₁₁₂ | x₂₁₂ | ... | xₖ₁₂ |
| 1 | T | y₁T | x₁₁T | x₂₁T | ... | xₖ₁T |
| 2 | 1 | y₂₁ | x₁₂₁ | x₂₂₁ | ... | xₖ₂₁ |
| 2 | 2 | y₂₂ | x₁₂₂ | x₂₂₂ | ... | xₖ₂₂ |
| N | T | yNT | x₁NT | x₂NT | ... | xₖNT |
Types of Panel Data:
| Type | Description | Example |
|---|---|---|
| Balanced Panel | All entities have the same number of time periods | N=100, T=10, total=1000 obs |
| Unbalanced Panel | Some entities have missing observations | Firms enter/exit the sample |
| Short Panel | N large, T small (N >> T) | Many firms, few years |
| Long Panel | N small, T large (N << T) | Few countries, many years |
Why Use Panel Data?
| Advantage | Description |
|---|---|
| Control for Unobserved Heterogeneity | Entity-specific effects are captured |
| More Variation | Both cross-section and time variation |
| Dynamic Effects | Study adjustment over time |
| Better Identification | Control for omitted variables bias |
| More Observations | N × T vs N (cross-section) or T (time) |
The General Panel Model:
Where:
The Error Components:
| Component | Description | Properties |
|---|---|---|
| μᵢ | Entity-specific effect | Time-invariant, captures unobserved heterogeneity |
| εᵢₜ | Idiosyncratic error | Varies across both i and t, assumed i.i.d. |
Key Assumptions:
The entity effect μᵢ captures all unobserved, time-invariant factors that affect Y:
Examples of μᵢ:
Key Question: Is μᵢ correlated with the regressors?
What Is Pooled OLS?
Pooled OLS simply ignores the panel structure and estimates:
It pools all observations together (N × T observations).
Pooled OLS is valid only if:
If μᵢ ≠ 0 and correlated with X: Pooled OLS is biased and inconsistent.
When to Use Pooled OLS:
| Situation | Recommendation |
|---|---|
| μᵢ = 0 (no entity effects) | Use Pooled OLS |
| μᵢ ≠ 0 but uncorrelated with X | Use Random Effects (more efficient) |
| μᵢ ≠ 0 and correlated with X | Use Fixed Effects |
The Fixed Effects Model:
Key Assumption: μᵢ is correlated with X (allows for arbitrary correlation).
Estimation Methods:
Subtract the entity-specific mean from each variable:
Where:
This removes μᵢ because μᵢ - μᵢ = 0.
Subtract the previous period:
This also removes μᵢ because μᵢ - μᵢ = 0.
Include entity-specific dummies:
Where Dⱼ = 1 if entity = j, 0 otherwise.
Properties of FE:
| Property | Description |
|---|---|
| Consistent | As N → ∞ or T → ∞ |
| Unbiased | Only if T is fixed (within transformation) |
| Efficiency | OLS on transformed data is BLUE |
| Time-Invariant Variables | Cannot be estimated (they are differenced out) |
Advantages of FE:
Disadvantages of FE:
The Random Effects Model:
Key Assumption: μᵢ is uncorrelated with X (Cov(X, μ) = 0).
The Error Structure:
Variance Structure:
Estimation: GLS (Feasible GLS)
RE uses Generalized Least Squares (GLS):
Where Ω is the variance-covariance matrix of the errors.
In practice, we use Feasible GLS (FGLS) with estimated variance components:
The GLS Transformation:
Where:
Special cases:
Properties of RE:
| Property | Description |
|---|---|
| Consistent | If Cov(X, μ) = 0 |
| Efficient | Uses both within and between variation |
| Can Estimate | Time-invariant variables |
| Biased | If Cov(X, μ) ≠ 0 |
Advantages of RE:
Disadvantages of RE:
Choosing Between FE and RE:
The Hausman test determines whether the RE assumption (Cov(X, μ) = 0) is valid.
The Test:
Null Hypothesis: H₀: Cov(X, μ) = 0 (RE is consistent)
Alternative: H₁: Cov(X, μ) ≠ 0 (RE is inconsistent, FE is consistent)
The Test Statistic:
Under H₀, H ~ χ²(k), where k = number of time-varying regressors.
Interpretation:
| Result | Decision | Meaning |
|---|---|---|
| p ≥ 0.10 | Use RE | RE is consistent and efficient |
| p < 0.05 | Use FE | RE is inconsistent |
| 0.05 ≤ p < 0.10 | Marginal | Use FE to be safe |
Understanding the Components:
Panel data contains two types of variation:
Variation of a variable around its entity-specific mean:
Captures: Changes within entities over time
Used by: Fixed Effects (FE)
Variation of entity-specific means:
Captures: Differences across entities
Used by: Between Estimator
Which Estimator Uses What?
| Estimator | Variation Used | Interpretation |
|---|---|---|
| Pooled OLS | Total | Mix of within and between |
| FE | Within only | Changes within entities over time |
| RE | Weighted mix | Both within and between |
| Between | Between only | Differences across entities |
The Dynamic Panel Model:
Many economic processes are dynamic:
Where Yᵢ,ₜ₋₁ is the lagged dependent variable.
Why Dynamics Matter:
Nickell Bias (1981): In short panels (T small), FE is biased and inconsistent.
Source of bias: The lagged dependent variable Yᵢ,ₜ₋₁ is correlated with μᵢ, and the within transformation induces correlation with εᵢ,ₜ₋₁.
Arellano-Bond GMM
The Arellano-Bond Difference GMM estimator addresses the Nickell bias.
Difference GMM:
First-difference the model to remove μᵢ:
Instruments:
Use lagged values of Y and X as instruments:
Validity: Lagged values are correlated with Yᵢ,ₜ₋₁ but uncorrelated with Δεᵢₜ.
System GMM
Blundell-Bond System GMM improves efficiency by combining:
Better for: Persistent series (Y is close to a random walk)
GMM Diagnostics:
| Test | Purpose | Rule |
|---|---|---|
| AR(1) | Test for first-order autocorrelation | Expected (p < 0.05) |
| AR(2) | Test for second-order autocorrelation | Should not be significant (p > 0.05) |
| Sargan/Hansen J | Overidentification test | p > 0.10 (instruments valid) |
Research Question: What is the elasticity of output with respect to inputs?
Dataset: Firm-level panel data (N=5000 firms, T=10 years)
Model:
Endogeneity Concern: Input choices are correlated with productivity (μᵢ)
Solution: FE or IV with lagged inputs
| Variable | OLS | FE | System GMM |
|---|---|---|---|
| Capital | 0.12** | 0.08** | 0.09** |
| Labor | 0.45** | 0.38** | 0.40** |
| Materials | 0.35** | 0.32** | 0.33** |
Research Question: What determines economic growth?
Dataset: Country-year panel (N=100 countries, T=30 years)
Model:
Endogeneity Concern: Growth affects investment (simultaneity)
Solution: FE + GMM
| Variable | FE | System GMM |
|---|---|---|
| Initial GDP | -0.02** | -0.01** |
| Investment | 0.15** | 0.12** |
| Education | 0.08** | 0.06** |
| Trade | 0.05** | 0.04** |
Research Question: How does insurance affect healthcare utilization?
Dataset: Individual-year panel (N=10,000 individuals, T=5 years)
Model:
Endogeneity Concern: Health status affects both insurance and utilization
Solution: FE (controls for individual health status)
| Variable | Pooled OLS | FE |
|---|---|---|
| Insured | 2.45** | 1.12** |
| Age | 0.03** | 0.02** |
| Income | 0.01** | 0.00 |
| N | 50,000 | 50,000 |
Interpretation: The OLS estimate is biased upward because healthier people are more likely to be insured.
Checklist for Panel Data Analysis:
Common Mistakes to Avoid:
| Mistake | Why It's Wrong | What To Do Instead |
|---|---|---|
| Using Pooled OLS with entity effects | Biased and inconsistent | Use FE or RE |
| Using FE for time-invariant variables | Dropped from estimation | Use RE or between estimator |
| Ignoring serial correlation | Inefficient SEs | Use clustered SEs |
| Overinterpreting FE estimates | FE uses only within variation | Interpret as changes over time |
| Using GMM with too many instruments | Overfitting | Limit instruments |
Panel Models Summary:
| Model | Key Feature | Assumption | Estimation |
|---|---|---|---|
| Pooled OLS | Ignore panel structure | μᵢ = 0 | OLS |
| Fixed Effects (FE) | Entity-specific intercepts | Cov(X, μ) ≠ 0 | Within |
| Random Effects (RE) | Random entity effects | Cov(X, μ) = 0 | GLS |
| Between | Between variation only | Cov(X, μ) ≠ 0 | OLS on means |
Hausman Test Summary:
FE vs RE Comparison:
| Aspect | FE | RE |
|---|---|---|
| Assumption | Cov(X, μ) ≠ 0 | Cov(X, μ) = 0 |
| Time-invariant variables | Cannot estimate | Can estimate |
| Efficiency | Less efficient | More efficient |
| Consistency | Always consistent | Consistent only if assumption holds |
Key Takeaways:
Checklist Before Proceeding:
In the next chapter, we will cover: