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

Hi Everyone,

How can I modify PHREG statement to run for a multilevel response variable (stm= 0, 1, 2). The following statement yield one HR, I need to get two HR for stm(1 vs. 0 and 2 vs. 0)

proc phreg data=s ;

   class drug (ref='1') stm (ref='0') / param=ref;

   model period1*stm(0)= drug  year/ risklimits;

run;

any help is appreciated 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

If the response that you want to model is multinomial (either ordinal or nominal), then you should be using PROC LOGISTIC, not PROC PHREG. You can find examples of both in the Examples section of the LOGISTIC documentation. From your description, it sounds like you want to treat the response levels as nominal. The comparisons you mention will be obtained if you use the LINK=GLOGIT option in the MODEL statement and the DESCENDING response variable option:

model stm(descending) = drug year / link=glogit;

View solution in original post

4 REPLIES 4
SASJedi
SAS Super FREQ
Moved this post to Statistical Procedures, where it should get better exposure.
Check out my Jedi SAS Tricks for SAS Users
SteveDenham
Jade | Level 19

Try adding a HAZARDRATIO statement, such as:

 

hazardratio stm/diff=ref;

SteveDenham

 

lillymaginta1
Obsidian | Level 7

Thank you for the response! I tried the statement but I received the following error, the variable specified in the hazardratio statement must be in the model. 

StatDave
SAS Super FREQ

If the response that you want to model is multinomial (either ordinal or nominal), then you should be using PROC LOGISTIC, not PROC PHREG. You can find examples of both in the Examples section of the LOGISTIC documentation. From your description, it sounds like you want to treat the response levels as nominal. The comparisons you mention will be obtained if you use the LINK=GLOGIT option in the MODEL statement and the DESCENDING response variable option:

model stm(descending) = drug year / link=glogit;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 768 views
  • 1 like
  • 4 in conversation