Skip to main content

11.4. Discrete-Time Hazard and Competing-Risks Models

Verified Environments & Platforms:EcoDataEcoLabFincoVietLOD

Methodological Part 11.4. Discrete-Time Hazard and Competing-Risks Models in 11. Survival, Event History and Competing-Risks Analysis provides step-by-step How-To implementation guides for 5 econometric model lessons spanning from Section 11.4.1 to 11.4.5. Full theoretical derivations are available at VietLOD Part 11.4 alongside cloud execution on EcoLab.

Video Tutorial: How-To Guide for Part 11.4: Discrete-Time Hazard and Competing-Risks Models in Stata 18, R 4.x, and Python 3.11+

11.4.1. Methodological Overview and Structural Equations​

  • Methodological Focus: Provides consistent estimation and robust inference for Discrete-Time Hazard and Competing-Risks Models specifications within Survival, Event History and Competing-Risks Analysis.
  • Mandatory Post-Estimation Diagnostics: Tỷ số nguy cơ exp⁡(β^)\exp(\hat{\beta}) tương đương chính xác tham số Cox liên tục gốc, kiểm định LR dạng hàm nguy cơ cơ sở theo thời gian, deviance AIC/BIC..

Core structural specification for Part 11.4:

hit=P(Ti=t∣Ti≥t,Xit)=1−exp⁡(−exp⁡(αt+Xit⊤β))  ⟺  ln⁡(−ln⁡(1−hit))=αt+Xit⊤βh_{it} = \text{P}(T_i = t \mid T_i \ge t, X_{it}) = 1 - \exp\left(-\exp(\alpha_t + X_{it}^\top \beta)\right) \iff \ln\left(-\ln(1 - h_{it})\right) = \alpha_t + X_{it}^\top \beta

Estimator objective and moment conditions:

ℓpartial(β)=∑i=1Nδi[Xi⊤β−ln⁡(∑j∈R(ti)exp⁡(Xj⊤β))],S(t∣Xi)=exp⁡(−H0(t)exp⁡(Xi⊤β))\ell_{\text{partial}}(\beta) = \sum_{i=1}^N \delta_i \left[X_i^\top \beta - \ln\left(\sum_{j \in \mathcal{R}(t_i)} \exp(X_j^\top \beta)\right)\right], \quad S(t \mid X_i) = \exp\left(-H_0(t)\exp(X_i^\top \beta)\right)
Methodological Scope Boundary:When empirical data violate the identification conditions of Part 11.4, researchers should transition to the extended methodological parts in Chapter 11 or apply appropriate instrumental-variable and cluster-robust corrections.

11.4.2. Econometric Model Lessons in Part 11.4​

11.4.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
11.4.1 · Prentice-Gloeckler Discrete-Time Complementary Log-Log Hazarddiscrete_time_hazardcloglog event_it x1 x2 i.spell_t, vce(cluster id)glm(event_it ~ x1 + x2 + factor(spell_t), family = binomial(link = 'cloglog'), data = df)smf.glm('event_it ~ x1 + x2 + C(spell_t)', data=df, family=sm.families.Binomial(sm.families.links.CLogLog())).fit()Available
11.4.2 · Fine and Gray Competing-Risks Subdistribution Hazardfine_gray_competing_risksstcrreg x1 x2, compete(event == 2) vce(robust)cmprsk::crr(ftime = df$duration, fstatus = df$event, cov1 = df[, c('x1', 'x2')])CoxPHFitter().fit(df_ipcw, duration_col='duration', event_col='event_cr', weights_col='w_ipcw')Available

| 11.4.3 · Autoregressive Conditional Duration Model Engle Russell | acd_conditional_duration | streg x1 x2, distribution(weibull) time | ACDm::acdFit(model = 'ACD', dist = 'exponential') | AFT log-duration covariate adjustment + Bauwens-Giot Log-ACD(1,1) | Available | | 11.4.4 · Shared Gamma Frailty Proportional Hazards and AFT Duration Model | shared_gamma_frailty_hazard | stset y & streg x1 x2, distribution(weibull) frailty(gamma) time | survival::survreg(Surv(y) ~ x1 + x2, dist = 'weibull') | Weibull-Gamma Frailty marginal Laplace-transform MLE + AFT log-duration elasticities | Available | | 11.4.5 · Piecewise Constant Exponential Hazard Duration Model | piecewise_exponential_hazard | stset y & stsplit, at(failures) / streg x1 x2, distribution(exponential) time | eha::pchreg / stats::lm(log(y) ~ x1 + x2) | Holford-Laird-Olivier interval-exposure Poisson hazard + log-duration AFT projection | Available |

11.4.4. Standard Implementation Workflow for Part 11.4​

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

Download the model-specific .csv practice dataset in Part 11.4 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 11.4.1 to 11.4.5 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 Tỷ số nguy cơ exp⁡(β^)\exp(\hat{\beta}) tương đương chính xác tham số Cox liên tục gốc, kiểm định LR dạng hàm nguy cơ cơ sở theo thời gian, deviance AIC/BIC. and dispatch the specification to EcoLab for automated journal-grade reporting.