Skip to main content

4.3. Censored, Truncated and Sample Selection Models

Verified Environments & Platforms:EcoDataEcoLabFincoVietLOD

Methodological Part 4.3. Censored, Truncated and Sample Selection Models in 4. Count Data, Trade Gravity and Limited Dependent Variable Models provides step-by-step How-To implementation guides for 4 econometric model lessons spanning from Section 4.3.1 to 4.3.4. Full theoretical derivations are available at VietLOD Part 4.3 alongside cloud execution on EcoLab.

Video Tutorial: How-To Guide for Part 4.3: Censored, Truncated and Sample Selection Models in Stata 18, R 4.x, and Python 3.11+

4.3.1. Methodological Overview and Structural Equations​

  • Methodological Focus: Provides consistent estimation and robust inference for Censored, Truncated and Sample Selection Models specifications within Count Data, Trade Gravity and Limited Dependent Variable Models.
  • Mandatory Post-Estimation Diagnostics: Kiểm định tính chuẩn và phương sai không đổi của sai số Tobit, phân tách tác động biên trên biến ẩn E[Y∗]\text{E}[Y^\ast] và trên biến quan sát E[Y∣Y>0]\text{E}[Y \mid Y \gt 0].

Core structural specification for Part 4.3:

Yi∗=Xi⊤β+εi,Yi=max⁡(0,Yi∗)Y_i^\ast = X_i^\top \beta + \varepsilon_i, \quad Y_i = \max(0, Y_i^\ast)

Estimator objective and moment conditions:

θ^QMLE=arg⁡max⁡θ∈Θ∑i=1Nln⁡f(Yi∣Xi,Zi;θ),E[Yi∣Xi]=g−1(Xi⊤β)\hat{\theta}_{\text{QMLE}} = \arg\max_{\theta \in \Theta} \sum_{i=1}^N \ln f\left(Y_i \mid X_i, Z_i; \theta\right), \quad \text{E}[Y_i \mid X_i] = g^{-1}(X_i^\top \beta)
Methodological Scope Boundary:When empirical data violate the identification conditions of Part 4.3, researchers should transition to the extended methodological parts in Chapter 4 or apply appropriate instrumental-variable and cluster-robust corrections.

4.3.2. Econometric Model Lessons in Part 4.3​

4.3.1 · tobit
4.3.1. Tobit Censored Regression

Estimates the Tobit Censored Regression specification within the Censored, Truncated and Sample Selection Models framework by optimizing the...

Explore Guide
4.3.2 · truncated_regression
4.3.2. Truncated Normal Regression

Estimates the Truncated Normal Regression specification within the Censored, Truncated and Sample Selection Models framework by optimizing t...

Explore Guide
4.3.3 · heckman_selection
4.3.3. Heckman Sample Selection

Estimates the Heckman Sample Selection specification within the Censored, Truncated and Sample Selection Models framework by optimizing the ...

Explore Guide
4.3.4 · endogenous_switching
4.3.4. Endogenous Switching Regression

Jointly estimates binary selection into treatment and regime-specific outcome equations under correlated unobservables to recover ATT and AT...

Explore Guide

4.3.3. Comparative Execution Syntax Across Stata 18, R 4.x, and Python 3.11+​

Section & Model TitleEstimator KeyStata 18 MP SyntaxR 4.x SyntaxPython 3.11+ SyntaxSupport
4.3.1 · Tobit Censored Regressiontobittobit y_cens x1 x2, ll(0) vce(robust)AER::tobit(y_cens ~ x1 + x2, left = 0, data = df)scipy.optimize.minimize(tobit_negloglik, theta0, method='BFGS')Available
4.3.2 · Truncated Normal Regressiontruncated_regressiontruncreg y_pos x1 x2, ll(0) vce(robust)truncreg::truncreg(y_pos ~ x1 + x2, point = 0, direction = 'left', data = df)scipy.optimize.minimize(truncreg_negloglik, theta0, method='BFGS')Available
4.3.3 · Heckman Sample Selectionheckman_selectionheckman y x1 x2, select(s = x1 x2 z1) twostepsampleSelection::heckit(s ~ x1 + x2 + z1, y ~ x1 + x2, data = df)smf.ols('y ~ x1 + x2 + imr_lambda', data=df_selected).fit(cov_type='HC1')Available
4.3.4 · Endogenous Switching Regressionendogenous_switchingmovestay (y x1 x2), select(d = z1 x1 x2) robustsampleSelection::selection(d ~ z1 + x1, list(y ~ x1 + x2, y ~ x1 + x2), data = df)smf.ols('y ~ d + x1 + x2 + imr', data=df).fit(cov_type='HC1')Available

4.3.4. Standard Implementation Workflow for Part 4.3​

Step 1. Load Standardized Practice Datasets From VietLOD, EcoData, or Finco

Download the model-specific .csv practice dataset in Part 4.3 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 4.3.1 to 4.3.4 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 tính chuẩn và phương sai không đổi của sai số Tobit, phân tách tác động biên trên biến ẩn E[Y∗]\text{E}[Y^\ast] và trên biến quan sát E[Y∣Y>0]\text{E}[Y \mid Y \gt 0] and dispatch the specification to EcoLab for automated journal-grade reporting.