Hello,
It's straight forward to see how the HR's are calculated using the coefficients displayed in the HR table, but, I am trying to figure out how the coefficients are determined (especially the one highlighted in blue below) when using restricted cubic splines in calculating the HR's. A mathematical notation/equation using the ML estimates below when I=0.3 would be great. Or, if someone can point me in the direction of how the SAS output correlates with the math behind it, that would be great!
1. Variable I has a range (0.05 - 0.729)
2. Treatments A and B (2 groups)
3. using 3 equally spaced knots
/*Code*/
proc phreg data = dataset outest=RegParms;
effect I_RCS = spline(I / basis=tpf(noint) NATURALCUBIC details knotmethod=equal(3));
class Treatment(ref='B') Gender(ref='Female');
model T*Status(0, 2, 3) = I_RCS Treatment I_RCS*Treatment Gender Age Score1 Score2 / rl;
hazardratio Treatment / at(I=0.3 0.6) e;
run;
/*SAS Output*/
Knots for Spline Effect |
|
Knot Number |
Frailty |
1 |
0.22297 |
2 |
0.39189 |
3 |
0.56081 |
Basis Details for Spline Effect |
||
Column |
Power |
Break Knot |
1 |
1 |
|
2 |
3 |
0.22297 |
Analysis of Maximum Likelihood Estimates |
|||||||||||
Parameter |
|
|
DF |
Parameter |
Standard |
Chi-Square |
Pr > ChiSq |
Hazard |
95% Hazard Ratio Confidence |
Label |
|
I_RCS |
1 |
|
1 |
-1.34409 |
1.86171 |
0.5212 |
0.4703 |
. |
. |
. |
I_RCS 1 |
I_RCS |
2 |
|
1 |
16.14923 |
7.64104 |
4.4668 |
0.0346 |
. |
. |
. |
I_RCS 2 |
Treatment |
A |
|
1 |
-1.80983 |
0.93087 |
3.7801 |
0.0519 |
. |
. |
. |
Treatment Group A |
I_RCS*Treatment |
1 |
A |
1 |
3.47685 |
3.29380 |
1.1142 |
0.2912 |
. |
. |
. |
I_RCS 1 * Treatment Group A |
I_RCS*Treatment |
2 |
A |
1 |
-15.76844 |
14.59523 |
1.1672 |
0.2800 |
. |
. |
. |
I_RCS 2 * Treatment Group A |
Gender |
Male |
|
1 |
0.12607 |
0.23512 |
0.2875 |
0.5918 |
1.134 |
0.716 |
1.798 |
Gender Male |
Age |
|
|
1 |
0.01625 |
0.01025 |
2.5147 |
0.1128 |
1.016 |
0.996 |
1.037 |
Age |
Score1 |
|
|
1 |
0.01209 |
0.00804 |
2.2624 |
0.1325 |
1.012 |
0.996 |
1.028 |
Score1 |
Score2 |
|
|
1 |
-0.0004364 |
0.00613 |
0.0051 |
0.9432 |
1.000 |
0.988 |
1.012 |
Score2 |
Hazard Ratios for Treatment Group |
||||||||||||
Description |
I_RCS1 Coefficient |
I_RCS2 Coefficient |
TrtA Coefficient |
I_RCS1TrtA Coefficient |
I_RCS2TrtA Coefficient |
GENDERMale Coefficient |
Age Coefficient |
Score1 Coefficient |
Score2 Coefficient |
Point Estimate |
95% Wald Confidence Limits |
|
Trt A vs B At I=0.3 |
0 |
0 |
1.000000 |
0.300000 |
0.001353 |
0 |
0 |
0 |
0 |
0.455 |
0.280 |
0.739 |
Trt A vs B At I=0.6 |
0 |
0 |
1.000000 |
0.600000 |
0.105460 |
0 |
0 |
0 |
0 |
0.250 |
0.057 |
1.088 |
Yes. Unfortunately, the examples don't cover restricted cubic splines and how the coefficients in this specific scenario are calculated.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.