<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to specify exact time for interaction when use PROC PHREG with time-dependent hazard ratio? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-exact-time-for-interaction-when-use-PROC-PHREG/m-p/826226#M40945</link>
    <description>&lt;P&gt;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:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;Coxph(formula = Surv(survyr, status)~Treatment*tt(Treatment),
           data=Dataset, tt=function(x,t, ...) as.numeric(t&amp;gt;7))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The as.numeric(t&amp;gt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering that is feasible to achieve the similar result and program in SAS? Thank you so much!!&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 12:32:20 GMT</pubDate>
    <dc:creator>SAS-questioner</dc:creator>
    <dc:date>2022-08-03T12:32:20Z</dc:date>
    <item>
      <title>How to specify exact time for interaction when use PROC PHREG with time-dependent hazard ratio?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-exact-time-for-interaction-when-use-PROC-PHREG/m-p/826226#M40945</link>
      <description>&lt;P&gt;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:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;Coxph(formula = Surv(survyr, status)~Treatment*tt(Treatment),
           data=Dataset, tt=function(x,t, ...) as.numeric(t&amp;gt;7))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The as.numeric(t&amp;gt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering that is feasible to achieve the similar result and program in SAS? Thank you so much!!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 12:32:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-exact-time-for-interaction-when-use-PROC-PHREG/m-p/826226#M40945</guid>
      <dc:creator>SAS-questioner</dc:creator>
      <dc:date>2022-08-03T12:32:20Z</dc:date>
    </item>
  </channel>
</rss>

