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

Hello,

I am trying to apply a survival analysis and checking if "age" is a confounder in the model. My code is the following-

 

proc phreg data=have;
class group (ref='1') age / param = ref;
model year*outcome(0)= group age /rl;
run;

 

However, I am getting this result:

ftahsin_0-1670052210366.png

I am not sure why I am getting all the separate rows for age. It's a continuous variable but I want to get a specific hazard ratio and compare it with the group's hazard ratio. Can anyone please tell me what should I do?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Season
Barite | Level 11

Hello. The reason why SAS gave such a result is that you put the parameter age in your CLASS statement. By doing so, SAS deems age as a discrete variable, with each and every value of age being a category. You can delete "age" and try again.

As for the comparison you mentioned, I am not quite sure about the comparison you wish to make. Did you want to compare the HR of age increases by 1 over the HR of group 2 and group 1? If so, since you have entered "rl" at the end of the MODEL statement, you can compare the confidence intervals of the two variables to see if there is a statistical difference by checking if there is an overlap of the two confidence intervals.

View solution in original post

3 REPLIES 3
Season
Barite | Level 11

Hello. The reason why SAS gave such a result is that you put the parameter age in your CLASS statement. By doing so, SAS deems age as a discrete variable, with each and every value of age being a category. You can delete "age" and try again.

As for the comparison you mentioned, I am not quite sure about the comparison you wish to make. Did you want to compare the HR of age increases by 1 over the HR of group 2 and group 1? If so, since you have entered "rl" at the end of the MODEL statement, you can compare the confidence intervals of the two variables to see if there is a statistical difference by checking if there is an overlap of the two confidence intervals.

ftahsin
Obsidian | Level 7
Hello,
Thanks a lot for your suggestion. This was so helpful. I removed "age" from the class statement and it worked!
Yes, I want to compare the HR of age increases by 1 over the HR of group 2 and group 1. I will also compare the confidence intervals of the two variables to calculate the differences. Thanks again!
Season
Barite | Level 11

It should also be noted that since you have used the Cox proportional hazards model, the proportional hazards (PH) assumption should be examined before you use this model to make statistical inferences.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 3 replies
  • 1532 views
  • 2 likes
  • 2 in conversation