proc logistic data=sashelp.heart;
class sex bp_status;
model status=sex bp_status weight height/clparm=wald clodds=wald ;
/*oddsratio sex/cl=wald;*/
run;
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 |
Results | xx.xx | xx.xx | xx.xx | xx.xx | xx.xx |
Male | xx.xx | xx.xx | xx.xx | xx.xx | xx.xx |
Female | Reference | Reference | Reference | Reference | Reference |
Results*Male | xx.xx | xx.xx | xx.xx | xx.xx | xx.xx |
Results*Female | Reference | Reference | Reference | Reference | Reference |
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;
Hi I have used the code,.. the problem is that I am not able to get the ODDS ratio
@ambadi007 wrote:
Hi I have used the code,.. the problem is that I am not able to get the ODDS ratio
Please show us your code. Please show us the output. Please show us (a portion) of your data.
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;
improvement | Result | Gender |
Y | 12 | M |
N | 13 | F |
Y | 14 | M |
Y | 15 | F |
Y | 16 | M |
Y | 17 | M |
Y | 18 | F |
Please, in the future, follow Maxim 2, which says:
Maxim 2
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.