Programming the statistical procedures from SAS

How to plot non-parametric hazard ratios over time

Reply
New Contributor
Posts: 4

How to plot non-parametric hazard ratios over time

Hi all,

I am currently using Cox to estimate the hazard ratio of death in control vs treatment groups. However, there is an interaction with follow-up time and hazard ratio, with the HR initally being higher and crossing '1' after approx. 2 years of follow-up. I would like to visualize this changing HR by plotting the HR as a function of time. Is this possible in SAS?

Second question, am i correct in saying that the proportional hazards assumption is violated?

I have attached an example of what I am trying to achieve (attached PDF, figure 1B).

Thank you in advance for your help!

Kind regards,

Nick

New Contributor
Posts: 4

Re: How to plot non-parametric hazard ratios over time

Nick,

Don't know if this topic still interests you.  I have a macro suite that implements Paul Lambert's flexible parametric survival analysis (stata) program stpm2.  With that installed, you will be able to fit a parametric model that allows for the HR to vary over follow-up time, and to plot the HR estimates (and its conf. limits).  It could also be used to estimate most of the other measures that you saw in the article you posted (hazard differences, differences in survival curves...)

 

Let me know if you are interested.

SAS Super FREQ
Posts: 3,301

Re: How to plot non-parametric hazard ratios over time

@epiman46 This sounds like a useful macro that would be nice to have.  Would you consider writing an article in the Library here on the SAS Support Communities?  You could post the macro to that article as a ZIP file. 

 

If the macro uses SAS/IML to do the computations, you could also post the macro to the SAS/IML File Exchange.

New Contributor
Posts: 4

Re: How to plot non-parametric hazard ratios over time

Rick,

I certainly could.  The thing itself is still being developed, however, with some new features being added, now that I have a bit of time to work on it.  So I would want it to be clear that it is a work in progress, with some features fully realised, and others to come.  Currently, it clocks in at just over 1,700 lines of code.  But it would be really nice to get some feedback from users.

 

Is there an FAQ about writing for the library?

Ron

SAS Super FREQ
Posts: 3,301

Re: How to plot non-parametric hazard ratios over time

You can follow the basic advice in the article "How to contribute to the SAS/IML File Exchange." Most of the suggestions would apply equally well to a macro submission to the general library here at the SAS Support Communities.

Ask a Question
Discussion stats
  • 4 replies
  • 311 views
  • 0 likes
  • 3 in conversation