/* 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 parameterestimates oddsratios;

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


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

                             The LOGISTIC Procedure

                                Response Profile

                     Ordered                          Total
                       Value     diabetes         Frequency

                           1     0                       43
                           2     1                       17

                      Probability modeled is diabetes='1'.


                   Analysis of Maximum Likelihood Estimates

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

     Intercept       1     -1.1142      0.3588        9.6426        0.0019
     gender    1     1      0.3521      0.3588        0.9629        0.3265a


                             Odds Ratio Estimates

                                   Point          95% Wald
               Effect           Estimate      Confidence Limits

               gender 1 vs 0     2.022b       0.495       8.255c
            
        
a P-value indicating no significant association of gender with diabetes
b Estimated odds ratio of diabetes
c 95% confidence interval for the odds ratio of diabetes