Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SeaMoon_168
Quartz | Level 8

I tried to use phreg (code shown below) to calculate the Hazard Ratios of these variables and here age was included as a spline. 

proc phreg data=test; 
effect spl_age = spline(age / basis=bspline knotmethod=percentilelist(25 75) );
class sex(ref="0") race(ref="0") Hypertension(ref="0") 
Diabetes(ref="0") 
Region(ref="0"); 
model (start,stop)*Censor(0)= sex race Hypertension Diabetes Region 
spl_age/ risklimits eventcode=1;     
id usubjid; 
run;

The code works but I got a message show below: Hazard ratios that cannot be conveniently calculated or displayed are set to missing in the ParameterEstimates table. Use the HAZARDRAT10 statement to compute the needed hazard ratios. I wonder if anything wrong with the code, especially age was treated as a spline. Many thanks.

 

 

SeaMoon_168_0-1745435874177.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
I think that is because you are using spline(non-linear) effect for AGE. sas can not easily calculate HR as other variables by using EXP option of model.
Therefore , you need special statement to get it. Like:

model (start,stop)*Censor(0)= sex race Hypertension Diabetes Region spl_age/ risklimits eventcode=1;
HAZARDRATIO age;

View solution in original post

1 REPLY 1
Ksharp
Super User
I think that is because you are using spline(non-linear) effect for AGE. sas can not easily calculate HR as other variables by using EXP option of model.
Therefore , you need special statement to get it. Like:

model (start,stop)*Censor(0)= sex race Hypertension Diabetes Region spl_age/ risklimits eventcode=1;
HAZARDRATIO age;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 302 views
  • 2 likes
  • 2 in conversation