# Analyzing the Factors Influencing Time Delays in Korean Railroad Accidents
## 4 Methodology  
### Regression Methods  
The magnitude of time delay, a non-negative continuous measurement characterized by a prevalence of zeros as depicted in Figure 5, can be quantified through regression techniques. Poisson and Negative Binomial (NB) regression models have emerged as widely employed tools in accident analysis. The Poisson model is well-suited for datasets exhibiting variance approximately equal to the mean, whereas the NB model is aptly suited for datasets with pronounced over-dispersion, where the variance significantly exceeds the mean. Consequently, the NB model is deemed appropriate for predicting time delays due to the substantial disparity between the variance and mean within both datasets, as elucidated in the data description. However, the data on time delay has two heterogeneous measurement distributions (e.g., zero or positive), which are not well described by these classical models. To deal with the excess frequencies of zero, two approaches have been adopted. One is the two-stage model. In the first stage of the model, a binary logit model was applied to the distribution of whether delay time occurred. And, when the delay time occurred from the model, the delay time was measured using the NB model. Another is the ZINB model, which analyzes data with excess zeros and over-dispersion, providing a more accurate representation of the underlying processes. The dependent variable, delay time was converted into a categorical variable with 5 min intervals, expressed as 0 to 21 (e.g., '1' if the delay time is greater than 0 and less than or equal to 5), and then applied to the models. The NB model postulates that the Poisson means conform to a gamma distribution, and the probability mass function is expressed as follows: [see [PERSON] et al. [41] (p. 100) for details]:  
\[Pr(y_{i})=\frac{\Gamma\big{(}\alpha^{-1}+y_{i}\big{)}}{\Gamma(\alpha^{-1}) \Gamma(y_{i}+1)}\bigg{(}\frac{1}{\mu_{i}\alpha+1}\bigg{)}^{\alpha^{-1}}\bigg{(} \frac{\mu_{i}\alpha}{\mu_{i}\alpha+1}\bigg{)}^{y_{i}} \tag{1}\]  
where  
\[E(y_{i})=\mu_{i}=exp(\beta_{0}+\beta_{1}x_{1i}+\cdots+\beta_{m}x_{mi}+\epsilon _{i}) \tag{2}\]  
\[Var(y_{i})=\mu_{i}+\alpha\mu_{i}^{2} \tag{3}\]  
\[L=\prod_{i=1}^{N}Pr(y_{i}) \tag{4}\]  
Let \(i\) = 1, 2, 3, \(\ldots\), n represent the observation index; m denotes the index for explanatory variables; \(y_{i}\) signify the observed delayed time amount for observation \(i\); \(x_{mi}\) represent the value of explanatory variable m for observation \(i\); and \(\beta_{m}\) denote the coefficients to be estimated corresponding to \(x_{mi}\). The estimated outcome for delayed time for the \(i^{\text{th}}\)observation, denoted as \(\mu_{i}\), is derived. The overdispersion parameter is represented as \(\alpha\). When \(\alpha\)\(\rightarrow\)0, it implies equivalence between the conditional mean and conditional variance (eliminating unobserved heterogeneity), effectively collapsing the NB model into the Poisson model. The likelihood function is denoted as \(L\). To model overdispersion in the presence of excessive zeros, the ZINB distribution is employed. For \(y_{i}\), the value 0 manifests in two distinct states. The first state is the zero state, occurring with a probability of \(p_{i}\), resulting exclusively in observations with a value of 0. The second state is the negative binomial state, occurring with a probability of (\(1-p_{i}\)) and characterized by a negative binomial distribution [42]. \[Pr(y_{i})=\left\{ \begin{aligned} p_{i}+(1-p_{i})\Big{(}\frac{1}{ \mu_{i}\alpha+1}\Big{)}^{\alpha^{-1}},\text{ for }y_{i}=0\\ (1-p_{i})\bigg{(}\frac{\Gamma\left(\alpha^{-1}+y_{i}\right)}{ \Gamma\left(\alpha^{-1}\right)\Gamma\left(y_{i}+1\right)}\bigg{)}\Big{(}\frac{ 1}{\mu_{i}\alpha+1}\Big{)}^{\alpha^{-1}}\Big{(}\frac{\mu_{i}\alpha}{\mu_{i} \alpha+1}\Big{)}^{y_{i}},\text{ for }y_{i}>0\end{aligned} \right.