<?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 Re: Estimate hazard ratio for different groups in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/363672#M19108</link>
    <description>&lt;P&gt;Using a BY to get an estimate for each is incorrect - that runs an individual model for each level of your BY variable. It doesn't sound like that's what you're actually interested in or at least in my experience that wouldn't be correct.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2017 02:29:41 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-06-02T02:29:41Z</dc:date>
    <item>
      <title>Estimate hazard ratio for different groups</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/363666#M19106</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While knowing how to estimate hazard ratio for normal case, there has been a question stuck in my mind:&lt;/P&gt;&lt;P&gt;how to estimate hazard ratio for different groups?&lt;/P&gt;&lt;P&gt;This may be too ambiguous, so allows me to explain.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Scenario 1 -- simply estimation of hazard ratio(without adjustment for any confounder)&lt;/P&gt;&lt;P&gt;This is straighforward, by using the following code we can estimate hazard ratio for independent variable: MorningBPSurge&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC PHREG DATA=one;
	MODEL followtime*allcause(0)=MorningBPSurge / RISKLIMITS;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;# Scenario 2 -- multivariable hazard ratio (with adjustment for confounding effect)&lt;/P&gt;&lt;P&gt;Also, this is easy to accomplish and easy to understand: we just need to put the confounders we want to adjust into the model.&lt;/P&gt;&lt;P&gt;For example, estimating hazard ratio for independent variable (MorningBPSurge) while adjusting for two confounders (age and sex):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC PHREG DATA=one;
	MODEL followtime*allcause(0)=MorningBPSurge Age Sex / RISKLIMITS;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the next case&amp;nbsp;really confuses me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Scenario 3 -- haza ratio for different groups while adjusting for confounders&lt;/P&gt;&lt;P&gt;Let's say we what to know if the hazard ratio for independent variable varies between two groups, and also, we need to take into account confounding effect.&lt;/P&gt;&lt;P&gt;For example, we want to know if the&amp;nbsp;hazard ratio of&amp;nbsp;MorningBPSurge differs for&amp;nbsp;group A and group B.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thus, we have&lt;/P&gt;&lt;P&gt;A) Independet variable: MorningBPSurge&lt;/P&gt;&lt;P&gt;B) Group variable: H_BP_Night, 0 if this patient has no hypertension during nighttime; 1 if he/she has.&lt;/P&gt;&lt;P&gt;C) Confounders: Age, Sex&lt;/P&gt;&lt;P&gt;What I usually do&amp;nbsp;is that I use statment "by" to get HR within each group:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC PHREG DATA=one;
		BY H_BP_Night;
	MODEL followtime*allcause(0)=MorningBPSurge Age Sex / RISKLIMITS;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then, regarding to P-value, I create interaction term "MorningBPSurge * H_BP_Night" to see if it is significant:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC PHREG DATA=one;
	MODEL followtime*allcause(0)=MorningBPSurge Age Sex 
	      H_BP_Night MorningBPSurge*H_BP_Night/ RISKLIMITS;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As you probably understand the situation, my questions are&lt;/P&gt;&lt;P&gt;1) Is the using of "by" and interaction term correct for what I want?&lt;/P&gt;&lt;P&gt;2) Do I really need to do this separately, or is there any exsited statment can achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very welcom if you guys have any idea about this.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/363666#M19106</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2017-06-02T02:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate hazard ratio for different groups</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/363670#M19107</link>
      <description>&lt;P&gt;Have you looked at using the HAZARDRATIO statement specifically?&lt;/P&gt;
&lt;P&gt;It allows you to specify exactly what you're looking for as far as I see.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Docs:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.2&amp;amp;docsetTarget=statug_phreg_syntax13.htm&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.2&amp;amp;docsetTarget=statug_phreg_syntax13.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A whitepaper on several options:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings10/253-2010.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings10/253-2010.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:28:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/363670#M19107</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-02T02:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate hazard ratio for different groups</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/363672#M19108</link>
      <description>&lt;P&gt;Using a BY to get an estimate for each is incorrect - that runs an individual model for each level of your BY variable. It doesn't sound like that's what you're actually interested in or at least in my experience that wouldn't be correct.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:29:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/363672#M19108</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-02T02:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate hazard ratio for different groups</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/363716#M19110</link>
      <description>&lt;P&gt;I will also encourage you to use the "hazardratio" statement. It can easily calculate the estimated hazardratio for each level of some effectmodificator (effectmodification = interaction, just an other word for same thing).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A little problem I&amp;nbsp;have with this is that it doesnt always select the reference level correctly when using the glm-parametrizaion. If&amp;nbsp;the default parametrization is used, then&amp;nbsp;both maineffects and interaction effects should be in the modelstatement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here a simple example.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
  do group=1,2;
    do exposure='yes','no';
	  do i=1 to 10000;
	  rate=0.1*(3**(group=2))*(1.5**((exposure='yes')*(group=1))) *  2**((exposure='yes')*(group=2)) ;
     t=rand('exponential',1/rate);
    output;
	end;
	end;
	end;
run;

*estimate the exposure effect for each of the two groups:;
proc phreg data=mydata;
  class group exposure(ref='no');
  model t=exposure*group exposure group;
  hazardratio exposure/at(group=all) dif=ref;
run;

*Same again, but with glm-parametrization - then it is enough only to specifiy interaction as that include here maineffects;
proc phreg data=mydata;
  class group exposure(ref='no')/param=glm;
  model t=exposure*group;
  hazardratio exposure/at(group=all) dif=ref;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use the "by" statement, then you allow the model to have a different baseline hazard function for each value of the by-variable. So it will not give exactly same estimate. That will also give a little loss in statistical power.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck;-)&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 08:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/363716#M19110</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2017-06-02T08:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate hazard ratio for different groups</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/364807#M19151</link>
      <description>Reeza,&lt;BR /&gt;&lt;BR /&gt;Thank you for this!&lt;BR /&gt;Finally, I understand what's wrong with using "by".&lt;BR /&gt;Also, thank you for providing me the reference of "hazardratio".&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jun 2017 02:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/364807#M19151</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2017-06-07T02:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate hazard ratio for different groups</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/364808#M19152</link>
      <description>&lt;P&gt;Jacob,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for providing not only concept but also SAS code!&lt;/P&gt;&lt;P&gt;After checking reference that Reeza gave me, I've created SAS code nearly the same as you gave to me.&lt;/P&gt;&lt;P&gt;Hazardratio is a so powerful statement that make users more convenient to get the estimation.&lt;/P&gt;&lt;P&gt;Thank you again for introducing this poweful tool to me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 02:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-hazard-ratio-for-different-groups/m-p/364808#M19152</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2017-06-07T02:21:54Z</dc:date>
    </item>
  </channel>
</rss>

