<?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 Interaction term in the PHREG procedure in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/905324#M44928</link>
    <description>&lt;P data-pm-slice="1 1 []"&gt;Dear SAS users,&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;I would like to ask a question on the PHREG procedure. In my question, I will use an open dataset on bladder cancer (attached), where patients got recurrent events of cancer, and time from entry to the study to each of the cancers is known.&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I apply marginal type of multiple events models to these data, that is, in the PHREG, I stratify the model by events type (enum variable). As usual for these type of models, I use robust variance estimation by adding ID statement (correlation within patient id).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc phreg data=survival.bladder2 covs(aggregate);
model futime*status(0)=rx size number / ties=efron;
strata enum;
id id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P data-pm-slice="1 1 []"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;With that code, the PHREG procedure provides an overall hazard ratio for treatment groups, but I would like to know how treatment affects the hazard of each of the events. I understand that I simply need to add an interaction term between rx (treatment) and enum (event type), but not sure how to do that. I tried just add rx*enum in the MODEL statement, but that isn’t correct (enum was treated as numerical, I think).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would anyone be so kind to share how they would add a treatment by event interaction in this PHREG procedure?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Marina&lt;/P&gt;</description>
    <pubDate>Thu, 30 Nov 2023 09:09:24 GMT</pubDate>
    <dc:creator>marina_esp</dc:creator>
    <dc:date>2023-11-30T09:09:24Z</dc:date>
    <item>
      <title>Interaction term in the PHREG procedure</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/905324#M44928</link>
      <description>&lt;P data-pm-slice="1 1 []"&gt;Dear SAS users,&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;I would like to ask a question on the PHREG procedure. In my question, I will use an open dataset on bladder cancer (attached), where patients got recurrent events of cancer, and time from entry to the study to each of the cancers is known.&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I apply marginal type of multiple events models to these data, that is, in the PHREG, I stratify the model by events type (enum variable). As usual for these type of models, I use robust variance estimation by adding ID statement (correlation within patient id).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc phreg data=survival.bladder2 covs(aggregate);
model futime*status(0)=rx size number / ties=efron;
strata enum;
id id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P data-pm-slice="1 1 []"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;With that code, the PHREG procedure provides an overall hazard ratio for treatment groups, but I would like to know how treatment affects the hazard of each of the events. I understand that I simply need to add an interaction term between rx (treatment) and enum (event type), but not sure how to do that. I tried just add rx*enum in the MODEL statement, but that isn’t correct (enum was treated as numerical, I think).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would anyone be so kind to share how they would add a treatment by event interaction in this PHREG procedure?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Marina&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 09:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/905324#M44928</guid>
      <dc:creator>marina_esp</dc:creator>
      <dc:date>2023-11-30T09:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Interaction term in the PHREG procedure</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/905357#M44930</link>
      <description>&lt;P&gt;Put enum in a CLASS statement. If the only issue before was PHREG trying to fit enum as continuous, that should address the issue. The issue then becomes whether you get an appropriate analysis when enum is still considered as a stratification variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A shout out to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10078"&gt;@JacobSimonsen&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;for additional help in this area, since the above paragraph exhausts what I know about PHREG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 14:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/905357#M44930</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2023-11-30T14:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Interaction term in the PHREG procedure</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/905362#M44931</link>
      <description>You may need to put your interaction terms in programming statements inside the procedure if they involve the time variable.  Then you can list them in the MODEL statement as well.  This would be for so-called "time-dependent interactions with time" variables.&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Nov 2023 14:50:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/905362#M44931</guid>
      <dc:creator>OsoGris</dc:creator>
      <dc:date>2023-11-30T14:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Interaction term in the PHREG procedure</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/905369#M44933</link>
      <description>&lt;P&gt;You can indeed add an interaction term. This is also possible even when one of the terms is used as a stratification variable as it is in your case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should just specify that enum variable is a class variable. Otherwise, phreg will just make regression on the product.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc phreg data=survival.bladder2 covs(aggregate);
class enum rx/param=glm;
model futime*status(0)=rx rx*enum size number / ties=efron;
strata enum;
id id;
run;&lt;/PRE&gt;
&lt;P&gt;And you can test the rx-effect is the same across the enum's by keeping in the main effect of rx. The test will come as in the table with type 3 tests.&lt;/P&gt;
&lt;PRE&gt;proc phreg data=survival.bladder2 covs(aggregate);
class enum rx/param=glm;
model futime*status(0)=rx rx*enum size number / ties=efron;
strata enum;
id id;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 14:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/905369#M44933</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2023-11-30T14:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Interaction term in the PHREG procedure</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/906206#M44982</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10078"&gt;@JacobSimonsen&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the answer! I see that my mistake was not including enum in the CLASS statement. I am going to try your solution!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was only not sure why you add an option &lt;EM&gt;param=glm&lt;/EM&gt; in the CLASS statement? Does it make a difference for an interaciton model?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Marina&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 08:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/906206#M44982</guid>
      <dc:creator>marina_esp</dc:creator>
      <dc:date>2023-12-05T08:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Interaction term in the PHREG procedure</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/906208#M44983</link>
      <description>&lt;P&gt;&lt;EM&gt;Hi Maria,&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;It is not necessary&amp;nbsp;to have the "param=glm" as an option in the class statement. You will get the same estimates whether or not you use that option.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;I though think it is easier to see what the reference group is then the option is used, as that will give a row with 0s.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Btw, I made a typo. It was the intention not to include the main effect of rx in the first program.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Jacob&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 08:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Interaction-term-in-the-PHREG-procedure/m-p/906208#M44983</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2023-12-05T08:41:20Z</dc:date>
    </item>
  </channel>
</rss>

