BookmarkSubscribeRSS Feed
lay26
Calcite | Level 5

 

Hello, SAS community,

I am conducting survival analysis using the proc phreg procedure in SAS. My dataset contains time-variant treatment variables, as the treatment status for patients may change over time, and we have measured it at each 30-day interval.

I want to get the estimated hazards of my outcome event for all the treated and untreated patients to calculate the absolute risk reduction. I have tried using the output and baseline options in proc phreg, but unfortunately, they did not work with the time-variant variables. Here is a sample of my code:

 

proc phreg data=x out=y plots=survival; class race(ref='W');
model time_at_risk*outcome_t(0) = treatment female_flg race / rl;
/* Creating an array for time-variant treatment */
array treat_(*) drug_t_1-drug_t_30; treatment = treat_[time_at_risk]; run;


Could you please suggest an alternative approach to estimate the hazards for the treated group versus the non-treated group while considering the time-variant treatment status?

1 REPLY 1
OsoGris
SAS Employee

PHREG does not produce hazard estimates.  The underlying model is h(t) = ho(t) * exp(xbeta) where ho(t) is an unknown and unspecified baseline hazard.   Cox's method of partial likelihood does away with ho(t) but still estimates the coefficients.  These coefficients are exponentiated to give hazard ratios which is the main output of PHREG.  It you have time-dependent covariates (td-covars) defined by programming statements inside the PHREG step then, as you noticed, the OUTPUT and BASELINE statements are not available.   If you could use the model (t1, t2) counting-process style of input (cp-syntax) then the BASELINE statement could be used with the CUMHAZ= keyword to get cumulative (integrated) hazard estimates. 

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!

What is ANOVA?

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.

Discussion stats
  • 1 reply
  • 488 views
  • 2 likes
  • 2 in conversation