Static Models Tutorials¶
Learning Path
Prerequisites: Fundamentals tutorials completed Time: 5--8 hours Level: Beginner -- Advanced
Overview¶
Static panel models are the workhorses of empirical research. These tutorials cover every major estimator -- from Pooled OLS through Fixed Effects, Random Effects, Between and First Difference estimators, to Instrumental Variables -- with hands-on code and real datasets.
You will learn when to use each estimator, how to choose between Fixed and Random Effects with the Hausman test, and how to apply robust standard errors and two-way fixed effects. The advanced notebooks tackle IV estimation and systematic model comparison workflows.
The existing Static Models Tutorial provides additional context on the theory behind these models, including the decision tree for choosing between estimators.
Notebooks¶
Fundamentals¶
| # | Tutorial | Level | Time | Colab |
|---|---|---|---|---|
| 1 | Pooled OLS Introduction | Beginner | 30 min | |
| 2 | Fixed Effects | Beginner | 45 min | |
| 3 | Random Effects & Hausman Test | Intermediate | 45 min |
Advanced¶
| # | Tutorial | Level | Time | Colab |
|---|---|---|---|---|
| 4 | First Difference & Between | Intermediate | 45 min | |
| 5 | Panel IV (2SLS) | Advanced | 60 min | |
| 6 | Comparison of Estimators | Intermediate | 45 min |
Expert¶
| # | Tutorial | Level | Time | Colab |
|---|---|---|---|---|
| 7 | IV Diagnostics Advanced | Advanced | 60 min |
Learning Paths¶
Basic (3 hours)¶
Essential models for any panel analysis:
Notebooks: 1, 2, 3
Covers Pooled OLS, Fixed Effects, Random Effects, and the Hausman test. Sufficient for most applied work.
Advanced (5 hours)¶
Add alternative estimators and comparison workflows:
Notebooks: 1, 2, 3, 4, 6
Includes First Difference, Between estimator, and a systematic model comparison framework.
Complete (8 hours)¶
Master every static estimator including IV:
Notebooks: 1--7
Adds Instrumental Variables (2SLS), IV diagnostics, and advanced comparison techniques.
Key Concepts Covered¶
- Pooled OLS: When pooling is appropriate and its limitations
- Fixed Effects: Within transformation, entity demeaning, time-invariant variables
- Random Effects: GLS estimation, RE assumptions, efficiency gains
- Hausman test: Systematic FE vs RE selection
- Between estimator: Cross-sectional variation only
- First Difference: Alternative to FE for persistent data
- Two-way FE: Entity and time fixed effects simultaneously
- Panel IV: Two-stage least squares for endogeneity
- Robust SE: Heteroskedasticity and cluster-robust standard errors
Quick Example¶
import panelbox as pb
data = pb.load_dataset("grunfeld")
# Fixed Effects
fe = pb.FixedEffects(
data=data, formula="invest ~ value + capital",
entity_col="firm", time_col="year"
).fit()
# Random Effects
re = pb.RandomEffects(
data=data, formula="invest ~ value + capital",
entity_col="firm", time_col="year"
).fit()
# Hausman test: FE vs RE
from panelbox.validation import hausman_test
hausman = hausman_test(fe, re)
print(f"Hausman p-value: {hausman.pvalue:.4f}")
Related Documentation¶
- Getting Started Tutorial -- First steps with PanelBox
- Static Models Tutorial -- Detailed walkthrough with theory
- Standard Errors Tutorials -- Robust inference for panel models
- Validation & Diagnostics -- Testing model assumptions
- User Guide -- API reference