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?
... View more