1.1. Classical Least Squares
Methodological Part 1.1. Classical Least Squares in 1. Classical Linear and Instrumental Variables Regression provides step-by-step How-To implementation guides for 7 econometric model lessons spanning from Section 1.1.1 to 1.1.7. Full theoretical derivations are available at VietLOD Part 1.1 alongside cloud execution on EcoLab.
Video Tutorial: How-To Guide for Part 1.1: Classical Least Squares in Stata 18, R 4.x, and Python 3.11+
1.1.1. Methodological Overview and Structural Equations
- Methodological Focus: Provides consistent estimation and robust inference for Classical Least Squares specifications within Classical Linear and Instrumental Variables Regression.
- Mandatory Post-Estimation Diagnostics: Kiểm định phương sai thay đổi Breusch–Pagan và White, hệ số phóng đại phương sai đa cộng tuyến (VIF), kiểm định dạng hàm Ramsey RESET, kiểm định phân phối chuẩn phần dư Jarque–Bera.
Core structural specification for Part 1.1:
Estimator objective and moment conditions:
1.1.2. Econometric Model Lessons in Part 1.1
Estimates the Ordinary Least Squares — OLS specification within the Classical Least Squares framework by optimizing the structural objective...
Estimates the Weighted Least Squares — WLS specification within the Classical Least Squares framework by optimizing the structural objective...
Estimates the Generalized Least Squares — GLS specification within the Classical Least Squares framework by optimizing the structural object...
Estimates the Feasible Generalized Least Squares — FGLS specification within the Classical Least Squares framework by optimizing the structu...
1.1.3. Comparative Execution Syntax Across Stata 18, R 4.x, and Python 3.11+
| Section & Model Title | Estimator Key | Stata 18 MP Syntax | R 4.x Syntax | Python 3.11+ Syntax | Support |
|---|---|---|---|---|---|
| 1.1.1 · Ordinary Least Squares — OLS | ols | regress y x1 x2, vce(robust) | lm(y ~ x1 + x2, data = df) | smf.ols('y ~ x1 + x2', data=df).fit(cov_type='HC1') | Available |
| 1.1.2 · Weighted Least Squares — WLS | wls | regress y x1 x2 [aweight = w], vce(robust) | lm(y ~ x1 + x2, data = df, weights = w) | smf.wls('y ~ x1 + x2', data=df, weights=df['w']).fit() | Available |
| 1.1.3 · Generalized Least Squares — GLS | gls | gls / vwls y x1 x2, sd(sigma_i) | nlme::gls(y ~ x1 + x2, data = df) | sm.GLS(y, X, sigma=Omega).fit() | Available |
| 1.1.4 · Feasible Generalized Least Squares — FGLS | fgls | regress y x1 x2 -> gen ln_e2 = ln(e^2) -> regress y x1 x2 [aw=1/exp(xb)] | nlme::gls(y ~ x1 + x2, weights = varExp(), data = df) | smf.glsar('y ~ x1 + x2', data=df, rho=1).iterative_fit() | Available |
| 1.1.5 · Constrained and Restricted Least Squares | constrained_least_squares | cnsreg y x1 x2, constraints(1) vce(robust) | car::linearHypothesis + quadprog::solve.QP | scipy.optimize.lsq_linear + statsmodels.OLS Lagrangian projection | Available |
| 1.1.6 · Nonlinear Least Squares Gauss Newton | nonlinear_least_squares | nl (y = {b0} + {b1}*x1), vce(robust) | stats::nls + sandwich::vcovHC | scipy.optimize.least_squares(method='trf') | Available |
| 1.1.7 · Errors in Variables Reliability Adjusted and Deming Regression | errors_in_variables_eiv | eivreg y x1 x2, r(x1 0.90) | deming::deming / reliability-corrected moment matrix | Fuller (1987) reliability-corrected moment estimator + Deming SVD total least squares | Available |
1.1.4. Standard Implementation Workflow for Part 1.1
Step 1. Load Standardized Practice Datasets From VietLOD, EcoData, or Finco
Download the model-specific .csv practice dataset in Part 1.1 or extract custom empirical panels from EcoData and Finco.
Step 2. Select the Optimal Estimator for Your Error and Sample Structure
Compare the estimators from 1.1.1 to 1.1.7 in the syntax matrix above and execute the estimation in Stata 18 MP, R 4.x, or Python 3.11+.
Step 3. Run Mandatory Diagnostics and Export Publication Tables on EcoLab
Verify all required diagnostics including Kiểm định phương sai thay đổi Breusch–Pagan và White, hệ số phóng đại phương sai đa cộng tuyến (VIF), kiểm định dạng hàm Ramsey RESET, kiểm định phân phối chuẩn phần dư Jarque–Bera and dispatch the specification to EcoLab for automated journal-grade reporting.