16.2. Generalized Linear Mixed and Categorical Log-Linear Models
Methodological Part 16.2. Generalized Linear Mixed and Categorical Log-Linear Models in 16. Multilevel, Mixed-Effects and Complex Survey Econometrics provides step-by-step How-To implementation guides for 4 econometric model lessons spanning from Section 16.2.1 to 16.2.4 alongside cloud execution on EcoLab.
Video Tutorial: How-To Guide for Part 16.2: Generalized Linear Mixed and Categorical Log-Linear Models in Stata 18, R 4.x, and Python 3.11+
16.2.1. Methodological Overview and Structural Equations
- Methodological Focus: Consistent estimation and design-based / model-based inference for Generalized Linear Mixed and Categorical Log-Linear Models within Multilevel, Mixed-Effects and Complex Survey Econometrics.
- Mandatory Post-Estimation Diagnostics: Intraclass Correlation Coefficient ICC, boundary Chibar2 likelihood-ratio test, Kish Design Effect DEFF, and DuMouchel–Duncan survey weight exogeneity test.
16.2.2. Econometric Model Lessons in Part 16.2
Integrates normal cluster random intercepts out of the conditional logistic likelihood via Gauss-Hermite quadrature to estimate subject-spec...
Models clustered non-negative count data with log-normal random cluster intercepts exp(X_ij*beta + u_i) via Gauss-Hermite marginal likelihoo...
Solves quasi-score equations with an exchangeable working correlation matrix and Huber-White cluster sandwich covariance, delivering consist...
Models multi-way cross-classified cell frequencies via canonical log-link Poisson GLM ln(mu_cell) = X*beta, evaluating conditional independe...
16.2.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 |
|---|---|---|---|---|---|
| 16.2.1 · Mixed Effects Logistic Generalized Linear Mixed Model | mixed_effects_logit_glmm | melogit y x1 x2 || entity:, intpoints(7) | lme4::glmer(y ~ x1 + x2 + (1 | entity), family = binomial, nAGQ = 7) | Gauss-Hermite quadrature marginal MLE Mixed-Effects Logit + statsmodels BinomialBayesMixedGLM | Available |
| 16.2.2 · Mixed Effects Poisson Count Generalized Linear Mixed Model | mixed_effects_poisson_glmm | mepoisson y x1 x2 || entity:, intpoints(7) | lme4::glmer(y ~ x1 + x2 + (1 | entity), family = poisson, nAGQ = 7) | Gauss-Hermite quadrature marginal MLE Poisson GLMM + statsmodels PoissonBayesMixedGLM | Available |
| 16.2.3 · Population Averaged Generalized Estimating Equations | population_averaged_gee | xtgee y x1 x2, family(gaussian) link(identity) corr(exchangeable) vce(robust) | geepack::geeglm(y ~ x1 + x2, id = entity, corstr = 'exchangeable') | statsmodels.genmod.generalized_estimating_equations.GEE(cov_struct=Exchangeable()).fit() | Available |
| 16.2.4 · Hierarchical Log Linear Multi Way Contingency Model | loglinear_contingency_glm | glm y x1 x2, family(poisson) link(log) vce(robust) | stats::glm(y ~ x1 + x2, family = poisson(link = 'log')) | statsmodels.GLM(y, X, family=sm.families.Poisson()).fit(cov_type='HC1') | Available |