Hi I have found a sample code, but i needed the below results for my requiremnt. I am not understanding how to pass the proper variables and options . the requirement below
|Covariate||Estimate||Odds Ratio||95% CI||Wald Chi-Square||P-value|
This is basic output from PROC LOGISTIC. But what you want appears in two separate tables. Below assumes that your binary response is called Response, and has values 0 or 1 with 1 being the event level of interest.
proc logistic data=YourDataSet; class gender(ref='Male'); model Response(event="1")=Results gender Results*gender / clparm=wald; run;
Please find the data and the code below which i have.
ods trace on; ods output Association=or2 GlobalTests=GBLT_2; proc logistic data=mydata outmodel=stat_3; class gender (ref="F"); model improvement(event="Y")=result gender gender*result / clodds=wald; run; ods trace off;
Please, in the future, follow Maxim 2, which says:
Read the log.
Everything you need to know about your program is in the log. Interpreting messages and NOTEs is essential in finding errors.
The log says:
NOTE: The CLODDS= option does not compute odds ratios for effects involved in interactions or nestings. Specify the ODDSRATIO statement to compute odds ratios for these effects.
So you need to add the ODDSRATIO command into your code. Maybe like this:
proc logistic data=mydata outmodel=stat_3; class gender (ref="F"); model improvement(event="Y")=result gender gender*result / clodds=wald; oddsratio gender; oddsratio result; run;
The log also says
WARNING: There is a complete separation of data points. The maximum likelihood estimate does not exist. WARNING: The LOGISTIC procedure continues in spite of the above warning. Results shown are based on the last maximum likelihood iteration. Validity of the model fit is questionable.
which means that the results you get are questionable.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.