BookmarkSubscribeRSS Feed
giants619
Calcite | Level 5

I would like to create a cubic spline plot for proportional hazards regression. It should look something like this:

 

giants619_0-1642706620266.png

 

I have tried the following code, which did not produce any graphics:

 

ods graphics on;
proc icphreg data=updated2;
model time*mortstat(0) = RDW / basehaz=splines;
hazardratio RDW;

run;

ods graphics on;
PROC PHREG DATA = updated2;
effect RDWs = spline(RDW / basis=tpf(noint) NATURALCUBIC details knotmethod=rangefractions(0.05 0.50 0.95) );
model TIME*MORTSTAT(0) = RDWs / rl;
run;

 

 

I saw that several other individuals asked the same question on these forums years ago but did not get any response.

1 REPLY 1
sbxkoenk
SAS Super FREQ

Hello @giants619 ,

 

Both the PROC ICPHREG and PROC PHREG have a PLOTS= option on the PROC statement.

If you do not use it, you cannot get any plots.

PLOTS= Controls the plots that are produced through ODS Graphics.

 

Check the documentation 

https://go.documentation.sas.com/doc/en/helpcenterwlcm/1.0/home.htm

of both procedures and add the PLOTS= option.

 

Cheers,

Koen

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 766 views
  • 1 like
  • 2 in conversation