The GENMOD Procedure

Example 45.3 Gamma Distribution Applied to Life Data

(View the complete code for this example.)

Life data are sometimes modeled with the gamma distribution. Although PROC GENMOD does not analyze censored data or provide other useful lifetime distributions such as the Weibull or lognormal, it can be used for modeling complete (uncensored) data with the gamma distribution, and it can provide a statistical test for the exponential distribution against other gamma distribution alternatives. See Lawless (2003) or Nelson (1982) for applications of the gamma distribution to life data.

The following data represent failure times of machine parts, some of which are manufactured by manufacturer A and some by manufacturer B.

data A;
   input lifetime @@;
   mfg = 'A';
   datalines;
620  470  260  89   388  242
103  100  39   460  284  1285
218  393  106  158  152  477
403  103  69   158  818  947
399  1274 32   12   134  660
548  381  203  871  193  531
317  85   1410 250  41   1101
32   421  32   343  376  1512
1792 47   95   76   515  72
1585 253  6    860  89   1055
537  101  385  176  11   565
164  16   1267 352  160  195
1279 356  751  500  803  560
151  24   689  1119 1733 2194
763  555  14   45   776  1
;

data B;
   input lifetime @@;
   mfg = 'B';
   datalines;
1747 945  12   1453 14   150
20   41   35   69   195  89
1090 1868 294  96   618  44
142  892  1307 310  230  30
403  860  23   406  1054 1935
561  348  130  13   230  250
317  304  79   1793 536  12
9    256  201  733  510  660
122  27   273  1231 182  289
667  761  1096 43   44   87
405  998  1409 61   278  407
113  25   940  28   848  41
646  575  219  303  304  38
195  1061 174  377  388  10
246  323  198  234  39   308
55   729  813  1216 1618 539
6    1566 459  946  764  794
35   181  147  116  141  19
380  609  546
;

data lifdat;
   set A B;
run;

The following SAS statements use PROC GENMOD to compute Type 3 statistics to test for differences between the two manufacturers in machine part life. Type 3 statistics are identical to Type 1 statistics in this case, since there is only one effect in the model. The log link function is selected to ensure that the mean is positive.

proc genmod data = lifdat;
   class mfg;
   model lifetime = mfg / dist=gamma
                          link=log
                          type3;
run;

The output from these statements is displayed in Output 45.3.1.

Output 45.3.1: Gamma Model of Life Data

The GENMOD Procedure

Model Information
Data SetWORK.LIFDAT
DistributionGamma
Link FunctionLog
Dependent Variablelifetime

Class Level Information
ClassLevelsValues
mfg2A B

Criteria For Assessing Goodness Of Fit
CriterionDFValueValue/DF
Deviance199287.05911.4425
Scaled Deviance199237.53351.1936
Pearson Chi-Square199211.68701.0638
Scaled Pearson X2199175.16520.8802
Log Likelihood -1432.4177 
Full Log Likelihood -1432.4177 
AIC (smaller is better) 2870.8353 
AICC (smaller is better) 2870.9572 
BIC (smaller is better) 2880.7453 

Analysis Of Maximum Likelihood Parameter Estimates
Parameter DFEstimateStandard
Error
Wald 95% Confidence LimitsWald Chi-SquarePr > ChiSq
Intercept 16.13020.10435.92576.33473451.61<.0001
mfgA10.01990.1559-0.28570.32550.020.8985
mfgB00.00000.00000.00000.0000..
Scale 10.82750.07140.69870.9800  

Note:The scale parameter was estimated by maximum likelihood.


LR Statistics For Type 3 Analysis
SourceDFChi-SquarePr > ChiSq
mfg10.020.8985


The p-value of 0.8985 for the chi-square statistic in the Type 3 table indicates that there is no significant difference in the part life between the two manufacturers.

Using the following statements, you can refit the model without using the manufacturer as an effect. The LRCI option in the MODEL statement is specified to compute profile likelihood confidence intervals for the mean life and scale parameters.

proc genmod data = lifdat;
   model lifetime = / dist=gamma
                      link=log
                      lrci;
run;

Output 45.3.2 displays the results of fitting the model with the mfg effect omitted.

Output 45.3.2: Refitting of the Gamma Model: Omitting the mfg Effect

The GENMOD Procedure

Analysis Of Maximum Likelihood Parameter Estimates
ParameterDFEstimateStandard
Error
Likelihood Ratio 95%
Confidence Limits
Wald Chi-SquarePr > ChiSq
Intercept16.13910.07755.99046.29566268.10<.0001
Scale10.82740.07140.69590.9762  

Note:The scale parameter was estimated by maximum likelihood.



The intercept is the estimated log mean of the fitted gamma distribution, so that the mean life of the parts is

The SCALE parameter used in PROC GENMOD is the inverse of the gamma dispersion parameter, and it is sometimes called the gamma index parameter. See the section Response Probability Distributions for the definition of the gamma probability density function. A value of 1 for the index parameter corresponds to the exponential distribution . The estimated value of the scale parameter is 0.8274. The 95% profile likelihood confidence interval for the scale parameter is (0.6959, 0.9762), which does not contain 1. The hypothesis of an exponential distribution for the data is, therefore, rejected at the 0.05 level. A confidence interval for the mean life is