1 %let progname = a005.sas; 2 * does: - proc logistic with Williams' overdispersion 3 - Estimate overdispersion. 4 - Fit a model while adjusting for overdispersion. 5 ***************************************************; 6 title1 7 "&progname: Logistic Regression, Extra-binomial Variation (Overdispersion)"; 8 ***************************************************; 9 data A; 10 input grp $ y @@; 11 m = 40; * can be different, but in this dataset all m=40; 12 group = (grp="FLU"); 13 14 label y = "# survived (numerator)"; 15 label m = "Total (denominator)"; 16 label group = "Group (0=CTRL, 1=FLU)"; 17 18 cards; NOTE: SAS went to a new line when INPUT statement reached past the end of a line. NOTE: The data set WORK.A has 12 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 22 ; 23 run; 24 ***************************************************; 25 proc logistic data=A; 26 model y/m = / scale = williams; 27 by group; 2 The SAS System 23:46 Sunday, June 14, 2020 28 title2 "Estimate overdispersion separately in each group "; 29 run; NOTE: No explanatory variables have been specified. NOTE: Convergence criterion (GCONV=1E-8) satisfied. NOTE: The above message was for the following BY group: Group (0=CTRL, 1=FLU)=0 NOTE: Convergence criterion (GCONV=1E-8) satisfied. NOTE: The above message was for the following BY group: Group (0=CTRL, 1=FLU)=1 NOTE: There were 12 observations read from the data set WORK.A. NOTE: The PROCEDURE LOGISTIC printed pages 1-2. NOTE: PROCEDURE LOGISTIC used (Total process time): real time 0.12 seconds cpu time 0.04 seconds 30 ***************************************************; 31 proc logistic data=A; 32 model y/m = group / scale = williams; 33 title2 "Compare groups, adjust for overdispersion"; 34 run; NOTE: Convergence criterion (GCONV=1E-8) satisfied. NOTE: There were 12 observations read from the data set WORK.A. NOTE: The PROCEDURE LOGISTIC printed pages 3-4. NOTE: PROCEDURE LOGISTIC used (Total process time): real time 0.04 seconds cpu time 0.03 seconds NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 0.50 seconds cpu time 0.26 seconds a005.sas: Logistic Regression, Extra-binomial Variation (Overdispersion) 1 Estimate overdispersion separately in each group 23:46 Sunday, June 14, 2020 Group (0=CTRL, 1=FLU)=0 The LOGISTIC Procedure Model Information Data Set WORK.A Response Variable (Events) y # survived (numerator) Response Variable (Trials) m Total (denominator) Weight Variable 1 / ( 1 + 0.050443 * (m - 1) ) Total (denominator) Model binary logit Optimization Technique Fisher's scoring Number of Observations Read 6 Number of Observations Used 6 Sum of Frequencies Read 240 Sum of Frequencies Used 240 Sum of Weights Read 80.88235 Sum of Weights Used 80.88235 Response Profile Ordered Binary Total Total Value Outcome Frequency Weight 1 Event 220 74.142157 2 Nonevent 20 6.740196 Model Convergence Status Convergence criterion (GCONV=1E-8) satisfied. -2 Log L = 46.400 -2 Full Log L = 10.284 Deviance and Pearson Goodness-of-Fit Statistics Criterion Value DF Value/DF Pr > ChiSq Deviance 4.8745 5 0.9749 0.4314 Pearson 5.0000 5 1.0000 0.4159 Number of events/trials observations: 6 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. Analysis of Maximum Likelihood Estimates Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq Intercept 1 2.3979 0.4023 35.5258 <.0001 a005.sas: Logistic Regression, Extra-binomial Variation (Overdispersion) 2 Estimate overdispersion separately in each group 23:46 Sunday, June 14, 2020 Group (0=CTRL, 1=FLU)=1 The LOGISTIC Procedure Model Information Data Set WORK.A Response Variable (Events) y # survived (numerator) Response Variable (Trials) m Total (denominator) Weight Variable 1 / ( 1 + 0.05253 * (m - 1) ) Total (denominator) Model binary logit Optimization Technique Fisher's scoring Number of Observations Read 6 Number of Observations Used 6 Sum of Frequencies Read 240 Sum of Frequencies Used 240 Sum of Weights Read 78.7224 Sum of Weights Used 78.7224 Response Profile Ordered Binary Total Total Value Outcome Frequency Weight 1 Event 217 71.178168 2 Nonevent 23 7.544230 Model Convergence Status Convergence criterion (GCONV=1E-8) satisfied. -2 Log L = 49.726 -2 Full Log L = 11.586 Deviance and Pearson Goodness-of-Fit Statistics Criterion Value DF Value/DF Pr > ChiSq Deviance 7.0855 5 1.4171 0.2144 Pearson 5.0000 5 1.0000 0.4159 Number of events/trials observations: 6 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. Analysis of Maximum Likelihood Estimates Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq Intercept 1 2.2444 0.3829 34.3609 <.0001 a005.sas: Logistic Regression, Extra-binomial Variation (Overdispersion) 3 Compare groups, adjust for overdispersion 23:46 Sunday, June 14, 2020 The LOGISTIC Procedure Model Information Data Set WORK.A Response Variable (Events) y # survived (numerator) Response Variable (Trials) m Total (denominator) Weight Variable 1 / ( 1 + 0.051487 * (m - 1) ) Total (denominator) Model binary logit Optimization Technique Fisher's scoring Number of Observations Read 12 Number of Observations Used 12 Sum of Frequencies Read 480 Sum of Frequencies Used 480 Sum of Weights Read 159.5755 Sum of Weights Used 159.5755 Response Profile Ordered Binary Total Total Value Outcome Frequency Weight 1 Event 437 145.28021 2 Nonevent 43 14.29531 Model Convergence Status Convergence criterion (GCONV=1E-8) satisfied. Deviance and Pearson Goodness-of-Fit Statistics Criterion Value DF Value/DF Pr > ChiSq Deviance 11.9899 10 1.1990 0.2857 Pearson 10.0000 10 1.0000 0.4405 Number of events/trials observations: 12 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 Intercept and Covariates Intercept Log Full Log Criterion Only Likelihood Likelihood AIC 98.247 100.171 25.887 SC 102.421 108.518 34.235 -2 Log L 96.247 96.171 21.887 a005.sas: Logistic Regression, Extra-binomial Variation (Overdispersion) 4 Compare groups, adjust for overdispersion 23:46 Sunday, June 14, 2020 The LOGISTIC Procedure Testing Global Null Hypothesis: BETA=0 Test Chi-Square DF Pr > ChiSq Likelihood Ratio 0.0765 1 0.7821 Score 0.0764 1 0.7822 Wald 0.0763 1 0.7824 Analysis of Maximum Likelihood Estimates Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq Intercept 1 2.3979 0.4051 35.0451 <.0001 group 1 -0.1535 0.5556 0.0763 0.7824 Odds Ratio Estimates Point 95% Wald Effect Estimate Confidence Limits group 0.858 0.289 2.549 Association of Predicted Probabilities and Observed Responses Percent Concordant 26.9 Somers' D 0.038 Percent Discordant 23.1 Gamma 0.077 Percent Tied 50.0 Tau-a 0.006 Pairs 18791 c 0.519