category: literaturenote citekey: yegoodnessfittestingaccident2013 title: Goodness-of-fit testing for accident models with low means authors: "Ye, Zhirui; Zhang, Yunlong; Lord, Dominique" year: 2013 date: 2013-00-00 2013 doi: 10.1016/j.aap.2012.11.007 publication: "Accident Analysis & Prevention" url: "https://doi.org/10.1016/j.aap.2012.11.007" zotero_key: GE4552VJ zotero_storage: MAE4P2UT collections: transpordi_planeerimine folder: 001_artiklid/Road Safety Indicators firstAuthor: "Ye, Zhirui"
Contents lists available at ScienceDirect
j ournal homepage: www.elsevier.com/locate/aap
Zhirui Yea, Yunlong Zhang b,∗, Dominique Lordb
Article history: Received 26 October 2011 Received in revised form 6 September 2012 Accepted 8 November 2012
Keywords: Low sample mean crash data Generalized linear model Goodness-of-fit Power-divergence
The modeling of relationships between motor vehicle crashes and underlying factors has been investigated for more than three decades. Recently, many highway safety studies have documented the use of negative binomial (NB) regression models. On rare occasions, the Poisson model may be the only alternative especially when crash sample mean is low. Pearson's X2 and the scaled deviance (G2) are two common test statistics that have been proposed as measures of goodness-of-fit (GOF) for Poisson or NB models. Unfortunately, transportation safety analysts often deal with crash data that are characterized by low sample mean values. Under such conditions, the traditional test statistics may not perform very well.
This study has three objectives. The first objective is to examine all the traditional test statistics and compare their performance for the GOF of accident models subjected to low sample means. Secondly,this study proposes a new test statistic that is not dependent on the sample size for Poisson regression model, as opposed to the grouped G2 method. The proposed method is easy to use and does not require grouping data, which is time consuming and may not be feasible to use if the sample size is small. Moreover, the proposed method can be used for lower sample means than documented in previous studies. Thirdly, this study provides guidance on how and when to use appropriate test statistics for both Poisson and negative binomial (NB) regression models.
Published by Elsevier Ltd.
The modeling of relationships between motor vehicle crashes and underlying factors, such as traffic volume and highway geometric features has been investigated for more than three decades. The statistical models (sometimes referred to as crash prediction models) from which these relationships are developed can be used for various purposes, including predicting crashes on transportation facilities and determining which variables significantly influence crashes. Recently, many highway safety studies have documented the use of Poisson-gamma (also referred to as negative binomial – NB) regression models (Miaou and Lum, 1993; Poch and Mannering, 1996; Miaou and Lord, 2003; Maycock and Hall, 1984; Lord et al., 2005; Miaou, 1994; Maher and Summersgill, 1996). On rare occasions, the Poisson model has been found to be suitable for modeling crashes, especially when crash sample mean is low (Joshua and Garber, 1990; Miaou et al., 1992; Ivan et al., 2000; Lord and Bonneson, 2007). Although Poisson model is not used as commonly as NB model, it is frequently used when the sample mean is low due to the nature of count data (see, e.g., Lord and Bonneson, 2007). With the Poisson or NB models, the relationships between motor vehicle crashes and explanatory variables can then be developed by means of the generalized linear model (GLM) framework.
Pearson's X2 and the scaled deviance (G2) are two common test statistics that have been proposed as measures of GOF for Poisson or NB models (Maher and Summersgill, 1996). Statistical software (e.g., SAS) also uses these two statistics for assessing the GOF of a GLM (SAS Institute Inc., 1999). Unfortunately, transportation safety analysts often deal with crash data that are subjected to low sample mean values. Under such conditions, the traditional test statistics may not perform very well. This has been referred to in the highway safety literature as the low mean problem (LMP). The study by Sukhatme (1938) concluded that, "for samples from a Poisson distribution with mean as low as one, Pearson's X2 test for goodness of fit is not good." In the field of traffic safety, this issue was first raised by Maycock and Hall (1984) and further discussed by Maher and Summersgill (1996), Fridstrom et al. (1995), and Agrawal and Lord (2006). Wood (2002) proposed a more complex technique,the grouped G2 method, to solve this problem. The grouped G2 method is based on the knowledge that through grouping, the data become approximately normally distributed and the test statistics follow a X2 distribution. Some issues (e.g., sample size) regarding this method are discussed in Section 3. It should be noted that the comparison of different models could be achieved by means of Akaike's information criterion (AIC) (Akaike, 1974) or Bayesian Information
∗ Corresponding author. Tel.: +1 979 845 9902; fax: +1 979 845 9902. E-mail addresses: yezhirui@seu.edu.cn (Z. Ye), yzhang@civil.tamu.edu (Y. Zhang), d-lord@tamu.edu (D. Lord).
,
Criterion (BIC) (Schwarz, 1978). However, similar to the previous studies (Maher and Summersgill, 1996; Wood, 2002; Agrawal and Lord, 2006), this research intends to study statistics for the GOF of a given model (either Poisson model or NB model), that is, to investigate how well a developed model fit observed data.
This study has three objectives. The first objective is to examine all the traditional test statistics and compare their performance for the GOF of GLMs subjected to low sample means. Secondly, this study will propose a new test statistic that is not dependent on the sample size for Poisson regression model, as opposed to the grouped G2 method. The proposed method is easy to use and does not require grouping data, which is time consuming and may not be feasible to use ifthe sample size is small.Moreover, as will be shown in this study, the proposed method can be used for lower sample means than documented in previous studies. The third objective is to provide guidance on how and when to use appropriate test statistics for both Poisson and NB regression models, especially the grouped G2 method that is complex and may not ready for practitioners.
GLMs represent a class of fixed-effect regression models for dependent variables (McCullagh and Nelder, 1989), such as crash counts in traffic accident models. Common GLMs include linear regression, logistic regression, and Poisson regression. Given the characteristics of motor vehicle collisions (i.e., random, discrete, and non-negative independent events), stochastic modeling methods need to be used over deterministic methods. The two most common stochastic modeling methods utilized for analyzing motor vehicle crashes are the Poisson and the NB regression models. For these models, the relationship between traffic accidents and explanatory variables is established through a log linear function (i.e., canonical link or linear predictor). For example,to establish the crash–flow relationshipatintersections,thefittedmodel canfollow the form - = ˇ0 × Fˇ1 1 × Fˇ2 2 , where is the estimated number of crashes, F1 and F2 are the entering AADTs (average annual daily traffic) for major and minor approaches, and ˇ0,ˇ1,ˇ2 are the estimated coefficients. This fitted model can thus be used for predicting crashes for different flow values.
The Poisson regression model aims at modeling a crash count variable Y, which follows a Poisson distribution with a parameter (or mean) -. The probability that the number of crashes takes the value yi on the ith entity is P(Yi = yi) = fYi (yi; i) = yi i × e−ui/yi!, i = 1, 2,..., n. For a Poisson distribution, the variance is equal to the mean.
The systematic portion of the model involves the explanatory variables x1, x2,..., xm, such as traffic volumes, highway geometrics, v/c (volume/capacity) ratios and so on. The model is then established through a linear predictor . This predictor is usually a linear function of the logarithm of the explanatory variables
in traffic crash models: $$\eta = \beta0 + \sum{i=1}^n \beta_i x_i$$ , where $\beta_i$ is the Pois-
son regression coefficient for the ith explanatory variable xi. The coefficients are estimated based on observed data. Finally, the model is estimated through a logarithm link function i = g(i) = log(i) (Myers et al., 2002). The function i = exp (ˇXi) is also called a Safety Performance Function (SPF), where ˇ is a vector of estimable parameters (AASHTO, 2010).
Although Poisson regression models are rather simple, crash data often exhibit overdispersion, meaning that the variance is greater than the mean. The NB regression models are thus used for modeling such data. The NB regression models have the same forms of linear predictor and logarithm link function as the Poisson regression models, except that the response variable Y follows a NB distribution, in which the probability mass function (pmf) is defined as follows:P(Yi = yi) = fYi (yi;; i) = (+yi) ()× (yi+1)( i+ ) ( -i+ ) yi ,where (·) is a Gamma function, and is the inverse dispersion parameter. The relationship between the variance and the mean of NB distribution is presented as Var(Yi) = i + i /. The inverse dispersion parameter is usually assumed to be fixed and can be estimated from observed data using themethod ofmoments or the (Bootstrapped)maximumlikelihood (Anscombe, 1949; Fisher, 1941; Zhang et al., 2007).However, recent research has shown that the inverse dispersion parameters may be related to the explanatory variables (Miaou and Lord, 2003; Mitra and Washington, 2007).
As noted above, the SPF for the Poisson regression model is denoted by i = exp (ˇXi), while the SPF for the NB regression model introduced an error term to account for overdispersion i = exp (ˇXi + εi). The error termexp (εi)is assumed to be gammadistributed with mean 1 and variance 1/. Thus, the Poisson regression model is actually a limiting model of the NB regression model as 1/ approaches zero. The selection between these two models is dependent upon the value of 1/.
GOF tests use the properties of a hypothesized distribution to assess whether or not observed data are generated from a given distribution (Read and Cressie, 1988). The most well known GOF test statistics are Pearson's X2 and the scaled deviance (G2). Pear-
son's $$X^2$$ is generally calculated as follows: $X^2 = \sum_{i=1}^{n} [y_i - \mu_i/\sigma_i]$
i=1 where yi is the observed data, i is the true mean from the model, and i is the error and is usually represented by the standard deviation of yi. The scaled deviance is calculated as twice the difference between the log-likelihood under the maximum model and the log-likelihood under the reduced (or unsaturated) model: G2 = 2(log Lmax . − log Lred.) (Wood, 2002). The maximum (or full) model is a model with a parameter for every observation so that the data are fitted exactly (e.g., g(x) = b0 + bixi), while the reduced modelis amodel withreducedvariables (e.g., g(x) = b0 orno covariates).
Previous research has shown that both the Pearson's X2 and G2 statistics are not 2 distributed under low sample mean conditions (Maycock and Hall, 1984; Maher and Summersgill, 1996; Wood, 2002; Fridstrom et al., 1995; Agrawal and Lord, 2006). To solve this problem, Maher and Summersgill (1996) proposed a test statistic (G2/E(G2)) for GOF tests. Wood (2002) showed that this test still failed with low sample mean values. Wood (2002)then suggested a grouped G2 test statistic for solving this problem. The development of the grouped G2 is based on the knowledge that by increasing the mean value, the data are approximately normally distributed and the statistics follow a 2 distribution. This method first determines an appropriate group size r, which is the minimum grouping size. The raw data are then grouped so that each observation is in a group of size at least as large as r. Additional details about the other steps can be found in Wood (2002).
There are some issues with this method, however, that need to be addressed with the method proposed by Wood (2002). First, the grouping size may vary from group to group with a minimum grouping size, which is determined by the sample mean of a Poisson model or the critical mean values in a NB model, as defined in Wood (2002). Thus, it is possible that changing grouping sizes while maintaining the same minimum grouping size may lead to different testing results. Second, through grouping, the sample size will be smaller, and that may become an issue especially when the grouping size is not small. Thus, as commented byWood, a compromise has to be made between strong grouping (which ensures that the Chi-square assumption for the distribution of the test statistic holds) and weak grouping (which allows to test against a richer alternative hypothesis). Finally, the grouped G2, which includes five steps, is not a simple procedure for practitioners or average transportation safety analysts who frequently analyze crash data.
To summarize, several GOF test statistics have been proposed to evaluate the fit of models, but their performance and complexity vary greatly. Therefore, simple but accurate and reliable alternative test statistics are highly desirable to accountfor the LMP commonly observed in crash studies.
In Wood's study (2002), a simple criterion to assess whether or not a test statistic is appropriate for testing the GOF of regression models is to examine the test statistic'sperformance for a singledistribution (Poisson or NB) with known parameters. For this criterion, the grouped G2 method was developed to improve the normality of observations and allow themeanand variance oftheG2 statistic (for low mean values) to be close to 1 and 2 (2 1 distributed), respectively. Similarly in this study, we examine the mean and variance of different statistics under a single distribution context to judge their appropriateness for the GOF of GLM.
The most common test statistics are Pearson's X2 and the scaled deviance (G2). For a Poisson model, the variance is equal to the mean and Pearson's X2 is presented below:
$$X^{2}(\mu; n) = \sum{i=1}^{n} \left[ \frac{y{i} - \mu{i}}{\sigma{i}} \right]^{2} = \sum{i=1}^{n} \frac{(y{i} - \mu{i})^{2}}{\mu{i}}$$ (1)
The scaled deviance for a Poisson model is (Maher and Summersgill, 1996)
$$G^{2}(\mu; n) = \sum{i=1}^{n} 2 \left[ y{i} \quad \log \left( \frac{y{i}}{\mu{i}} \right) - (y{i} - \mu{i}) \right]$$ (2)
In this paper, we investigate other test statistics for the GOF test of the Poisson model, especially when it is characterized by low sample mean values. This research draws from some other works in the statistical literature.
Cressie and Read (1984, 1988)incorporated the Pearson's X2 and G2 statistics into a family of "Power-Divergence Statistics" (PD , ∈ R). In this family, each member PD is the sum of deviance between the observed and expected counts:
$$PD{\lambda} = \sum{i} a{\lambda}(y{i}, \mu{i}) = \frac{2}{\lambda(\lambda + 1)} \sum{i=1}^{n} \left[ y{i} \left( \left( \frac{y{i}}{\mu_{i}} \right)^{\lambda} - 1 \right) \right],$$
$$-\infty < \lambda < +\infty$$ (3)
where a denotes the distance function. Different values of lead to different GOF statistics (Cressie and Read, 1984, 1988; Baggerly, 1998), such as the Pearson's X2 statistic when = 1, the Freeman–Tukey statistic F2 = PD =−1/2 = 4 n i=1 √yi − √-2 when = −1/2 (Freeman and Tukey, 1950), and the Neyman-modified
X2 statistic NM2 = PD =−2 = i=1 (yi−i) yi when = −2 (Neyman,
1949). The Power-Divergence statistic can be also written as (Cressie and Read, 1989)
$$PD{\lambda} = \frac{2}{\lambda(\lambda+1)} \sum{i=1}^{n} \left[ y_i \left( \left( \frac{y_i}{\mu_i} \right)^{\lambda} - 1 \right) - \lambda(y_i - \mu_i) \right],$$ $$-\infty < \lambda < +\infty \tag{4}$$
Hence, when → 0, the power divergence leads to the G2 statistic (Cressie and Read, 1989).
Cressie and Read (1988) recommended = 2/3, with which the statistic PD =2/3 will be approximated by the 2 distribution in many situations and give the most reasonable power for GOFs. When = 2/3, the test statistic of Power-Divergence becomes
$$PD{\lambda=2/3} = \sum{i=1}^{n} [((y_i/\mu_i)^{2/3} - 1) - (6/5(y_i - u_i))], \text{ as derived from}$$ Eq. (4).
GOF tests using different statistics rest on the assumption that the statistics follow an approximate 2 distribution that has a mean of 1 and a variance of 2. Thus,to evaluate a test statistic for GOF tests, we can investigate how well its components follow a 2 distribution. With this criterion, different test statistics can be compared and evaluated.
Pearson's X2, the G2, Power-Divergence with = 2/3 (PD =2/3), n
and the Freeman–Tukey statistic $$F^2 = 4\sum_{i=1}^{n}(\sqrt{y_i}-\sqrt{\mu_i})^2$$ (Freeman
and Tukey, 1950) are used for the examination of the fit of 2 distributions. In the case that crash data have zero counts at some locations, the Neyman-modified X2 goes to infinity and is therefore excluded from the comparison analysis. Fig. 1 shows the mean and variance of the components of those four statistics, for the Poisson mean less than 10. The following equations show the calculations of mean and variance of the Pearson's X2 statistic, given a known Poisson mean value (-
$$E(X^{2}) = \sum{y=0}^{\infty} X^{2} f{Y}(k; \mu)$$ (5)
$$V(X^2) = \sum_{y=0}^{\infty} [X^2 - E(X^2)]^2 f_Y(k; \mu)$$ (6)
where fY (k; -) is the pmf of Poisson distributions and k is the number of occurrence of an event. The mean and variance of other statistics over different values can be calculated in this way.
The comparisons are first conducted for values varying from 1 to 10. They are shown in Fig. 1. From this figure, Pearson's X2 has a mean value (E(X2)) of 1 for all values, but its variance (V(X2)) is greater than 2. With the decrease of -, the variance increases. Thus, for low conditions, Pearson's X2 is not reliable and as a result, tends to overestimate GOF values (results of GOF testing). In fact, V(X2) is equal to 2 + 1/ and this has also been described in the study by Wood (2002). The mean of the scaled deviance (E(G2)) is slightly larger than 1 (when - > 1) and moves toward 1 as rises; the variance (V(G2)) increases from less than 1 to around 2.4 and then decreases toward 2. The Freeman–Tukey statistic does not have a good fit of 2 distributions even when -= 10. The mean
Fig. 1. Mean and variance of the components of different test statistics for 0 < -< 10.
and the variance of the PD =2/3 statistic, however, are rather close to 1 and 2 respectively. The components of the PD =2/3 statistic fit 2 distributions almost perfectly as long as - > 1. Therefore, the PD =2/3 is recommended for GOF tests for -∈ [1, 10].
Fig. 2 shows the comparison of mean and variance of X2, G2, and PD =2/3, for 0.1 ≤ - < 1. It can be observed that E(G2) varies from 0.47 to 1.15, while E(PD) increases from 0.7 to 0.98. Overall, E(PD) is more stable based on the rate of increase and is much closer to
Fig. 2. Mean and variance of components of different test statistics for 0.1 ≤ -≤ 1.
1.0 than E(G2). For - ≥ 0.3, the difference between E(PD) and E(X2), which is exactly 1, is very small and negligible. V(G2) is always less than 2 and even less than 1 given - < 0.7; V(PD) has the same tendency as V(X2), but is more stable and gets close to 2.0 even when is as small as 0.3, while V(X2) stays above 3.0 at - = 1. It can be also seen that V(PD) performs like a compromise between V(X2) and V(G2). From the above comparisons, for - ∈ [0.3, 1], the components of PD =2/3 are approximately 2 distributed and PD =2/3 performs better than the other statistics. For - < 0.3, no statistic is reliable for GOF tests, and practitioners may consider turning to the more complicated grouped G2 method.
Based on Figs. 1 and 2, PD =2/3 is better than the other statistics and its components generally fit 2 distributions well for - > 0.3. Pearson's X2 is slightly better than G2 for - > 3, but even when - = 10, Pearson'sX2 and the G2 are not satisfactory, with means and variances of (E(X2) = 1.00, V(X2) = 2.10) and (E(G2) = 1.02, V(G2)= 2.09), respectively.
To show how the test statistics affects the estimate of GOF of Poisson models, two examples using observed crash data are provided. It is worth noting that the core of the study is to statistically investigate the performance of different test statistics for GOF under low mean conditions. The following data are used as examples to help support the findings from statistical investigation, but not to serve as alternative approach to investigate their performance.
For the first example, the data were collected at 59 four-legged unsignalized intersections in 1991 in Toronto, Ontario (Lord, 2000). The dataset includes the number of crashes and entering AADT for the major and minor approaches at each site. Both Poisson and NB GLM were used for modeling this dataset, but the NB model converged to Poisson, with an inverse dispersion parameter that tended toward infinity (Lord and Bonneson, 2007). The mean ofthis dataset is 0.97. The variance is roughly the same as the mean. The statistical descriptions of the sample data are presented in Table 1.
A Poisson GLM could be used for modeling this dataset. The functional form -= ˇ0 × Fˇ1 1 × Fˇ2 2 is used for the prediction of the
Table 1 Descriptions of the dataset.
| Variable | Mean | Variance | Max | Min | No. of years |
|---|---|---|---|---|---|
| Crash | 0.97 | 1.07 | 4 | 0 | 1 |
| AADT (major approach) (veh/day) | 25.641 | 1.15 × 108 | 51,820 | 5669 | 1 |
| AADT (minor Approach) (veh/day) | 1850 | 2.58 × 106 | 8361 | 378 | 1 |
Table 2 Modeling outputs of the Poisson model.
| Coefficients | Est. value | Std. error | z value | Pr (> z ) |
|---|---|---|---|---|
| ˇ0 | 2.3439E−06 | 4.2895 | −3.022 | 0.0025 |
| ˇ1 | 0.8175 | 0.3145 | 2.599 | 0.0093 |
| ˇ2 | 0.6348 | 0.2349 | 2.7303 | 0.0069 |
Table 3 Results of GOF tests for the Poisson model.
| Statistics | X2 | PD | G2 | F2 |
|---|---|---|---|---|
| GOF value | 52.71 | 51.76 | 59.85 | 93.41 |
| Degrees of freedom | 56 | 56 | 56 | 56 |
| p-Valuea | 0.60 | 0.64 | 0.34 | 0.00 |
| Expectationb | 1.00 | 0.98 | 1.14 | 1.81 |
| Variancec | 3.03 | 1.99 | 1.23 | 3.20 |
Table 4 Descriptions of the dataset.
| Variable | Mean | Variance | Max | Min | No. of years |
|---|---|---|---|---|---|
| Crash | 1.39 | 1.64 | 6 | 0 | 1 |
| Segment length (mi) | 2.156 | 0.982 | 5.34 | 1.00 | 1 |
| AADT (veh/day) | 939 | 1.41 × 106 | 6400 | 110 | 1 |
number of crashes. As stated by Lord (2006), it is the most common functional form used by transportation safety analysts for modeling crash data at intersections. The outputs of the fitted model are shown in Table 2. It can be seen that all coefficients are still significant even at the significance level of 0.01.
Pearson's X2, G2, PD =2/3, and F2 are used for the GOF test of this Poisson model. The results of the GOF tests are summarized in Table 2. The PD =2/3 statistichas a lower GOF value andcorrespondingly a higher p-value than the Pearson's X2 statistic. The GOF value of G2 is higher than Pearson's X2. The F2 statistic has the lowest pvalue. To explain their differences, Table 3 also lists the mean and variance of those test statistics given the Poisson mean - = 0.97. The mean and variance of the distribution of the test statistics can also be seenfromFig. 1 or Fig. 2.Itis clear thatthe components ofthe PD =2/3 statistic are rather close to a 2 distribution. For the Pearson's X2 statistic, E(X2) = 1 and V(X2) = 3.03. The variance V(X2) is larger than 2 and may have overestimated the GOF value given E(X2) = 1. For the G2 statistic, although V(G2) = 1.23 < 2,the mean E(G2) = 1.14 is higher than 1 and can also result in overestimations of GOF values. Similarly, the F2 statistic will also overestimate GOF values.
For the second example, the data were collected at 88 frontage road segments in the State of Texas (Lord and Bonneson, 2007). The dataset includes the number of serious injury crashes (KAB or K = fatal, Injury Type A – incapacitated, and injury Type B – non-incapacitated), segment length, and AADT. The mean of this dataset is 1.39 and the variance is 1.64 (Table 4).
Both Poisson and NB GLM were used for modeling this dataset, but the NB model converged to Poisson, with an inverse dispersion parameter that tended toward infinity (Lord and Bonneson, 2007). The functional form - = ˇ0 ∗ L ∗ Fˇ1 was used for the prediction of the number of crashes, where L represents the segment length and F is the AADT. The modeling results are shown in Table 5. It can be seen that both coefficients are significant at the significance level of 0.01.
Again, Pearson's X2, G2, PD =2/3, and F2 are used for the GOF test of this Poisson model. As can be seen from Table 6, the GOF testing results are consistent with those of the first example, which does not warrant further discussion.
For NB distributions, the variance can be calculated as Var(Yi) = i + i /. Thus, the Pearson's X2 statistic becomes X2(-; n) = n i=1 [yi − i/i] 2 = n i=1 [(yi − i) 2/(i + i /)]. Based on the
Table 5 Modeling outputs of the Poisson model.
| Coefficients | Est. value | Std. error | z value | Pr (> z ) |
|---|---|---|---|---|
| ˇ0 | 0.01536 | 0.8374 | −4.987 | 6.14e−07 |
| ˇ1 | 0.5874 | 0.1195 | 4.916 | 8.82e−07 |
Table 6 Results of GOF tests for the Poisson model.
| Statistics | X2 | PD | G2 | F2 |
|---|---|---|---|---|
| GOF value | 104.84 | 103.01 | 116.08 | 168.87 |
| Degrees of freedom | 86 | 86 | 86 | 86 |
| p-Value | 0.08 | 0.10 | 0.02 | 0.00 |
| Expectationa | 1.00 | 0.99 | 1.14 | 1.75 |
| Varianceb | 2.81 | 1.99 | 1.70 | 4.76 |
definition of the scaled deviance (Wood, 2002), the G2 statistic for a NB model is calculated by:
$$G^{2}(\mu;\phi;n) = 2\sum{i=1}^{n} \left[ \phi \log \left( \frac{\mu{i} + \phi}{y{i} + \phi} \right) + y{i} \log \left( \frac{y{i}(\mu{i} + \phi)}{\mu{i}(y{i} + \phi)} \right) \right]$$ (7)
To show the accuracy and reliability of the Pearson's X2 and G2 statistics for GOF tests,the components ofthese statistics are examined again, using the same kind of calculations shown in Eqs.(5) and (6), in which fY (·) is now the pmf of the NB distribution. Note that the Power-Divergence statistics were not used as test statistics in this study for the NB distribution, since they do not exist in the statistical literature. The mean and variance of the Pearson's X2 and G2 statistics with different parameter settings are shown in Fig. 3. The NB mean (-) varies from 0 to 10;the inverse dispersion parameters () are 1, 3 and 5, respectively. It can be observed that has a great effect on the distributions of those two statistics. For the Pearson's X2 statistic,the smaller the inverse dispersion parameter,the larger the V(X2) value, given a known NB mean value. The components of the Pearson's X2 statistic do not fit 2 distributions, as V(X2) is generally much larger than 2 for low values. V(X2) is still larger than 3 even when - = 10 and = 5. Therefore, the Pearson's X2 statistic will underestimate the degree of fit (p-value) and tend to reject fitted models more easily in practice. For the G2 statistic, V(G2) may increase or decrease drastically for - < 1, then gradually stabilizes depending on . When is as high as 10 and = 1, the variance V(G2) is still not quite stable.
With the increase of , the value for V(G2) to become stable decreases. For example, when = 3, V(G2) becomes stable when is around 4, and when = 5, V(G2) will be relatively stable when is around 3. E(G2) is generally greater than 1 for - > 1 and less than 1 for 0 < - < 1. [Important note:the inverse dispersion parameter is assumed to be properly estimated. As discussed by Lord (2006), the inverse dispersion parameter can become misestimated as the sample mean values decrease and the sample size becomes small.]
Overall, both Pearson's X2 and G2statistics are not quite accurate and reliable for the GOF test of NB models with low sample means, especially when the crash data are highly overdispersed ( is small). As a result,the authors recommend the use ofthe grouped G2 method for the GOF test of NBmodels.An example is given below to show the differences between GOF test statistics for NB models.
An annual crash–flow dataset was collected from 255 signalized 3-legged intersections in Toronto, Ontario (Lord, 2000). This dataset includes the number of serious injury crashes and entering AADTs for the major and minor approaches at each intersection. The crash counts are overdispersed with a mean of 1.43 and a variance of 3.49 (Table 7).
A NB regression model was used for the modeling ofthis dataset. The functional form - = ˇ0 × Fˇ1 1 × Fˇ2 2 was again used for the prediction of the number of crashes. The results of the fitted model are summarized in Table 8. All the coefficients are significant at the significant level of 0.01. The inverse dispersion parameter was estimated to be 2.76.
Fig. 3. Mean and variance of components of the X2 and G2 statistics.
Table 7 Descriptions of the dataset.
| Variable | Mean | Variance | Max | Min | No. of years |
|---|---|---|---|---|---|
| Crash | 1.43 | 3.49 | 14 | 0 | 1 |
| AADT (major approach) (veh/day) | 27,041 | 9.39 × 107 | 61,940 | 1663 | 1 |
| AADT (minor Approach) (veh/day) | 3689 | 9.76 × 106 | 17,125 | 101 | 1 |
Table 8 Modeling outputs of the negative Binomial model.
| Coefficients | Est. value | Std. error | z value | Pr(> z ) |
|---|---|---|---|---|
| ˇ0 | 7.988E−07 | 2.0122 | −6.978 | 3.00E−12 |
| ˇ1 | 1.0241 | 0.1951 | 5.249 | 1.53E−07 |
| ˇ2 | 0.4868 | 0.0821 | 5.926 | 3.10E−09 |
Table 9 Results of GOF tests for the negative Binomial model.
| Statistics | X2 | G2 | Grouped G2 | | |--------------------|--------|--------|------------|--| | GOF value | 282.20 | 269.80 | 136.46 | | | Degrees of freedom | 252 | 252 | 125 | | | p-Value | 0.09 | 0.21 | 0.23 | | | Expectationa | 1 | 1.12 | N/A | | | Varianceb | 4.63 | 1.42 | N/A | |
Pearson's X2, G2 and the grouped G2 were used for evaluating the GOF test of the NB model. According to the grouping rules in (Wood, 2002),theminimumgrouping size for the datasetis equalto 2, andthe expressionfor calculating the groupedG2 isGrouped G2 =
$$2\sum{i=1}^{n} r{i}[\phi \log (\mu{i} + \phi/y{i} + \phi) + y{i} \log (y{i}(\mu{i} + \phi)/\mu{i}(y_{i} + \phi))], \text{ where}$$
i=1 ri is the grouping size for the ith group.
The results of GOF tests are summarized in Table 9. The degrees of freedom are 252 for Pearson's X2 and G2, and 125 for the grouped G2. All three test statistics accepted the fitted model at the significance level of 0.05. The grouped G2 statistic and the Pearson'sX2 statistic have the highest and lowest p-Values, respectively. The table also shows the expectations and variances of the components of Pearson's X2 and G2 statistics, given the known parameters (and ). It can be seen that E(X2) is 1 and V(X2) is 4.63. V(X2) is much larger than 2 and this has caused the overestimation of GOF values. Thus, the p-value (0.09) of the X2 is lower than the actual value. E(G2) and V(G2) with low NB mean (-) values are shown in Fig. 4 for = 2.76. When is around 1.43, E(G2) is higher than 1, which may have resulted in the overestimation of GOF values and underestimation of the power of fit; V(G2) is very unstable for low values. The p-value of the grouped G2 statistic is slightly higher than that
Fig. 4. E(G2) and V(G2) versus NB mean with = 2.756.
of G2. This is expected since the G2 statistic has underestimated the true p-value. Thus, this example shows that the grouped G2, although more complicated than the traditional methods, provides better results for the GOF test of NB models.
The results of this study show that the Pearson's X2 statistic tends to overestimate GOF values for low values, since V(X2) are larger than 2. This is because the components (i.e., (yi − i) 2/for Poisson models) will be inflated when the predicted values (i) are low. For instance, with the observed crash dataset in the first case, the Poisson model predicted 1.02 crashes per year for one of the intersections. However, 4 crashes were observed at that intersection. The contribution to X2would be (4 − 1.02)2/1.02 = 8.71 and larger than the nominal value. The phenomenon explains why V(X2) > 2 for low values.
Undoubtedly, for Poisson regression models, the Power-Divergence statistic (PD =2/3) follows an approximate 2 distribution and is the best test statistic for measuring the GOF for these models. This statistic performs better than the other three statistics for almost all values, except when is very low. However, when is very small, no test statistics can provide accurate and stable results of GOF tests. For- < 1, the variance of PD =2/3 statistic (V(PD)) performs like a compromise between V(X2) and V(G2), and contributes to more accurate and stable GOF tests.
From Figs. 1 and 3, it is also observed that the performance of Pearson's X2 and G2 becomes worse with the increase in overdispersion. The Poisson model is a special case of the NB model, in which the inverse dispersion parameter is infinite. Therefore, the estimation of the inverse dispersion parameter from observed data will affect the results of GOF tests. It should be noted that the traditional estimators of the inverse dispersion parameter do not have accurate and stable estimations under low mean conditions, as described above (Lord, 2006). For NB models, both Pearson's X2 and G2 do not have accurate results of GOF tests, especially under low sample mean conditions. Under such conditions, the grouped G2 method is recommended, as it will provide better results for GOF tests of NB models.
Fig. 5. Recommended minimum means for grouping versus inverse dispersion parameter of the NB model.
The results of this study provide guidance on the use of the grouped G2 method. Based on the curves of G2 illustrated in Fig. 1, it is found that the G2 method or the grouped G2 method is an appropriate test statistic only when the grouped mean is 1.5 or higher. Theoretically, the grouped G2 method can be used for samples with extreme low means (e.g. less than 0.3). However, when grouping a sample with a low mean value to achieve a grouped mean of 1.5 or higher,the grouped sample size will be significantly reduced, which may lead to issues associated with small samples. For NB regression models, the problem becomes more complex as the minimum grouped mean is determined by the inverse dispersion parameter (). The recommended minimum means for grouping for different inverse dispersion parameters are shown in Fig. 5. The minimum mean decreases when increases. For less than 1, the minimum mean increases sharply with a decreasing . Thus, when using the grouped G2 method, the grouped mean is suggested to meet the requirements presented in this figure. With the increase of the inverse dispersion parameter toward infinite (Poisson model), the recommended minimum mean decreases slowly to approximately 1.5.
The NB regression model is the most commonly type of model that is utilized for analyzing traffic crashes. Depending on the characteristics of the data, the Poisson model has been found to be a suitable model on rare occasions. These models help establish the relationship between traffic crashes (response variable) and traffic flow, highway geometrics, and other explanatory variables. To evaluate their statistical performance, GOF tests need to be used. Since crash data are often characterized by low sample mean values and it has been found that traditional GOF statistics do not perform very well under these conditions. Consequently, there was need to determine whether alternative GOF statistics could be used for data characterized by low sample mean values.
This study examined the performance oftest statistics for evaluating the GOF of crash models, propose better statistics, and provide useful recommendations for GOF tests for data characterized by low sample mean values. For Poisson models, this paper introduced a test statistic (PD = 2/3) that is superior to the traditional statistics. The study showed that the PD =2/3 statistic has accurate GOF tests even when the sample mean is as low as 0.3. For NB distributions with low sample mean values, this paper found that the traditional statistics do not have accurate estimates of the power of fit. Under such conditions, the more complex grouping method is recommended as a remedy. However, due to its complexity, this method was not ready for practitioners. It was thus important to provide guidance on the use of this method. For better illustrations, three examples using observed crash data were used to show the differences of test statistics in GOF tests for Poisson and NB models. The introduction of the PD =2/3 test statistic and the guidance on using test statistics are advisable to both researchers and practitioners with regard to handling the low mean problem.
Two aspects ofthis study could be valuable to the state of knowledge and practice. First, this study provided guidance on the use of GOF test statistics for both NB and Poisson model. The guidance will benefit transportation engineering researchers to better learn about GOF testing of crash modeling, and help practitioners perform GOF testing more appropriately in a simpler way. Secondly, this study went beyond other studies in terms of low sample mean. The low sample mean problem was investigated comprehensively, and with the introduction of better statistics from the statistical literature this study improved the knowledge base of traffic safety analysis.
Inthe statisticalliterature, some researchers (Gurtler andHenze, 2000; Spinelli and Stephens, 1997; Baringhaus and Henze, 1992; Kim and Park, 1992; Kocherlakota and Kocherlakota, 1986; Baglivo et al., 1992) have also examined the performance of GOF test statistics for the Poisson model. Examples include the Cramer–von Mises test statistic and the Kolmogorov–Simirnov test statistic, both wellknown for testing the GOF for continuous distributions (Henze and Klar, 1995). Future work can be also conducted to examine whether these test statistics for Poisson models developed using data characterized by low sample mean values perform well. Moreover, Carota (2007) extended the Power-Divergence to a Bayesian nonparametric context, under which the Power-Divergence may be an appropriate test statistic for testing NB regression models. Future work can also be conducted in this regard. However, the complexity ofthe Power-Divergence with a Bayesian extension can be a barrier for transportation analysts even if it performs well for low mean conditions.
The authors greatly acknowledge the comments provided by Dr. Graham Wood from the Department of Statistics at Macquarie University in Sydney, Australia. This study is supported by National Natural Science Foundation of China (Grant No. 51128802) and Jiangsu Province leading disciplines of universities program.
American Association of State Highway Transportation Officials, 2010. Highway Safety Manual, 1st ed. AASHTO, Washington, DC.
Agrawal, R., Lord, D., 2006. Effects of Sample Size on the Goodness-of-Fit Statistic and Confidence Intervals of Crash Prediction Models Subjected to Low Sample mean Values. CD-ROM. Transportation Research Board, National Research Council, Washington, DC.
Akaike, H., 1974. A new look atthe statistical model identification. IEEE Transactions on Automatic Control 19 (6), 716–723.
Anscombe, F.J., 1949. The statistical analysis of insect counts based on the negative binomial distributions. Biometrics 5, 165–173.
Baggerly, K.A., 1998. Empirical likelihood as a goodness-of-fit measure. Biometrika 85 (3), 535–547.
Baglivo, J., Olivier, D., Pagano, M., 1992. Methods for exact goodness-of-fit tests. Journal of the American Statistical Association 87, 464–469.
Baringhaus, L., Henze, N., 1992. A goodness of fit test for the Poisson distribution based on the empirical generating function. Statistical and Probability Letters 13, 269–274.
Carota, C., 2007. A family of power-divergence diagnostics for goodness-of-fit. The Canadian Journal of Statistics 35 (4), 549–561.
Cressie, N.A.C., Read, T.R.C., 1984. Multinomial goodness-of-fittests. Journal of Royal Statistical Society Serious B 46 (3), 440–464. Cressie, N.A.C., Read, T.R.C., 1988. Goodness-of-Fit Statistics for Discrete Multivariate
Data. Springer, New York. Cressie, N.A.C., Read, T.R.C., 1989. Pearson's X2 and the log likelihood ratio statistic
G2: a comparative review. International Statistical Review 57 (1), 19–43.
Fisher, R.A., 1941. The negative binomial distribution. Annals of Eugenics 11, 182–187.
Freeman, M.F., Tukey, J.W., 1950. Transformations related to the angular and the square root. Annals of Mathematical Statistics 21, 607–611.
McCullagh, P., Nelder, J.A., 1989. Generalized Linear Models, 2nd ed. Chapman & Hall, New York.
Miaou, S.-P., 1994. The relationship between truck accidents and geometric design of road sections: Poisson versus negative binomial regressions. In: 73rd Annual Meeting of Transportation Research Board, Washington DC.
Miaou, S.-P., Hu, P.S., Wright, T., Rathi, A.K., Davis, S.C., 1992. Relationships between truck accidents and highway geometric design: a Poisson regression approach. Transportation Research Record 1376, 10–18.
Miaou, S.-P., Lord, D., 2003. Modeling traffic crash–flow relationships for intersections: dispersion parameter, functional form, and bayes versus empirical bayes. Transportation Research Record 1840, 31–40.
Miaou, S.-P., Lum, H., 1993. Modeling vehicle accidents and highway geometric design relationships. Accident Analysis and Prevention 25 (6), 689–709.
Mitra, S., Washington, S., 2007. On the Nature of Over-dispersion in Motor Vehicle Crash Prediction Models. Accident Analysis & Prevention 39 (3), 459–468.
Myers, R.H., Montgomery, D.C., Vining, G.G., 2002. Generalized Linear Models, with Applications in Engineering and the Sciences. John Wiley & Sons, Inc., New York.
Poch, M., Mannering, F.L., 1996. Negative binomial analysis of intersection accident frequency. Journal of Transportation Engineering 122 (2), 105–113.
Neyman, J., 1949. Contribution to the Theory of the 2 Test. Proceedings of the First Berkeley Symposium on Mathematical Statistics and Probability, 239–273.
Read, T.R.C., Cressie, N.A.C., 1988. Goodness-of-fit Statistics for Discrete Multivariate Data. Springer-Verlag, New York.
SAS Institute Inc., 1999. The GENMOD Procedure. http://support.sas.com/ documentation/cdl/en/statug/63033/HTML/default/viewer.htm#genmod toc. htm. (accessed 21.03.11).
Schwarz, G., 1978. Estimating the dimension of a model. Annals of Statistics 6 (2), 461–464.
Spinelli, J.J., Stephens, M.A., 1997. Carmer-von mises tests of fit for the Poisson distribution. The Canadian Journal of Statistics 25 (2), 257–268.
Sukhatme, P.V., 1938. On the distribution of 2 in samples of the Poisson series. Journal of the Royal Statistical Society: Serious B 5, 75–79.
Wood, G.R., 2002. Generalized linear accident models and goodness-of-fit testing. Accident Analysis and Prevention 34 (4), 417–427.
Zhang, Y., Ye, Z., Lord, D., 2007. Estimating the dispersion parameter of the negative binomial distribution for analyzing crash data using a bootstrapped maximum likelihood method. Transportation Research Record 2019, 15–21.