BookmarkSubscribeRSS Feed
SAS-questioner
Obsidian | Level 7

I wanted to conduct the Cox regression through PROC PHREG, however, based on the Kaplan-Meier plot, the treatment seems change over time because they interacted with each other. The treatment is four categories, so I added interaction in the model as follows:

proc phreg data=ps_w_adj;
	class treatment(ref='1');
	model time*survival(0) = treatment treatment2_ti treatment3_ti treatment4_ti /rl;
	treatment2_ti=log(followup_time)*(treatment=2);
	treatment3_ti=log(followup_time)*(treatment=3);
	treatment4_ti=log(followup_time)*(treatment=4);
	weight ps_weight_adj;
run;

In the results, it provided me the HR for main effects and the interaction. But the result is really hard to interpret because in the model, I didn't specify when the slope started to change. So, I checked online, and found someone used R to program similar situation as follows:

Coxph(formula = Surv(survyr, status)~Treatment*tt(Treatment),
           data=Dataset, tt=function(x,t, ...) as.numeric(t>7))

The as.numeric(t>7) specified to estimate the slope before 7 years, so if the hazard ratio for treatment is 0.74 and the HR for the interaction is 1.87, they can concluded that before 7 years, the HR for the treatment is 0.74, and after 7 years, the treatment's HR is 0.74*1.87=1.39. 

 

I am wondering that is feasible to achieve the similar result and program in SAS? Thank you so much!!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 0 replies
  • 712 views
  • 0 likes
  • 1 in conversation