Skip to main content

4. Count Data, Trade Gravity and Limited Dependent Variable Models

Verified Environments & Platforms:EcoDataEcoLabFincoVietLOD

Chapter 4. Count Data, Trade Gravity and Limited Dependent Variable Models provides step-by-step How-To implementation guides for 19 econometric model lessons organized across 4 methodological parts from Section 4.1.1 to 4.4.6. Every guide is synchronized with the full academic lecture at VietLOD Chapter 4 and supports automated cloud execution on EcoLab.

Video Tutorial: How-To Guide for Chapter 4: Count Data, Trade Gravity and Limited Dependent Variable Models in Stata 18, R 4.x, and Python 3.11+

4.1. Central Research Question and Core Mathematical Specification​

  • Central Research Question: How to consistently estimate count outcomes, bilateral trade flows with excess zeros, censored thresholds, and endogenous sample selection?
  • Chapter Architecture: Encompasses 4 specialized methodological parts from 4.1 to 4.4 and 19 empirical model lessons validated on Vietnamese datasets from EcoData and Finco.

Core structural equation for Chapter 4:

E[Yij∣Xij]=exp⁡(Xij⊤β+μi+νj)\text{E}[Y_{ij} \mid X_{ij}] = \exp(X_{ij}^\top \beta + \mu_i + \nu_j)
Methodological Scope Boundary:Log-linearizing count or trade flow variables drops zero observations and induces severe Jensen inequality bias under heteroskedasticity. Mandatory diagnostics for this chapter include: Cameron–Trivedi Overdispersion Test, Vuong/AIC-BIC Zero-Inflation Test, Silva–Tenreyro RESET, Inverse Mills Ratio (IMR) Test, Modified Park Test.

4.2. Explore the 4 Methodological Parts in Chapter 4​

6 Lessons
4.1. Baseline Count and Trade Gravity Models

Step-by-step How-To guides, tri-engine scripts, and diagnostic workflows for Baseline Count and Trade Gravity Models estimators.

Explore Guide
3 Lessons
4.2. Zero-Inflated and Hurdle Count Models

Step-by-step How-To guides, tri-engine scripts, and diagnostic workflows for Zero-Inflated and Hurdle Count Models estimators.

Explore Guide
4 Lessons
4.3. Censored, Truncated and Sample Selection Models

Step-by-step How-To guides, tri-engine scripts, and diagnostic workflows for Censored, Truncated and Sample Selection Models estimators.

Explore Guide
6 Lessons
4.4. Corner Solution and Fractional Response Models

Step-by-step How-To guides, tri-engine scripts, and diagnostic workflows for Corner Solution and Fractional Response Models estimators.

Explore Guide

4.3. Four-Step Workflow for Selecting and Executing Models in Chapter 4​

Step 1. Select the Appropriate Methodological Part From 4.1 to 4.4

Match your economic hypothesis and sample structure against the identification requirements in Chapter 4 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: Cameron–Trivedi Overdispersion Test, Vuong/AIC-BIC Zero-Inflation Test, Silva–Tenreyro RESET, Inverse Mills Ratio (IMR) Test, Modified Park Test.

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.

4.4. Complete Directory of 19 Econometric Model Lessons in Chapter 4​

SectionEconometric Model Lesson TitleEstimator KeyLevelSoftware Packages Stata · R · PythonSupport
4.1.14.1.1. Poisson Count RegressionpoissonL1base Stata · stats · statsmodelsAvailable
4.1.24.1.2. Negative Binomial Count Regressionnegative_binomialL1base Stata · MASS · statsmodelsAvailable
4.1.34.1.3. Generalized Poisson Count Regressiongeneralized_poissonL2Stata gpoisson · MASS / glmmTMB · statsmodelsAvailable
4.1.44.1.4. Poisson Pseudo-Maximum Likelihood with High-Dimensional Fixed Effectsppml_hdfeL3ppmlhdfe · fixest · pyfixestAvailable
4.2.14.2.1. Zero-Inflated Poisson — ZIPzero_inflated_poissonL2base Stata · pscl · statsmodelsAvailable
4.2.24.2.2. Zero-Inflated Negative Binomial — ZINBzero_inflated_negbinL2base Stata · pscl · statsmodelsAvailable
4.2.34.2.3. Cragg and Mullahy Hurdle Count Modelhurdle_countL2Stata churdle · pscl · statsmodelsAvailable
4.3.14.3.1. Tobit Censored RegressiontobitL1base Stata · AER / survival · scipy / statsmodelsAvailable
4.3.24.3.2. Truncated Normal Regressiontruncated_regressionL2base Stata · truncreg · statsmodels / scipyAvailable
4.3.34.3.3. Heckman Sample Selectionheckman_selectionL1base Stata · sampleSelection · statsmodels / scipyAvailable
4.3.44.3.4. Endogenous Switching Regressionendogenous_switchingL4movestay · sampleSelection · statsmodels / scipyAvailable
4.4.14.4.1. Cragg Double-Hurdle Corner-Solution Modeldouble_hurdleL4Stata churdle · mhurdle · statsmodels / scipyAvailable
4.4.24.4.2. Two-Part Semicontinuous Modeltwo_part_continuousL4twopm · twopartm · statsmodelsAvailable
4.4.34.4.3. Papke-Wooldridge Fractional Logitfractional_logitL3base Stata · stats · statsmodelsAvailable
4.4.44.4.4. Beta Regression for Continuous Proportionsbeta_regressionL3Stata betareg · betareg · statsmodelsAvailable

| 4.1.5 | 4.1.5. Tweedie and Inverse Gaussian Compound Poisson Gamma GLM | inverse_gaussian_tweedie_glm | L4 | glm · stats · statsmodels | Available | | 4.1.6 | 4.1.6. Zero Truncated Poisson and Negative Binomial Regression | zero_truncated_count_ztp | L4 | tpoisson · countreg · scipy | Available | | 4.4.5 | 4.4.5. Censored Least Absolute Deviations Powell | censored_quantile_powell | L4 | qreg · quantreg · statsmodels | Available | | 4.4.6 | 4.4.6. Powell Censored Least Absolute Deviations and Honore Trimmed LAD | clm_trimmed_lad_honore | L4 | qreg · quantreg · statsmodels | Available |

4.5. Key Academic References​

  • Cameron, A. C, & Trivedi, P. K.(2013). Regression Analysis of Count Data, 2nd ed.. Cambridge University Press.
  • Silva, & Tenreyro(2006). Econometric specification, identification, and asymptotic inference.
  • Heckman, J. J.(1979). Sample selection bias as a specification error. Econometrica, 47, số 1, 153–161.
  • Cragg(1971). Econometric specification, identification, and asymptotic inference.
  • Papke, L. E, & Wooldridge, J. M.(1996). Econometric methods for fractional response variables with an application to 401k plan participation rates. Journal of Applied Econometrics, 11, số 6, 619–632.
  • Wooldridge, J. M.(2010). Econometric Analysis of Cross Section and Panel Data, 2nd ed, Chương 17–19: Corner Solution, Tobit, Count Data and Sample Selection. MIT Press.
  • Cameron, A. C, & Trivedi, P. K.(2022). Microeconometrics Using Stata, 2nd ed, Vol. 2, Chương 19–21: Tobit, Selection and Count-Data Models. Stata Press.
  • Greene, W. H.(2019). Econometric Analysis, 8th ed, Chương 18–19: Count Data and Limited Dependent Variables. Pearson.
  • Das, P.(2019). Econometrics in Theory and Practice, Chương 8–9: Limited Dependent Variable Models. Springer.