<?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 PROC PHREG: hazard ratio when interaction term is added in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684086#M207274</link>
    <description>&lt;P&gt;Hello SAS communities!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose I would like to fit&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_MooMoo_0-1600219670630.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49390iF3DDF3DCC643BE65/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_MooMoo_0-1600219670630.png" alt="_MooMoo_0-1600219670630.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;where X1 and X2 are dichotomous variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below code will give me HR of X1 at each level of X2 due to interaction term.&lt;/P&gt;&lt;P&gt;proc phreg data=demo;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;class X1 X2 / param=ref;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;model (start, stop) * Y(0)=X1 X2 X1*X2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;hazardratio X1/diff=ref;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However,&amp;nbsp;I am trying to output overall effect of X1. In other words, I would like to say - Y increased/decreased by __% when X1=1 comparing to X1=0 after accounting for other covariates in the model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In that case, will below code output the number I need to make above statment? LSMEANS only work under param=glm... will this different from when setting param=ref?&lt;/P&gt;&lt;P&gt;proc phreg data=demo;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;class X1 X2 / param=glm;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;model (start, stop) * Y(0)=X1 X2 X1*X2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;lsmeas X1/cl;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you! If you have other suggestions, I appreciate that too!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Sep 2020 01:42:33 GMT</pubDate>
    <dc:creator>_MooMoo</dc:creator>
    <dc:date>2020-09-16T01:42:33Z</dc:date>
    <item>
      <title>PROC PHREG: hazard ratio when interaction term is added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684086#M207274</link>
      <description>&lt;P&gt;Hello SAS communities!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose I would like to fit&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_MooMoo_0-1600219670630.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49390iF3DDF3DCC643BE65/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_MooMoo_0-1600219670630.png" alt="_MooMoo_0-1600219670630.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;where X1 and X2 are dichotomous variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below code will give me HR of X1 at each level of X2 due to interaction term.&lt;/P&gt;&lt;P&gt;proc phreg data=demo;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;class X1 X2 / param=ref;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;model (start, stop) * Y(0)=X1 X2 X1*X2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;hazardratio X1/diff=ref;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However,&amp;nbsp;I am trying to output overall effect of X1. In other words, I would like to say - Y increased/decreased by __% when X1=1 comparing to X1=0 after accounting for other covariates in the model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In that case, will below code output the number I need to make above statment? LSMEANS only work under param=glm... will this different from when setting param=ref?&lt;/P&gt;&lt;P&gt;proc phreg data=demo;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;class X1 X2 / param=glm;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;model (start, stop) * Y(0)=X1 X2 X1*X2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;lsmeas X1/cl;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you! If you have other suggestions, I appreciate that too!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 01:42:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684086#M207274</guid>
      <dc:creator>_MooMoo</dc:creator>
      <dc:date>2020-09-16T01:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG: hazard ratio when interaction term is added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684313#M207358</link>
      <description>Yes, but you need to to explicitly state that your reference term is X1, like so:&lt;BR /&gt;class x1 x2 / param=glm ref=x1;&lt;BR /&gt;For more information about class and param, please see:&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=15.1&amp;amp;docsetTarget=statug_phreg_syntax06.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=15.1&amp;amp;docsetTarget=statug_phreg_syntax06.htm&amp;amp;locale=en&lt;/A&gt;</description>
      <pubDate>Wed, 16 Sep 2020 16:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684313#M207358</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2020-09-16T16:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG: hazard ratio when interaction term is added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684359#M207380</link>
      <description>&lt;P&gt;Thank you for the suggestion!&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I add ref=X1 statement after param=glm, it gives an error like below.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: FIRST, LAST.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 19:57:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684359#M207380</guid>
      <dc:creator>_MooMoo</dc:creator>
      <dc:date>2020-09-16T19:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG: hazard ratio when interaction term is added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684370#M207383</link>
      <description>&lt;P&gt;This is because it has to be a level: REF=’level’, sorry, not X1. Like if your variable has levels 0 and 1, and you want to compare to 1, then it would be REF='1'.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 20:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684370#M207383</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2020-09-16T20:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG: hazard ratio when interaction term is added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684371#M207384</link>
      <description>Aha! That's it.</description>
      <pubDate>Wed, 16 Sep 2020 20:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-hazard-ratio-when-interaction-term-is-added/m-p/684371#M207384</guid>
      <dc:creator>_MooMoo</dc:creator>
      <dc:date>2020-09-16T20:59:05Z</dc:date>
    </item>
  </channel>
</rss>

