* Depress Example -- source code file depress.sas; options linesize=70; data depress; input obs age educ income score isdep; title "Depress Example"; label obs="Observation Number" age="Age of Patient" educ="Education Level" income="Income of Patient" score="Score on Diagnostic Test" isdep="Is Patient Depressed?"; datalines; 181 58 3 15 01 0 182 59 3 13 33 1 183 26 3 09 08 0 184 21 3 19 05 0 185 83 2 06 07 0 186 34 2 07 16 1 187 42 3 23 05 0 188 42 3 07 16 1 189 24 3 13 39 1 190 80 2 05 09 0 191 18 2 15 08 0 192 58 2 09 03 0 193 54 3 02 02 0 194 47 4 45 01 0 195 61 2 04 03 0 196 18 2 24 05 0 197 51 5 45 04 0 198 28 2 09 00 0 199 44 3 26 00 0 200 50 3 23 08 0 ; * Print input dataset; proc print; * Use proc freq to create contingency tables; proc freq; tables isdep; proc logistic; model isdep (event='1') = age educ income; output out=prob p=phat; proc print data=prob; title1 "prob1 output dataset"; title2 "Predicted Probability of Depression"; var age educ income score isdep phat; run; quit;