Skip to main content

1. Classical Linear and Instrumental Variables Regression

Verified Environments & Platforms:EcoDataEcoLabFincoVietLOD

Chapter 1. Classical Linear and Instrumental Variables Regression provides step-by-step How-To implementation guides for 24 econometric model lessons organized across 4 methodological parts from Section 1.1.1 to 1.4.13. Every guide is synchronized with the full academic lecture at VietLOD Chapter 1 and supports automated cloud execution on EcoLab.

Video Tutorial: How-To Guide for Chapter 1: Classical Linear and Instrumental Variables Regression in Stata 18, R 4.x, and Python 3.11+

1.1. Central Research Question and Core Mathematical Specification​

  • Central Research Question: How to estimate consistent linear causal effects under heteroskedasticity, outliers, multi-way high-dimensional fixed effects, and endogenous regressors?
  • Chapter Architecture: Encompasses 4 specialized methodological parts from 1.1 to 1.4 and 24 empirical model lessons validated on Vietnamese datasets from EcoData and Finco.

Core structural equation for Chapter 1:

Yi=Xi⊤β+εi,E[Ziεi]=0Y_i = X_i^\top \beta + \varepsilon_i, \quad \text{E}[Z_i \varepsilon_i] = 0
Methodological Scope Boundary:Classical linear models are inappropriate when the dependent variable is binary, categorical, censored, or follows non-stationary unit-root dynamics. Mandatory diagnostics for this chapter include: Breusch–Pagan, White, VIF, Ramsey RESET, Kleibergen–Paap rk Wald F, Montiel Olea–Pflueger Effective F, Hansen J.

1.2. Explore the 4 Methodological Parts in Chapter 1​

1.3. Four-Step Workflow for Selecting and Executing Models in Chapter 1​

Step 1. Select the Appropriate Methodological Part From 1.1 to 1.4

Match your economic hypothesis and sample structure against the identification requirements in Chapter 1 to select the appropriate A.B.C model lesson.

Step 2. Prepare Standardized Datasets From EcoData or Finco

Download the standardized .csv practice file for your target estimator from /src/ecoaz/data/ or extract live empirical series from EcoData and Finco.

Step 3. Estimate Parameters and Run Diagnostics in Stata 18, R 4.x, and Python 3.11+

Execute the tri-engine scripts provided in each model guide and verify the mandatory post-estimation diagnostics: Breusch–Pagan, White, VIF, Ramsey RESET, Kleibergen–Paap rk Wald F, Montiel Olea–Pflueger Effective F, Hansen J.

Step 4. Verify Three-Software Convergence and Export Publication Tables on EcoLab

Confirm numerical convergence across Stata, R, and Python using the three-panel empirical figure and generate journal-grade tables on EcoLab.

1.4. Complete Directory of 24 Econometric Model Lessons in Chapter 1​

SectionEconometric Model Lesson TitleEstimator KeyLevelSoftware Packages Stata · R · PythonSupport
1.1.11.1.1. Ordinary Least Squares — OLSolsL1base Stata · stats + sandwich · statsmodelsAvailable
1.1.21.1.2. Weighted Least Squares — WLSwlsL1base Stata · stats · statsmodelsAvailable
1.1.31.1.3. Generalized Least Squares — GLSglsL1base Stata · nlme · statsmodelsAvailable
1.1.41.1.4. Feasible Generalized Least Squares — FGLSfglsL2base Stata · nlme · statsmodelsAvailable
1.2.11.2.1. Huber Robust Linear Regressionrobust_rlmL2base Stata · MASS · statsmodelsAvailable
1.2.21.2.2. Conditional Quantile Regressionquantile_regressionL2base Stata · quantreg · statsmodelsAvailable
1.3.11.3.1. Two-Stage Least Squares — IV-2SLSiv_2slsL1base Stata · AER · linearmodelsAvailable
1.3.21.3.2. Limited-Information Maximum Likelihood — LIMLiv_limlL2base Stata · AER / ivmodel · linearmodelsAvailable
1.4.11.4.1. High-Dimensional Fixed Effects OLShdfe_olsL3reghdfe · fixest · pyfixestAvailable
1.4.21.4.2. High-Dimensional Fixed Effects Two-Stage Least Squareshdfe_ivL3ivreghdfe · fixest · pyfixestAvailable
1.4.31.4.3. Shift-Share Bartik Instrumental Variablesbartik_shift_share_ivL3ssaggregate / ivreg2 · ShiftShareSE · linearmodelsAvailable
1.4.41.4.4. Lewbel Heteroskedasticity-Based Instrumental Variableslewbel_het_ivL4ivreg2h · REndo · linearmodelsAvailable
1.4.51.4.5. Control Function Endogeneity Estimatorcontrol_function_ivL4etregress · fixest + boot · statsmodelsAvailable
1.4.61.4.6. Instrumental Variables Quantile Regressioniv_quantileL4Stata 18 ivqregress · quantreg · statsmodelsAvailable

| 1.1.5 | 1.1.5. Constrained and Restricted Least Squares | constrained_least_squares | L4 | cnsreg · car · scipy | Available | | 1.1.6 | 1.1.6. Nonlinear Least Squares Gauss Newton | nonlinear_least_squares | L4 | nl · stats · scipy | Available | | 1.1.7 | 1.1.7. Errors in Variables Reliability Adjusted and Deming Regression | errors_in_variables_eiv | L4 | eivreg · deming · numpy | Available | | 1.4.7 | 1.4.7. Continuously Updated Generalized Method of Moments | continuously_updated_gmm | L4 | ivregress · gmm · scipy | Available | | 1.4.8 | 1.4.8. Iterated Generalized Method of Moments | iterated_gmm | L4 | ivregress · gmm · statsmodels | Available | | 1.4.9 | 1.4.9. Jackknife and Split Sample Instrumental Variables | jive_split_sample_iv | L4 | jive · SteinIV · numpy | Available | | 1.4.10 | 1.4.10. Reduced Rank Multivariate Regression Anderson | reduced_rank_regression | L4 | canon · rrpack · numpy | Available | | 1.4.11 | 1.4.11. Fuller Modified Limited Information Maximum Likelihood | fuller_modified_liml | L4 | ivregress · ivmodel · linearmodels | Available | | 1.4.12 | 1.4.12. Maximum Empirical Likelihood Moment Estimator | empirical_likelihood_owen | L4 | gmm · gmm · scipy | Available | | 1.4.13 | 1.4.13. Two Step Control Function Regression with Endogeneity Test | control_function_endogenous | L4 | eregress · First-stage lm residual augmentation + sandwich · statsmodels | Available |

1.5. Key Academic References​

  • Wooldridge(2020). Econometric specification, identification, and asymptotic inference.
  • Angrist, J. D, & Pischke, J.-S.(2009). Mostly Harmless Econometrics: An Empiricist's Companion. Princeton University Press.
  • Correia(2016). Econometric specification, identification, and asymptotic inference.
  • Lewbel(2012). Econometric specification, identification, and asymptotic inference.
  • Borusyak, Hull, & Jaravel(2022). Econometric specification, identification, and asymptotic inference.
  • Wooldridge, J. M.(2019). Introductory Econometrics: A Modern Approach, 7th ed, Chương 2–8 & 15. Cengage Learning.
  • Hansen, B. E.(2022). Econometrics, Chương 4, 7 & 12: Least Squares & Instrumental Variables. Princeton University Press.
  • Greene, W. H.(2019). Econometric Analysis, 8th ed, Chương 2–5 & 8. Pearson.
  • Cameron, A. C, & Trivedi, P. K.(2022). Microeconometrics Using Stata, 2nd ed, Vol. 1, Chương 3 & 6–7. Stata Press.