BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ybz12003
Rhodochrosite | Level 12

Hello:

 

I have the following modeling would like to use proc logistic to analyze.  I don't have SAS in installed in my computer, my data set is mega-dataset.  I am not sure whether the code I write is correct?  Please correct me if I am wrong.  Thanks.

 

Three categorical response variables: Y1 (normal),  Y2 ( medium), Y3 (Severe)
 
Explanatory variables:  
variable X1 (categorical):  yes or no
variable X2 (categorical):  yes or no
variable X3 (categorical):  little, medium, most and all.
 
proc logistic data=test descending;
class X1 (ref="no") X2 (ref="no") X3 (ref="little") / param=ref;
model Y = X1 X2 X3;
format X1 yesno. X2 yesno. X3 degree. ;
title3 "Ordinal outcome (cumulative logit)";
run;
 
1 ACCEPTED SOLUTION

Accepted Solutions
clim072
Fluorite | Level 6
What you had was fine. I assume that Y which your dependent variable has three levels (normal, medium and severe). In that case, Y should be listed in the class statement  too.
 
PROC LOGISTIC DATA = test DESCENDING;
CLASS X1 (ref="no") X2 (ref="no") X3 (ref="little") Y (ref = "normal")/ param=ref;
model Y = X1 X2 X3;
format X1 yesno. X2 yesno. X3 degree. ;
title3 "Ordinal outcome (cumulative logit)";
run;
 
# Modify Y (ref = "normal") to Y (ref = "medium")/ if you want to change your reference group
Hope it helps!

View solution in original post

1 REPLY 1
clim072
Fluorite | Level 6
What you had was fine. I assume that Y which your dependent variable has three levels (normal, medium and severe). In that case, Y should be listed in the class statement  too.
 
PROC LOGISTIC DATA = test DESCENDING;
CLASS X1 (ref="no") X2 (ref="no") X3 (ref="little") Y (ref = "normal")/ param=ref;
model Y = X1 X2 X3;
format X1 yesno. X2 yesno. X3 degree. ;
title3 "Ordinal outcome (cumulative logit)";
run;
 
# Modify Y (ref = "normal") to Y (ref = "medium")/ if you want to change your reference group
Hope it helps!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1 reply
  • 2060 views
  • 2 likes
  • 2 in conversation