# Analysis of the Railway Accident-Related Damages in South Korea
## 3 Two-Part Model
### TPMs for Non-Negative Count Measurements  
In general, Poisson regression analysis is the primary model which is used to find out the causal relationship between the independent variables and the dependent variable. The dependent variable must distribute as Poisson distribution. One of the assumptions of Poisson regression is that the mean and the variance are equal but most of the data will have a larger variance or overdispersion. Poisson distribution is a representative model for count responses, for example, the count of defective products in a manufacturing process or the number of visits to the hospital. We frequently encounter excessive zeros, which is more than that can be handled under a Poisson distribution [18; 19]. For example, the number of trains delayed due to railway accidents in this study had 24% zero measurements. To counter this problem, we construct a model with alternative discrete distributions. The ZIP (zero-inflated Poisson) distribution can be used to model the count responses having excessive zeros. [PERSON] [18] first introduced the ZIP model in terms of mixed distribution, where one distribution is the point mass at zero with a probability weight of \(1-p_{i}\) and the other is a Poisson distribution with the mean rate, \(\lambda_{i}\) and weight, \(p_{i}\). The expectation maximization algorithm of [PERSON] et al. [28] is generally used to find the maximum likelihood estimation of the ZIP model. In this section, we briefly explain the ZIP distribution along with its property. Let \(Y\) denote the count response variable that follows a mixture of the two distributions, the perfect one with zero state degenerating at \(0\) and the other with Poisson distribution denoted as \(Poi(\lambda_{i})\); with probabilities \((1-p_{i})\) and \(p_{i}\), respectively, where \(0\leq p_{i}\leq 1\). The probability distribution of \(Y_{i}\)'s can be expressed as  
\[f(y_{i}|\mathbf{x}_{i},\mathbf{\beta},\mathbf{\theta})=\left\{ \begin{array}{ll}(1-p_ {i})+p_{i}e^{-\lambda_{i}},&y_{i}=0,\\ p_{i}\frac{\lambda_{i}y_{i}e^{-\lambda_{i}}}{y_{i}!},&y_{i}=1,2,\cdots.\end{array} \right. \tag{2}\]  
As can be seen from Equation (2), ZIP distribution has an inflated probability of zeros by the amount \((1-p_{i})\big{(}1-e^{-\lambda_{i}}\big{)}\) compared to \(e^{-\lambda_{i}}\). Using the moment generating function of the ZIP, which is of the form \(E\big{(}e^{tY_{i}}\big{)}=(1-p_{i})+p_{i}e^{\lambda_{i}(\ell-1)}\), we can easily find the mean and variance of \(Y_{i}\), \(E(Y_{i})=\lambda_{i}p_{i}\) and \(V(Y_{i})=\lambda_{i}p_{i}[1+(1-p_{i})\lambda_{i}]\). The higher value of the variance compared with the mean denotes an overdispersion in count data. Based on the second part (Poisson part) of the Equation (2), the systematic component and its link function is represented as follows:  
\[\log(\lambda_{i})=\mathbf{x}_{i}^{T}\mathbf{\theta}.\]  
Given a dataset \(\{(y_{i};\mathbf{x}_{i})\}\) of size \(n\), we can write the log-likelihood function, \(l(\cdot)\) of the ZIP model as  
\[l(\mathbf{\beta},\ \mathbf{\theta}\big{|}\mathbf{y},\ \mathbf{X})\ =\sum\
olimits_{y_{i}=0}log\big{[}(1-p_{i})+p_{ i}e^{-\lambda_{i}}\big{]}+\sum\
olimits_{y_{i}>0}log\left(p_{i}\frac{\lambda_{i}y _{i}e^{-\lambda_{i}}}{y_{i}!}\right).\]  
We have explored analysis methods for the non-negative count responses containing excessive zeros. This type of data can be modeled through a two-step process which involves modeling the probability of a non-zero outcome and modeling the mean of the non-zero outcomes. The ZINB distribution is also used for count responses in modeling the overdispersion with excessive zeros. The ZINB model is almost the same as the ZIP except for the probability distribution of \(Y_{i}\)'s, which is expressed as  
\[f(y_{i}|x_{i},\mathbf{\beta},\mathbf{\theta})=\left\{