<?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 Puzzled: Hazard ratio is 0 when both arms have events in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Puzzled-Hazard-ratio-is-0-when-both-arms-have-events/m-p/895469#M82934</link>
    <description>&lt;P&gt;I recently encountered a problem that the HR = 0 when both arms have events. One arm has 7 subjects with 2 events, and the other arm has 8 subjects with 3 events. How come HR is 0 from Proc PHREG?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have posted my data and code below. Can anyone give me some clue how this happens?&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;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input ID $ cnsr arm aval;
datalines;
01 0 2 2.9
01 1 1 0
03 0 1 14
04 1 2 0
05 0 1 9.6
06 1 2 5.6
07 0 2 1.1
08 1 1 0
09 0 2 2.8
10 1 2 3
11 1 2 0
12 1 1 0
13 1 1 8.5
14 1 2 0
15 1 1 0
;
run;
ods output ParameterEstimates = hazard; 
proc phreg data = test; 
class arm (ref="2"); 
model aval * cnsr(1) = arm / ties=breslow risklimits alpha=0.05 ; 
Run;

ods output quartiles=quartiles homtests=homtests_unstrat; 
proc lifetest data=test plots=survival method=km; 
time aval*cnsr(1); 
strata arm; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2023 16:48:12 GMT</pubDate>
    <dc:creator>fengyuwuzu</dc:creator>
    <dc:date>2023-09-22T16:48:12Z</dc:date>
    <item>
      <title>Puzzled: Hazard ratio is 0 when both arms have events</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Puzzled-Hazard-ratio-is-0-when-both-arms-have-events/m-p/895469#M82934</link>
      <description>&lt;P&gt;I recently encountered a problem that the HR = 0 when both arms have events. One arm has 7 subjects with 2 events, and the other arm has 8 subjects with 3 events. How come HR is 0 from Proc PHREG?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have posted my data and code below. Can anyone give me some clue how this happens?&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;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input ID $ cnsr arm aval;
datalines;
01 0 2 2.9
01 1 1 0
03 0 1 14
04 1 2 0
05 0 1 9.6
06 1 2 5.6
07 0 2 1.1
08 1 1 0
09 0 2 2.8
10 1 2 3
11 1 2 0
12 1 1 0
13 1 1 8.5
14 1 2 0
15 1 1 0
;
run;
ods output ParameterEstimates = hazard; 
proc phreg data = test; 
class arm (ref="2"); 
model aval * cnsr(1) = arm / ties=breslow risklimits alpha=0.05 ; 
Run;

ods output quartiles=quartiles homtests=homtests_unstrat; 
proc lifetest data=test plots=survival method=km; 
time aval*cnsr(1); 
strata arm; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 16:48:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Puzzled-Hazard-ratio-is-0-when-both-arms-have-events/m-p/895469#M82934</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2023-09-22T16:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Puzzled: Hazard ratio is 0 when both arms have events</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Puzzled-Hazard-ratio-is-0-when-both-arms-have-events/m-p/895482#M82935</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/56807"&gt;@fengyuwuzu&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for posting complete code including usable sample data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the hazard ratio is not exactly zero. If you print your ODS output dataset HAZARD with more decimals,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=hazard;
format _numeric_ best16.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you'll see that both &lt;FONT face="courier new,courier"&gt;ChiSq&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;HazardRatio&lt;/FONT&gt; are small, but positive. The natural logarithm of the hazard ratio is the &lt;FONT face="courier new,courier"&gt;Estimate&lt;/FONT&gt;, which is -17.991..., and exp(-17.991...)=1.536...E-8. Without having checked more details I'd say that a very small hazard ratio of arm 1 vs. arm 2 is plausible, given that &lt;EM&gt;all&lt;/EM&gt;&amp;nbsp;uncensored patients in arm 1 were still "alive" after*&amp;nbsp;&lt;EM&gt;all&lt;/EM&gt; patients in arm 2 had "died" or had been censored -- a quite extreme situation. As soon as there is some overlap, e.g., change AVAL=14 of ID '03' to 5, the hazard ratio steps up (to 0.283).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* (of course not necessarily "after" in calendar time)&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 20:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Puzzled-Hazard-ratio-is-0-when-both-arms-have-events/m-p/895482#M82935</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-09-22T20:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Puzzled: Hazard ratio is 0 when both arms have events</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Puzzled-Hazard-ratio-is-0-when-both-arms-have-events/m-p/895489#M82936</link>
      <description>&lt;P&gt;Thank you so much for the explanation. It makes sense.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 18:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Puzzled-Hazard-ratio-is-0-when-both-arms-have-events/m-p/895489#M82936</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2023-09-22T18:22:26Z</dc:date>
    </item>
  </channel>
</rss>

