The LOGISTIC Procedure

Example 73.10 Overdispersion

(View the complete code for this example.)

In a seed germination test, seeds of two cultivars were planted in pots of two soil conditions. The following statements create the data set seeds, which contains the observed proportion of seeds that germinated for various combinations of cultivar and soil condition. The variable n represents the number of seeds planted in a pot, and the variable r represents the number germinated. The indicator variables cult and soil represent the cultivar and soil condition, respectively.

data seeds;
   input pot n r cult soil;
   datalines;
 1 16     8      0       0
 2 51    26      0       0
 3 45    23      0       0
 4 39    10      0       0
 5 36     9      0       0
 6 81    23      1       0
 7 30    10      1       0
 8 39    17      1       0
 9 28     8      1       0
10 62    23      1       0
11 51    32      0       1
12 72    55      0       1
13 41    22      0       1
14 12     3      0       1
15 13    10      0       1
16 79    46      1       1
17 30    15      1       1
18 51    32      1       1
19 74    53      1       1
20 56    12      1       1
;

PROC LOGISTIC is used as follows to fit a logit model to the data, with cult, soil, and cult soil interaction as explanatory variables. The option SCALE=NONE is specified to display goodness-of-fit statistics.

proc logistic data=seeds;
   model r/n=cult soil cult*soil/scale=none;
   title 'Full Model With SCALE=NONE';
run;

Results of fitting the full factorial model are shown in Output 73.10.1. Both Pearson and deviance are highly significant (), suggesting that the model does not fit well.

Output 73.10.1: Results of the Model Fit for the Two-Way Layout

Full Model With SCALE=NONE

The LOGISTIC Procedure

Deviance and Pearson Goodness-of-Fit Statistics
CriterionValueDFValue/DFPr > ChiSq
Deviance68.3465164.2717<.0001
Pearson66.7617164.1726<.0001

Number of events/trials observations: 20


Model Fit Statistics
CriterionIntercept OnlyIntercept and Covariates
Log LikelihoodFull Log Likelihood
AIC1256.8521213.003156.533
SC1261.6611232.240175.769
-2 Log L1254.8521205.003148.533

Testing Global Null Hypothesis: BETA=0
TestChi-SquareDFPr > ChiSq
Likelihood Ratio49.84883<.0001
Score49.16823<.0001
Wald47.76233<.0001

Analysis of Maximum Likelihood Estimates
ParameterDFEstimateStandard
Error
Wald
Chi-Square
Pr > ChiSq
Intercept1-0.37880.14896.47300.0110
cult1-0.29560.20202.14120.1434
soil10.97810.212821.1234<.0001
cult*soil1-0.12390.27900.19730.6569


If the link function and the model specification are correct and if there are no outliers, then the lack of fit might be due to overdispersion. Without adjusting for the overdispersion, the standard errors are likely to be underestimated, causing the Wald tests to be too sensitive. In PROC LOGISTIC, there are three SCALE= options to accommodate overdispersion. With unequal sample sizes for the observations, SCALE=WILLIAMS is preferred. The Williams model estimates a scale parameter by equating the value of Pearson for the full model to its approximate expected value. The full model considered in the following statements is the model with cultivar, soil condition, and their interaction. Using a full model reduces the risk of contaminating with lack of fit due to incorrect model specification.

proc logistic data=seeds;
   model r/n=cult soil cult*soil / scale=williams;
   title 'Full Model With SCALE=WILLIAMS';
run;

Results of using Williams’ method are shown in Output 73.10.2. The estimate of is 0.075941 and is given in the formula for the Weight Variable at the beginning of the displayed output.

Output 73.10.2: Williams’ Model for Overdispersion

Full Model With SCALE=WILLIAMS

The LOGISTIC Procedure

Model Information
Data SetWORK.SEEDS
Response Variable (Events)r
Response Variable (Trials)n
Weight Variable1 / ( 1 + 0.075941 * (n - 1) )
Modelbinary logit
Optimization TechniqueFisher's scoring

Number of Observations Read20
Number of Observations Used20
Sum of Frequencies Read906
Sum of Frequencies Used906
Sum of Weights Read198.3216
Sum of Weights Used198.3216

Response Profile
Ordered
Value
Binary OutcomeTotal
Frequency
Total
Weight
1Event43792.95346
2Nonevent469105.36819

Model Convergence Status
Convergence criterion (GCONV=1E-8) satisfied.

Deviance and Pearson Goodness-of-Fit Statistics
CriterionValueDFValue/DFPr > ChiSq
Deviance16.4402161.02750.4227
Pearson16.0000161.00000.4530

Number of events/trials observations: 20
Note:Since the Williams method was used to accommodate overdispersion, the Pearson chi-squared statistic and the deviance can no longer be used to assess the goodness of fit of the model.


Model Fit Statistics
CriterionIntercept OnlyIntercept and Covariates
Log LikelihoodFull Log Likelihood
AIC276.155273.58644.579
SC280.964292.82263.815
-2 Log L274.155265.58636.579

Testing Global Null Hypothesis: BETA=0
TestChi-SquareDFPr > ChiSq
Likelihood Ratio8.568730.0356
Score8.485630.0370
Wald8.306930.0401

Analysis of Maximum Likelihood Estimates
ParameterDFEstimateStandard
Error
Wald
Chi-Square
Pr > ChiSq
Intercept1-0.39260.29321.79320.1805
cult1-0.26180.41600.39630.5290
soil10.83090.42233.87040.0491
cult*soil1-0.05320.58350.00830.9274


Because neither cult nor cult soil is statistically significant (p = 0.5290 and p = 0.9274, respectively), a reduced model that contains only the soil condition factor is fitted, with the observations weighted by . This can be done conveniently in PROC LOGISTIC by including the scale estimate in the SCALE=WILLIAMS option as follows:

proc logistic data=seeds;
   model r/n=soil / scale=williams(0.075941);
   title 'Reduced Model With SCALE=WILLIAMS(0.075941)';
run;

Results of the reduced model fit are shown in Output 73.10.3. Soil condition remains a significant factor (p = 0.0064) for the seed germination.

Output 73.10.3: Reduced Model with Overdispersion Controlled

Reduced Model With SCALE=WILLIAMS(0.075941)

The LOGISTIC Procedure

Analysis of Maximum Likelihood Estimates
ParameterDFEstimateStandard
Error
Wald
Chi-Square
Pr > ChiSq
Intercept1-0.52490.20766.39490.0114
soil10.79100.29027.42840.0064