Restricted cubic splines in proportional hazard regression

Reply
Occasional Contributor
Posts: 5

Restricted cubic splines in proportional hazard regression

PROC PHREG DATA=XXX;
 effect fibreS = spline(fibre / basis=tpf(noint) NATURALCUBIC details knotmethod=rangefractions(0.05 0.50 0.95) );
    model survival*Censor(0)=fibreS  / rl ;
    run;

Hi All, 

 

For a project, I want to perform restricted cubic splines since my prop. hazard analyses indicate the association between fibre and survival might not be linear. 

However, I am not really used working with SAS and I got stuck making my syntax. I think the part I have is alright, however, I do not seem to get any graphical output figures. Could someone help me with the last part? 

Thanks in advance!

SAS Super FREQ
Posts: 503

Re: Restricted cubic splines in proportional hazard regression

Did you enable ODS Graphics?

ods graphics on;

 

It might or might not be enabled by default.


Do the graphs you want need to be requested by the PLOTS= option in the PROC statement or by specifying the EFFECTPLOT statement?

Occasional Contributor
Posts: 5

Re: Restricted cubic splines in proportional hazard regression

Posted in reply to WarrenKuhfeld

Thanks for your reply. I have ods graphics enabled. 
I thought the graphics needed to be requested with proc plot or proc sgplot, but as I am relatively new to sas I'm sure whether this is right. 

SAS Super FREQ
Posts: 503

Re: Restricted cubic splines in proportional hazard regression

[ Edited ]

PROC PLOT is ancient technology.  Don't use it.  PROC SGPLOT is enormously useful, but you might or might not need it. Many procedures automatically create some graphs relevant to the analysis and optionally create others.  Look at the PHREG doc.  For more about ODS Graphics and SAS/STAT procs, see

http://support.sas.com/documentation/onlinedoc/stat/141/odsgraph.pdf 

Occasional Contributor
Posts: 5

Re: Restricted cubic splines in proportional hazard regression

Posted in reply to WarrenKuhfeld

Thank you for the document. I do not see an option to plot RCS within this document. Do I need to perform another step to create graphs? 

SAS Super FREQ
Posts: 503

Re: Restricted cubic splines in proportional hazard regression

Indeed I do not find "RCS" in the PROC PHREG documentation, so unless it has some other name, you might have to use PROC SGPLOT.

SAS Super FREQ
Posts: 503

Re: Restricted cubic splines in proportional hazard regression

Posted in reply to WarrenKuhfeld

Just dawned on me.  By RCS, do you mean restricted cubic splines?  I really don't know what plot you are looking for.

Occasional Contributor
Posts: 5

Re: Restricted cubic splines in proportional hazard regression

Posted in reply to WarrenKuhfeld

I have a picture added to my reply. Yes, I mean restricted cubic splines. I want a plot with the hazard ratio on the y-axis and fiber intake on the x-axis. If I run my syntax, I get some output in tables. The same kind of output you would get if you would run a proc phreg without spline specified in the effects statement.

 spline.png

SAS Super FREQ
Posts: 503

Re: Restricted cubic splines in proportional hazard regression

Sorry I can't be more help. Now that you have shown what you want, I hope someone else can help you.  

Occasional Contributor
Posts: 5

Re: Restricted cubic splines in proportional hazard regression

Posted in reply to WarrenKuhfeld

No problem. I appreciate you taking the time!

New Contributor
Posts: 4

Re: Restricted cubic splines in proportional hazard regression

Hi Mrite,

 

I am doing the same analysis as yours. The hazard analysis shows that the association between Bicarb (LBXSC3SI) and survival is not linear. Thus, I want to plot restricted cubic splines in proportional hazard regression. 

 

I used the following code

 

PROC PHREG DATA = survey;
effect LBXSC3SIs = spline(LBXSC3SI / basis=tpf(noint) NATURALCUBIC details knotmethod=rangefractions(0.05 0.50 0.95) );
model years*dead (0) = LBXSC3SIs / rl;
run;
ods graphics on;

 

However, I do not see any plot/graph in the SAS output. Did you find any solution for your code?

 

 

Ask a Question
Discussion stats
  • 10 replies
  • 340 views
  • 3 likes
  • 3 in conversation