/* Logistic Regression - Odds Ratio Confidence Interval  */

filename t01 url 'http://hedwig.mgh.harvard.edu/biostatistics/sites/default/files/public/education/tmp_sample_data.csv';

proc import file=t01 out=t01 dbms=csv replace;
run;

ods listing select responseprofile type3 parameterestimates oddsratios;

proc logistic data=t01;
class race /descending;
model diabetes(event='1')=race ;
run;

/********************************** ANNOTATED RESULTS **********************************/

                             The LOGISTIC Procedure

                                Response Profile

                     Ordered                          Total
                       Value     diabetes         Frequency

                           1     0                       43
                           2     1                       17

                      Probability modeled is diabetes='1'.

                           Type 3 Analysis of Effects

                                           Wald
                   Effect      DF    Chi-Square    Pr > ChiSq

                   race         2        3.8771        0.1439a



                   Analysis of Maximum Likelihood Estimates

                                      Standard          Wald
     Parameter      DF    Estimate       Error    Chi-Square    Pr > ChiSq

     Intercept       1     -1.0478      0.3522        8.8506        0.0029
     race      3     1      0.6423      0.5128        1.5691        0.2103
     race      2     1     -1.0923      0.5571        3.8447        0.0499


                             Odds Ratio Estimates

                                  Point          95% Wald
                Effect         Estimate      Confidence Limits

                race 3 vs 1       1.212b      0.281       5.238c
                race 2 vs 1       0.214       0.042       1.102
            
        
a P-value indicating no significant association of race with diabetes
b Estimated race 3 verus race 1 odds ratio of diabetes
c 95% confidence interval for the race 3 verus race 1 odds ratio of diabetes