BookmarkSubscribeRSS Feed
ambadi007
Quartz | Level 8
Hi Team,

I have a new request to create a statistics table with logistic regression. I have attached a sample with this for reference

Expect Somme insights on this since Iam new to this scenario

Covariate Estimate odds ratio 95%ci waldchisqr pvalue

These needs to find
9 REPLIES 9
Ksharp
Super User
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;

Ksharp_0-1696851449666.png

 

ambadi007
Quartz | Level 8

 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 

CovariateEstimateOdds Ratio95% CIWald Chi-SquareP-value
Results xx.xxxx.xxxx.xxxx.xxxx.xx
Malexx.xxxx.xxxx.xxxx.xxxx.xx
Female ReferenceReferenceReferenceReferenceReference
Results*Malexx.xxxx.xxxx.xxxx.xxxx.xx
Results*FemaleReferenceReferenceReferenceReferenceReference
StatDave
SAS Super FREQ

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;
ambadi007
Quartz | Level 8

Hi I have used the code,.. the problem is that I am not able to get the ODDS ratio  

PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller
ambadi007
Quartz | Level 8

 

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;

 

improvementResultGender 
Y12M
N13F
Y14M
Y15F
Y16M
Y17M
Y18F
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Ksharp
Super User
As Paige said using ODDSRATIO statement.

proc logistic data=sashelp.heart(obs=1000);
class sex bp_status;
model status=sex bp_status weight height sex*height/clparm=wald clodds=wald ;
oddsratio height/at(sex=all) cl=wald;
run;

sas-innovate-2024.png

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.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 9 replies
  • 842 views
  • 0 likes
  • 5 in conversation