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: real time 0.26 seconds cpu time 0.06 seconds 22 ; 23 run; 24 ***************************************************; 25 proc logistic data=A; 26 model y/m = / scale = williams; 27 by group; 28 title2 "Estimate overdispersion separately in each group "; 29 run; NOTE: No explanatory variables have been specified. 2 The SAS System 17:33 Thursday, August 7, 2003 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-4. NOTE: PROCEDURE LOGISTIC used: real time 0.65 seconds cpu time 0.09 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 5-6. NOTE: PROCEDURE LOGISTIC used: real time 0.07 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 1.67 seconds cpu time 0.42 seconds a005.sas: Logistic Regression, Extra-binomial Variation (Overdispersion) 1 Estimate overdispersion separately in each group 17:33 Thursday, August 7, 2003 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) Number of Observations 6 Weight Variable 1 / ( 1 + 0.050443 * (m - 1) ) Sum of Weights 80.882352941 Model binary logit Optimization Technique Fisher's scoring 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.39994 Deviance and Pearson Goodness-of-Fit Statistics Criterion DF Value Value/DF Pr > ChiSq Deviance 5 4.8745 0.9749 0.4314 Pearson 5 5.0000 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. a005.sas: Logistic Regression, Extra-binomial Variation (Overdispersion) 2 Estimate overdispersion separately in each group 17:33 Thursday, August 7, 2003 Group (0=CTRL, 1=FLU)=0 The LOGISTIC Procedure 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) 3 Estimate overdispersion separately in each group 17:33 Thursday, August 7, 2003 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) Number of Observations 6 Weight Variable 1 / ( 1 + 0.05253 * (m - 1) ) Sum of Weights 78.722397476 Model binary logit Optimization Technique Fisher's scoring 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.72582 Deviance and Pearson Goodness-of-Fit Statistics Criterion DF Value Value/DF Pr > ChiSq Deviance 5 7.0855 1.4171 0.2144 Pearson 5 5.0000 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. a005.sas: Logistic Regression, Extra-binomial Variation (Overdispersion) 4 Estimate overdispersion separately in each group 17:33 Thursday, August 7, 2003 Group (0=CTRL, 1=FLU)=1 The LOGISTIC Procedure 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) 5 Compare groups, adjust for overdispersion 17:33 Thursday, August 7, 2003 The LOGISTIC Procedure Model Information Data Set WORK.A Response Variable (Events) y # survived (numerator) Response Variable (Trials) m Total (denominator) Number of Observations 12 Weight Variable 1 / ( 1 + 0.051487 * (m - 1) ) Sum of Weights 159.57551941 Model binary logit Optimization Technique Fisher's scoring 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 DF Value Value/DF Pr > ChiSq Deviance 10 11.9899 1.1990 0.2857 Pearson 10 10.0000 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 Intercept and Criterion Only Covariates AIC 98.247 100.171 SC 102.421 108.518 -2 Log L 96.247 96.171 a005.sas: Logistic Regression, Extra-binomial Variation (Overdispersion) 6 Compare groups, adjust for overdispersion 17:33 Thursday, August 7, 2003 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