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.
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
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.