proc phreg

SAS day 17: Proc Phreg

One day, my boss took a glance at a table with Hazard Ratio and Median Survival Time then he told me the program set the reference group in Proc Phreg wrong.

It turns out he was correct after validating the program. However, I was very curious about how did he figure it out by an Augenblick. Then he shared with us some knowledge about Hazard Ratio and Proc Phreg.

Background knowledge

Hazard Rate: HRs represent instantaneous risk over the study time period.

Median Survival Time: The time after which 50 percent of people with a particular condition are still living, and 50 percent have died.

Median survival time and Hazard Rate

if Median(A) > Median(B) then Hazard Rate(A) < Hazard Rate(B), vice versa.

Without Loss of Generality, if the median survival time of group A is significantly longer than group B, then Hazard Rate of group A is smaller than Hazard Rate of group B at any given point, vice versa.

[caption id="attachment_1056" align="alignnone" width="750"]
image

qimono / Pixabay[/caption]

**Example **

Now we will demonstrate Proc Phreg with Hazard Ratio with Sashelp.BMT dataset.

Basic Proc Phreg Syntax

<pre class="EnlighterJSRAW" data-enlighter-language="sql" data-enlighter-highlight="2,4">Proc phreg data=a;
class x ; /ref(x) only character value, the lowest character value is reference/
model xy= a/rl ; /can input more than one variable on the RHS of the equation. rl:risk limit (eßt)/
by z;/
optional/
id m;/
optional*/
run;</pre>

  1. Read in the sashelp.BMT dataset and only consider AML Low Group and AML High Group
    Note: Hazard Ratio is usually designed for two-level comparison,
    we will introduce 3-level comparison next time.

<pre class="EnlighterJSRAW" data-enlighter-language="sql">data aml;
set sashelp.bmt;
if group="AML-Low Risk" then ref="0";
if group="AML-High Risk" then ref="1";
if ref in("0","1");
run;</pre>

image
   2.  Apply Proc Phreg to generate the hazard ratio

<pre class="EnlighterJSRAW" data-enlighter-language="sql" data-enlighter-highlight="2,3">proc phreg data=aml outest=est61 covout;
class ref;
model T*status(0)=ref/rl;
run;</pre>

image

Results:

From the output, we have Hazard Ratio=0.39, which means the risk of death of a patient in AML high Group survives until today and will survive until tomorrow, compared with the AML Low Group Reduced by 0.61. (1-Hazard Ratio)*100%

Validation:

As we mentioned earlier, if Hazard Ratio <1 then we expected a longer survival median time in AML Low Group. The following Kaplan Meier plot demonstrated the AML Low Group indeed has a larger survival median.

image

<pre class="EnlighterJSRAW" data-enlighter-language="python">proc lifetest data=aml plots=survival;
time T*status(0);
strata Group;
run;</pre>

Thanks very much to Joe wang to share the Proc Phreg knowledge with me, we will show the 3-level Hazard Ratio in Proc Phreg next time!

Happy studying! 🐰

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,168评论 0 10
  • 今天讨论一个一般情况下的问题,父母有义务给你照看孩子吗? 大多数认为父母有义务给自己带小孩。 对这个问题,我曾经的...
    苗栋栋阅读 2,600评论 0 0
  • GCD(Grand Central Dispatch),是苹果开发的一个多核编程解决办法,它主要用于优化应用程序以...
    Geniune阅读 3,887评论 0 0
  • 记录了一个礼拜的自动思维,觉得自己差哭了。原来我的自动思维,永远在“万一、不好。”打转转。比如:我的驾照拿了十多年...
    安喜喜阅读 3,875评论 0 0
  • 今天看懒妈的一篇文章那句:不知道你家娃有没有一种名叫“只要大人赶时间就立即开启找茬模式”的病,立刻击中了我,让我想...
    晓杰的漫步生活阅读 2,990评论 0 2

友情链接更多精彩内容