Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Re: Puzzled: Hazard ratio is 0 when both arms have events

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 09-22-2023 12:42 PM
(368 views)

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?

I have posted my data and code below. Can anyone give me some clue how this happens?

Thank you!

```
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;
```

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello @fengyuwuzu,

Thank you for posting complete code including usable sample data.

Note that the hazard ratio is not exactly zero. If you print your ODS output dataset HAZARD with more decimals,

```
proc print data=hazard;
format _numeric_ best16.;
run;
```

you'll see that both ChiSq and HazardRatio are small, but positive. The natural logarithm of the hazard ratio is the Estimate, 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 *all* uncensored patients in arm 1 were still "alive" after* *all* 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).

* (of course not necessarily "after" in calendar time)

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello @fengyuwuzu,

Thank you for posting complete code including usable sample data.

Note that the hazard ratio is not exactly zero. If you print your ODS output dataset HAZARD with more decimals,

```
proc print data=hazard;
format _numeric_ best16.;
run;
```

you'll see that both ChiSq and HazardRatio are small, but positive. The natural logarithm of the hazard ratio is the Estimate, 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 *all* uncensored patients in arm 1 were still "alive" after* *all* 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).

* (of course not necessarily "after" in calendar time)

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you so much for the explanation. It makes sense.

**Don't miss out on SAS Innovate - Register now for the FREE Livestream!**

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.