<?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: proc phreg predicted time to event in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/272234#M14321</link>
    <description>&lt;P&gt;You can get the number of patients at risk for each day, which gives the numbers in the survival plot.&amp;nbsp; For example, the following program is copied from the Getting Started example in PROC PHREG. The ATRISK= option on the OUTPUT statement adds the at risk values to the OUT= data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Rats;
   label Days  ='Days from Exposure to Death';
   input Days Status Group @@;
   datalines;
143 1 0   164 1 0   188 1 0   188 1 0
190 1 0   192 1 0   206 1 0   209 1 0
213 1 0   216 1 0   220 1 0   227 1 0
230 1 0   234 1 0   246 1 0   265 1 0
304 1 0   216 0 0   244 0 0   142 1 1
156 1 1   163 1 1   198 1 1   205 1 1
232 1 1   232 1 1   233 1 1   233 1 1
233 1 1   233 1 1   239 1 1   240 1 1
261 1 1   280 1 1   280 1 1   296 1 1
296 1 1   323 1 1   204 0 1   344 0 1
;

data Regimes;
   Group=0;   output;   Group=1;   output;
run;

ods graphics on;
proc phreg data=Rats plot(overlay)=survival;
   model Days*Status(0)=Group;
   baseline covariates=regimes out=_null_;
   output out=out atrisk=atrisk order=sorted;
run;

proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 21 May 2016 11:36:53 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2016-05-21T11:36:53Z</dc:date>
    <item>
      <title>proc phreg predicted time to event</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/272137#M14319</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running a cox-proportional hazards model. I want to get a predicted days out of this model. I am wondering if anyone can help. I know proc phreg has the output procedure but I don't see options. Can anyone help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shirley&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 20:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/272137#M14319</guid>
      <dc:creator>lei</dc:creator>
      <dc:date>2016-05-20T20:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg predicted time to event</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/272180#M14320</link>
      <description>&lt;P&gt;It may be terminology differences, but I don't think Proc Phreg does that, I think Proc Lifereg does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Phreg produces a survival function (or failure), so the probability of survival at various times.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm also not sure what you mean by output procedure, what are you expecting to get out?&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 21:17:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/272180#M14320</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-20T21:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg predicted time to event</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/272234#M14321</link>
      <description>&lt;P&gt;You can get the number of patients at risk for each day, which gives the numbers in the survival plot.&amp;nbsp; For example, the following program is copied from the Getting Started example in PROC PHREG. The ATRISK= option on the OUTPUT statement adds the at risk values to the OUT= data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Rats;
   label Days  ='Days from Exposure to Death';
   input Days Status Group @@;
   datalines;
143 1 0   164 1 0   188 1 0   188 1 0
190 1 0   192 1 0   206 1 0   209 1 0
213 1 0   216 1 0   220 1 0   227 1 0
230 1 0   234 1 0   246 1 0   265 1 0
304 1 0   216 0 0   244 0 0   142 1 1
156 1 1   163 1 1   198 1 1   205 1 1
232 1 1   232 1 1   233 1 1   233 1 1
233 1 1   233 1 1   239 1 1   240 1 1
261 1 1   280 1 1   280 1 1   296 1 1
296 1 1   323 1 1   204 0 1   344 0 1
;

data Regimes;
   Group=0;   output;   Group=1;   output;
run;

ods graphics on;
proc phreg data=Rats plot(overlay)=survival;
   model Days*Status(0)=Group;
   baseline covariates=regimes out=_null_;
   output out=out atrisk=atrisk order=sorted;
run;

proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 21 May 2016 11:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/272234#M14321</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-05-21T11:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg predicted time to event</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/272402#M14337</link>
      <description>&lt;P&gt;Proc phreg does not calculate the expected lifetime directly. But&amp;nbsp;PHREG can&amp;nbsp;calculate the survival function, which then can be used to calculate the expected lifetime. It is such that the integrated survival function gives the expected lifetime. One should be carefull in practice, since the survival function can be difficult to estimate in the tail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example, where the datastep after PHREG do the integration:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
  do i=1 to 10000;
    predictor=mod(i,2);
    time=rand('gamma',5*exp(log(2)*predictor));
    censurtime=rand('gamma',10);
    event=(time&amp;lt;=censurtime);
    time=min(time,censurtime);
    output;
  end;
  keep time predictor event;
run;
data covariates;
  do predictor=0 to 1;
output;
  end;
run;
proc phreg data=mydata;
  class predictor /param=glm;
  model time*event(0)=predictor;
  baseline out=kaplanmeier survival=survival  covariates=covariates/method=pl;
run;

data meansurvival;
  set kaplanmeier;
  by predictor;
  retain lasttime;
  if first.predictor then integral=0;
  else do;
    integral+survival*(time-lasttime);
  end;
  lasttime=time;
  if last.predictor;
  put integral;
  keep integral predictor;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, it is not possible to estimate confidence limits of the expected survival in this way. If you want this, you should better use a failuretime model (proc lifereg).&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 12:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/272402#M14337</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2016-05-23T12:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: proc phreg predicted time to event</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/410565#M21451</link>
      <description>&lt;P&gt;Is there a way to get the predicted survival/risk for each observation using proc phreg, not just the number at risk at each time point? For example, using the following, I get a survival and risk for each event/non event observation. But this is using Kaplan Meier/proc lifetest, and I'm hoping there's a way to do it using proc phreg? Thank you!&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ods&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;trace&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ods&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; productlimitestimates=predkm2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;lifetest&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; data=incidentvalid method=km;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;test&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sex agecateg bmicateg diabetes prevhyp prevap prevmi cholcateg smokecateg;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;time&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; timedth*death(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;rank&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=predkm2 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;groups&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=validkmrank;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; survival;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ranks&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; decile;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=validkmrank ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2017 17:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-phreg-predicted-time-to-event/m-p/410565#M21451</guid>
      <dc:creator>chelseaxxlutz</dc:creator>
      <dc:date>2017-11-04T17:18:10Z</dc:date>
    </item>
  </channel>
</rss>

