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!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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