*================================================================================ / Program Name: /u/cook/642/642/apple2.sas / / Author: Tom Cook / / Creation Date: March 10, 2005 / / Last Modified: <2005-03-10 10:58:10 cook> / / Project: 642 / / Purpose: Appleton Data Example / / / *===============================================================================; ** - Code to generate dataset "apple_grouped" same as before (2/10/05) ; title "Appleton data - Compute statistics using PROC FREQ" ; proc freq data = apple_grouped ; weight count ; tables age_grp1*smoke*dead / noprint cmh ; run ; title "Appleton data - PROC LOGISTIC - no interaction" ; proc logistic data = apple_grouped ; class age_grp1 ; model dead = age_grp1 smoke ; weight count ; where age_grp1 < 7 ; run ; title "Appleton data - PROC LOGISTIC - unstructured interaction" ; proc logistic data = apple_grouped ; class age_grp1 ; model dead = age_grp1 | smoke ; weight count ; where age_grp1 < 7 ; run ; title "Appleton data - PROC LOGISTIC - unstructured interaction, forward selection" ; proc logistic data = apple_grouped ; class age_grp1 ; model dead = age_grp1 | smoke /selection=F include=2 ; weight count ; where age_grp1 < 7 ; run ; title "Appleton data - PROC LOGISTIC - structured interaction" ; proc logistic data = apple_grouped ; class age_grp1 ; model dead = age_grp1 smoke age_grp2*smoke ; weight count ; where age_grp1 < 7 ; run ; Appleton data - Compute statistics using PROC FREQ 1 The FREQ Procedure Summary Statistics for smoke by dead Controlling for age_grp1 Cochran-Mantel-Haenszel Statistics (Based on Table Scores) Statistic Alternative Hypothesis DF Value Prob --------------------------------------------------------------- 1 Nonzero Correlation 1 5.8443 0.0156 2 Row Mean Scores Differ 1 5.8443 0.0156 3 General Association 1 5.8443 0.0156 Estimates of the Common Relative Risk (Row1/Row2) Type of Study Method Value 95% Confidence Limits ------------------------------------------------------------------------- Case-Control Mantel-Haenszel 1.5278 1.0814 2.1585 (Odds Ratio) Logit ** 1.5271 1.0794 2.1606 Cohort Mantel-Haenszel 1.2131 1.0372 1.4187 (Col1 Risk) Logit 1.1336 0.9740 1.3194 Cohort Mantel-Haenszel 0.9407 0.8953 0.9885 (Col2 Risk) Logit ** 0.9825 0.9537 1.0121 ** These logit estimators use a correction of 0.5 in every cell of those tables that contain a zero. Tables with a zero row or a zero column are not included in computing the logit estimators. Breslow-Day Test for Homogeneity of the Odds Ratios ------------------------------ Chi-Square 2.3731 DF 5 Pr > ChiSq 0.7955 Total Sample Size = 1314 Appleton data - PROC LOGISTIC - no interaction 2 The LOGISTIC Procedure Model Information Data Set WORK.APPLE_GROUPED Response Variable dead Number of Response Levels 2 Number of Observations 24 Weight Variable count Sum of Weights 1237 Model binary logit Optimization Technique Fisher's scoring Response Profile Ordered Total Total Value dead Frequency Weight 1 Alive 12 945.00000 2 Dead 12 292.00000 Probability modeled is dead='Alive'. Class Level Information Design Variables Class Value 1 2 3 4 5 age_grp1 18-24 1 0 0 0 0 25-34 0 1 0 0 0 35-44 0 0 1 0 0 45-54 0 0 0 1 0 55-64 0 0 0 0 1 65-74 -1 -1 -1 -1 -1 Model Convergence Status Convergence criterion (GCONV=1E-8) satisfied. Model Fit Statistics Intercept Intercept and Criterion Only Covariates AIC 1354.016 935.202 SC 1355.194 943.448 -2 Log L 1352.016 921.202 Appleton data - PROC LOGISTIC - no interaction 3 The LOGISTIC Procedure Testing Global Null Hypothesis: BETA=0 Test Chi-Square DF Pr > ChiSq Likelihood Ratio 430.8140 6 <.0001 Score 436.9376 6 <.0001 Wald 268.7732 6 <.0001 Type III Analysis of Effects Wald Effect DF Chi-Square Pr > ChiSq age_grp1 5 264.8766 <.0001 smoke 1 5.8292 0.0158 Analysis of Maximum Likelihood Estimates Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq Intercept 1 1.0314 0.2944 12.2703 0.0005 age_grp1 18-24 1 1.9739 0.4954 15.8769 <.0001 age_grp1 25-34 1 1.8538 0.3207 33.4082 <.0001 age_grp1 35-44 1 0.6328 0.2283 7.6843 0.0056 age_grp1 45-54 1 -0.1395 0.1978 0.4973 0.4807 age_grp1 55-64 1 -1.2069 0.1703 50.2216 <.0001 smoke 1 0.4274 0.1770 5.8292 0.0158 Odds Ratio Estimates Point 95% Wald Effect Estimate Confidence Limits age_grp1 18-24 vs 65-74 162.060 48.123 545.757 age_grp1 25-34 vs 65-74 143.727 64.146 322.037 age_grp1 35-44 vs 65-74 42.388 23.267 77.221 age_grp1 45-54 vs 65-74 19.582 11.394 33.654 age_grp1 55-64 vs 65-74 6.734 4.200 10.798 smoke 1.533 1.084 2.169 Appleton data - PROC LOGISTIC - unstructured interaction 4 The LOGISTIC Procedure Testing Global Null Hypothesis: BETA=0 Test Chi-Square DF Pr > ChiSq Likelihood Ratio 433.1950 11 <.0001 Score 439.9014 11 <.0001 Wald 268.5780 11 <.0001 Type III Analysis of Effects Wald Effect DF Chi-Square Pr > ChiSq age_grp1 5 18.9697 0.0019 smoke 1 2.1045 0.1469 smoke*age_grp1 5 2.3227 0.8029 Analysis of Maximum Likelihood Estimates Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq Intercept 1 1.1041 0.4204 6.8978 0.0086 age_grp1 18-24 1 1.3397 1.4959 0.8021 0.3705 age_grp1 25-34 1 2.8757 1.1070 6.7489 0.0094 age_grp1 35-44 1 -0.0648 0.7045 0.0085 0.9267 age_grp1 45-54 1 -0.1311 0.6058 0.0468 0.8287 age_grp1 55-64 1 -1.3556 0.5437 6.2168 0.0127 smoke 1 0.4015 0.2768 2.1045 0.1469 smoke*age_grp1 18-24 1 0.4318 1.0487 0.1696 0.6805 smoke*age_grp1 25-34 1 -0.6842 0.6649 1.0590 0.3034 smoke*age_grp1 35-44 1 0.4740 0.4820 0.9670 0.3254 smoke*age_grp1 45-54 1 -0.0356 0.4164 0.0073 0.9318 smoke*age_grp1 55-64 1 0.0770 0.3535 0.0475 0.8275 . (output deleted) . . Appleton data - PROC LOGISTIC - unstructured interaction, forward selection The LOGISTIC Procedure . (lots of output deleted) . . Residual Chi-Square Test Chi-Square DF Pr > ChiSq 2.3740 5 0.7953 Appleton data - PROC LOGISTIC - structured interaction 5 The LOGISTIC Procedure Testing Global Null Hypothesis: BETA=0 Test Chi-Square DF Pr > ChiSq Likelihood Ratio 430.8937 7 <.0001 Score 437.9842 7 <.0001 Wald 268.1325 7 <.0001 Type III Analysis of Effects Wald Effect DF Chi-Square Pr > ChiSq age_grp1 5 25.6225 0.0001 smoke 1 0.8181 0.3657 smoke*age_grp2 1 0.0796 0.7778 Analysis of Maximum Likelihood Estimates Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq Intercept 1 0.9850 0.3350 8.6466 0.0033 age_grp1 18-24 1 1.8203 0.7317 6.1887 0.0129 age_grp1 25-34 1 1.7565 0.4697 13.9816 0.0002 age_grp1 35-44 1 0.5972 0.2612 5.2269 0.0222 age_grp1 45-54 1 -0.1127 0.2183 0.2666 0.6057 age_grp1 55-64 1 -1.1199 0.3503 10.2211 0.0014 smoke 1 0.6111 0.6757 0.8181 0.3657 smoke*age_grp2 1 -0.0422 0.1496 0.0796 0.7778 Odds Ratio Estimates Point 95% Wald Effect Estimate Confidence Limits age_grp1 18-24 vs 65-74 116.933 9.073 >999.999 age_grp1 25-34 vs 65-74 109.703 14.357 838.249 age_grp1 35-44 vs 65-74 34.417 7.215 164.167 age_grp1 45-54 vs 65-74 16.922 5.373 53.292 age_grp1 55-64 vs 65-74 6.180 2.896 13.189