1. Introduction
Generalized linear models (GLMs) [
1] are among the most commonly used regression models in practice. The most frequently applied continuous GLM models are normal (Gaussian), gamma, and inverse Gaussian. The gamma and inverse Gaussian regression models are used to model right-skewed response variables, for example, modeling the lifetime distribution in reliability theory [
2,
3], claims prediction and premium computations in insurance [
4,
5,
6], healthcare costs analysis [
7,
8], and estimation of outcomes in psychology [
9].
The Gaussian GLM coincides with the most applied normal regression model, and the theory of normal regression can be found in an enormous number of articles and books on theoretical or applied statistics.
The fitting of a regression model consists of a set of steps, and one of the key steps is to check the goodness-of-fit (GOF). However, there is a lack of such tests, especially for continuous GLM such as gamma and inverse Gaussian regression. Just a few articles consider formal tests.
In many textbooks, the chi-squared approximation of Pearson and deviance statistics is recommended to test the gamma and inverse Gaussian regression models’ fit. It can lead to erroneous conclusions because this approximation is true if the shape parameter is large. It is clearly demonstrated in [
10,
11], for example. In [
11], the authors propose approximations of Pearson and deviance statistics quantiles for the gamma regression model. Unfortunately, these approximations are given only in the case of a known shape parameter
. The case of unknown
is not investigated, so these results can not be used for goodness-of-fit. In [
10], GOF tests for gamma and inverse Gaussian models are proposed by applying modifications of Cramer–von Mises and Anderson–Darling statistics. These statistics are computed using transformations of the responses via parametric estimates of their cumulative distribution functions (c.d.f.) and the inverse of the c.d.f. of the standard normal distribution. The theory is not developed rigorously: the asymptotic distributions of the test statistics are not found, and approximations of the distributions of the test statistics for finite sample sizes are not given. These tests can not be applied if the data are censored.
The score test for inverse Gaussian regression against inverse Gaussian mixture was constructed in [
12]. The authors considered cases with complete and censored data, and critical values were obtained using the bootstrap. The disadvantage is that this test is not the omnibus test. It is recommended only in the case when only one of the possible alternatives (mixture) is suspected.
The current paper is a natural continuation of our paper [
13]. In [
13], modified chi-square tests were constructed for parametric accelerated failure time (AFT) models (see also [
14]). To obtain these tests, at first, some asymptotic results for general parametric regression models (the AFT models being particular cases of these models) were rigorously obtained. In particular, asymptotic properties of the random vector of differences between the numbers of observed and “expected” failures in the intervals of a data partition (the partition is received using a uniquely defined rule) are derived. Application of general results for the following AFT models was considered: exponential, shape-scale (Weibull, log-normal, and log-logistics).
In the current article, we apply the general theorems of our paper [
13] to obtain modified chi-squared goodness-of-fit tests for continuous right-skewed possibly censored GLM models.
The inverse Gaussian regression is GLM but not the AFT; thus, new tests are needed. The gamma regression is GLM, and it is also the AFT model; however, the article [
13] on GOF for AFT models did not consider this model. Thus, we are currently investigating it.
Tests for gamma and inverse Gaussian regression models were investigated in detail. The Gaussian GLM by exponential transformation is transferred to log-normal AFT, which is considered in [
13]. We did not write the formulas for this model because GOF tests for the normal regression are well-known and investigated in many papers.
Some authors consider diagnostic plots based on residuals for the gamma and inverse Gaussian models, but they are not formal GOF tests, so they can not be compared with the proposed tests because their significance and power can not be investigated. However, diagnostic graphs are useful at the initial stage of analysis, and in conjunction with formal GOFs, provide a broader view of data. The authors [
15] proposed two new methods for the detection of influential observations in the case of the inverse Gaussian regression, and also presented a review of existing methods. In the article [
16], adjusted deviance residuals for the gamma regression model were proposed and used for influence diagnostics. The construction of partial residuals for the inverse Gaussian regression was carried out in [
17] for graphical model diagnostics.
The structure of the article is as follows: firstly (see
Section 2), continuous GLMs are discussed; furthermore, in
Section 3, the methodology of the modified chi-squared test is provided, the approach of choosing grouping intervals is explained, and the limit distribution of the test statistic is obtained. The results of the simulation study and the application for real data are presented in
Section 4 and
Section 5, respectively.
2. Gamma and Inverse Gaussian Regression Models
Let us consider the parametrization of the gamma distribution, denoted by
,
, and
, with the following probability density function (p.d.f.):
where
is the shape parameter.
If
T is a random variable with distribution
, then the mean and the variance are
and the cumulative distribution function (c.d.f.) is
where
is the c.d.f. of the chi-squared distribution with
degrees of freedom;
i.e., the lower incomplete gamma function.
Let us consider the parametrization of the inverse Gaussian distribution (also known as Wald distribution), denoted by
,
,
, with the following p.d.f.:
where
is the shape parameter. If
T is a random variable with distribution
, then the mean and the variance are
and the c.d.f. is
where
is the c.d.f. of the standard normal distribution.
The gamma and the IG distributions belong to the exponential family with a p.d.f. of the following form:
For the gamma distribution,
and for the IG distribution,
Gamma regression model: The distribution of response
T given the shape parameter
and a vector of covariates
is
and the link function is logarithmic:
Thus, the p.d.f., c.d.f., mean, and variance given the vector of covariates are as follows:
where
is the lower incomplete gamma function and
Sometimes the canonical (inverse) link function is used:
Inverse Gaussian regression model: The distribution of the response
T given the shape parameter
and a vector of covariates
is
and the link function is logarithmic:
Thus, the p.d.f, c.d.f, mean, and variance given the vector of covariates are as follows:
Sometimes, the canonical (inverse squared) link function is used:
The gamma regression model is also an AFT model, and the IG model is not an AFT model.
4. Simulation Study
The data are simulated by taking two covariates:
—dichotomous (0—for half of the observations and 1—for the remaining observations) and
Different sample sizes
n are considered. The Rice rule (see [
20]) is used to determine the number of grouping intervals (see
Table 1):
In the assumptions of the limit distribution of the test statistic, it is supposed that
k is fixed and the limit distribution is obtained to be chi-squared with
k or
degrees-of-freedom. Is the approximation accurate if
? Note that if
n is fixed, then
is also fixed. We know that if the size of the sample
is sufficiently large and
, then the chi-squared approximation is accurate. But, taking into account that
n is much larger than
k (see
Table 1), the approximation should also be good for sample size
n. Simulations confirm this.
4.1. Simulation Under Hypotheses
The estimated significance levels are obtained using 5000 iterations. Tests with significance levels
and
are applied.
Table 2 and
Table 3 present the results for gamma and inverse Gaussian regression, respectively. Grouping intervals are computed using the Rice rule (
15); moreover, different numbers of grouping intervals are considered to see how the convergence speed depends on the number of grouping intervals. The simulation results under the hypothesis demonstrate that the estimated significance levels approach the true value as the number of observations increases.
4.2. Simulation Under Alternatives
The data are simulated under various alternatives and values of parameters. For each of the sample sizes considered, we simulate 1000 replications and compute values of the test power. The significance level is 0.05.
In the case of inverse Gaussian regression, the test power under the following alternatives is investigated (see
Table 4): gamma regression, log-normal, log-logistic, and Weibull AFT models. For gamma regression, the following alternatives are considered: inverse Gaussian and normal regression, log-normal, and log-logistic and Weibull AFT models, i.e., gamma regression models with shape and scale depending on covariates.
The results in the case of gamma regression are presented in
Table 5. It has become evident that the test power under the IG regression alternative is large even for small sample sizes. The smallest test power values are in the case of the Weibull AFT model alternative, which is reasonable because gamma and Weibull models are very similar for some sets of parameters.
The results in the case of IG regression are presented in
Table 6. It turned out that the test power under all considered alternatives is large even for small sample sizes. The smallest test power values are obtained when the alternative is the log-logistic AFT model.
Moreover, the simulation study suggested that in the case of the gamma and inverse Gaussian regression, the Rice rule (
15) provides optimal grouping intervals (
) for sample sizes
, and for smaller samples the number of grouping intervals is
5. Real Data Examples
Example 1: Failure times (see
Table 7) of 76 electrical insulating fluids tested at voltages, ranging from 26 to 38 kV ([
21]), are considered.
The diagnostic methods (see [
2]) suggest that the Weibull AFT–power rule model, i.e.,
should be used. The results of applying the modified chi-squared test are presented in
Table 8. The analysis demonstrated that the Weibull AFT–power rule and gamma regression models are not rejected; however, AIC and BIC are smaller in the case of the gamma regression model. The inverse Gaussian regression model is strongly rejected.
Example 2: Hospital cost data (the dataset hospcosts from R package robmixglm) consist of a sample of 100 patients hospitalized at the Centre Hospitalier Universitaire Vaudois in Lausanne during 1999 for “medical back problems”. The response is the cost of stay, and the covariates are as follows: length of stay (in days; the logarithmic transformation was applied), admission type (0: planned; 1: emergency), insurance type (0: regular; 1: private), age (in years), sex (0: female; 1: male) and discharge destination (1: home; 0: another health institution). Data were analyzed in [
8] considering the gamma regression and [
22] in the Weibull model context.
The results of applying the modified chi-squared test are presented in
Table 9. It is clear that the Weibull AFT–power rule and gamma regression models are not rejected. However, AIC is smaller in the case of the Weibull AFT–power rule model. The inverse Gaussian regression model is strongly rejected.
Example 3: Table 10 presents the results of an experiment designed to compare the performances of high-speed turbine engine bearings made out of five different compounds (see [
2]). Data were fitted using a three-parameter Weibull distribution. The experiment tested 10 bearings of each type, and the times to fatigue failure were measured in units of millions of cycles.
The results using the modified chi-squared test are presented in
Table 11. The gamma, Weibull AFT, and inverse Gaussian regression models are rejected. The results do not contradict the results in [
2].