4.1. Baseline Count and Trade Gravity Models
Methodological Part 4.1. Baseline Count and Trade Gravity Models in 4. Count Data, Trade Gravity and Limited Dependent Variable Models provides step-by-step How-To implementation guides for 6 econometric model lessons spanning from Section 4.1.1 to 4.1.6. Full theoretical derivations are available at VietLOD Part 4.1 alongside cloud execution on EcoLab.
Video Tutorial: How-To Guide for Part 4.1: Baseline Count and Trade Gravity Models in Stata 18, R 4.x, and Python 3.11+
4.1.1. Methodological Overview and Structural Equations
- Methodological Focus: Provides consistent estimation and robust inference for Baseline Count and Trade Gravity Models specifications within Count Data, Trade Gravity and Limited Dependent Variable Models.
- Mandatory Post-Estimation Diagnostics: Kiểm định quá phân tán của Cameron–Trivedi và Deviance/Pearson goodness-of-fit, sai số chuẩn vững (QMLE) và tỷ số tần suất biến cố (IRR).
Core structural specification for Part 4.1:
Estimator objective and moment conditions:
4.1.2. Econometric Model Lessons in Part 4.1
Estimates the Poisson Count Regression specification within the Baseline Count and Trade Gravity Models framework by optimizing the structur...
Estimates the Negative Binomial Count Regression specification within the Baseline Count and Trade Gravity Models framework by optimizing th...
Estimates the Generalized Poisson Count Regression specification within the Baseline Count and Trade Gravity Models framework by optimizing ...
Gold-standard bilateral trade gravity and non-negative flow estimator consistent under arbitrary heteroskedasticity and zero flows. Across e...
4.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 |
|---|---|---|---|---|---|
| 4.1.1 · Poisson Count Regression | poisson | poisson y_count x1 x2, vce(robust) irr | glm(y_count ~ x1 + x2, family = poisson(link = 'log'), data = df) | smf.poisson('y_count ~ x1 + x2', data=df).fit(cov_type='HC1') | Available |
| 4.1.2 · Negative Binomial Count Regression | negative_binomial | nbreg y_count x1 x2, vce(robust) irr | MASS::glm.nb(y_count ~ x1 + x2, data = df) | smf.negativebinomial('y_count ~ x1 + x2', data=df).fit() | Available |
| 4.1.3 · Generalized Poisson Count Regression | generalized_poisson | gpoisson y_count x1 x2, vce(robust) | glmmTMB::glmmTMB(y_count ~ x1 + x2, family = genpois, data = df) | GeneralizedPoisson(endog, exog).fit() | Available |
| 4.1.4 · Poisson Pseudo-Maximum Likelihood with High-Dimensional Fixed Effects | ppml_hdfe | ppmlhdfe trade rta x1, absorb(exp_time imp_time pair_id) cluster(pair_id) | fixest::fepois(trade ~ rta + x1 | exp_time + imp_time + pair_id, cluster = ~pair_id, data = df) | pyfixest.fepois('trade ~ rta + x1 | exp_time + imp_time + pair_id', data=df, vcov={'CRV1': 'pair_id'}) | Available |
| 4.1.5 · Tweedie and Inverse Gaussian Compound Poisson Gamma GLM | inverse_gaussian_tweedie_glm | glm y x1 x2, family(gamma) link(log) vce(robust) | stats::glm(y ~ x1 + x2, family = Gamma(link = 'log')) / statmod::tweedie | statsmodels.GLM(y, X, family=sm.families.Tweedie(link=Log(), var_power=1.5)).fit(cov_type='HC1') | Available |
| 4.1.6 · Zero Truncated Poisson and Negative Binomial Regression | zero_truncated_count_ztp | tpoisson y x1 x2, ll(0) vce(robust) | countreg::zerotrunc(y ~ x1 + x2, dist = 'poisson') / VGAM::pospoisson | Exact Zero-Truncated Poisson log-likelihood BFGS MLE + Huber-White sandwich SE | Available |
4.1.4. Standard Implementation Workflow for Part 4.1
Step 1. Load Standardized Practice Datasets From VietLOD, EcoData, or Finco
Download the model-specific .csv practice dataset in Part 4.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 4.1.1 to 4.1.6 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 quá phân tán của Cameron–Trivedi và Deviance/Pearson goodness-of-fit, sai số chuẩn vững (QMLE) và tỷ số tần suất biến cố (IRR) and dispatch the specification to EcoLab for automated journal-grade reporting.