<?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: Survival/risk per observation using proc phreg in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Survival-risk-per-observation-using-proc-phreg/m-p/410582#M21454</link>
    <description>&lt;P&gt;How are you defining 'risk'?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Survival estimates are created by adding SURVIVAL to the OUTPUT statement. I think I mentioned this to you before, but if not, it helps if you post code that we can actually run. So this means either taking the time to create a test data set or using the data set from SASHELP or the documentation examples as a data source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;output&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=out &lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;atrisk&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=atrisk &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;SURVIVAL = P_SURVIVAL&lt;/STRONG&gt;&lt;/FONT&gt; /&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;order&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=sorted;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've linked you to the&amp;nbsp;relevant&amp;nbsp;documentation section as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_syntax18.htm&amp;amp;docsetVersion=14.2&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_syntax18.htm&amp;amp;docsetVersion=14.2&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Nov 2017 19:30:22 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-11-04T19:30:22Z</dc:date>
    <item>
      <title>Survival/risk per observation using proc phreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Survival-risk-per-observation-using-proc-phreg/m-p/410566#M21452</link>
      <description>&lt;P&gt;Hello and thank you in advance for your help. I am trying to compare the predicted risk (via Cox/proc phreg) and expected risk (via Kaplan Meier/proc lifetest) by splitting observations into deciles of risk. Using the following code for proc lifetest, I am able to get the risk and survival for &lt;EM&gt;each observation/event.&lt;/EM&gt; However, now I need to do the same for proc phreg/Cox but have been unable to find a way to get SAS to spit out anything other than the risk for the overall sample (such as using the outset statement, or the baseline covariate statement). Would anyone know how to do this please!&amp;nbsp;This is very time sensitive! Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&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;&lt;P&gt;Cox code so far...&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;graphics&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="#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;phreg&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;=incidentvalid concordance plot(overlay)=survival;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;class&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sex (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ref&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) agecateg(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ref&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) bmicateg(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ref&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) diabetes(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ref&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) prevhyp(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ref&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) prevap(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ref&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) prevmi(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ref&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) cholcateg(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ref&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) smokecateg(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ref&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'1'&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;model&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;)= sex agecateg bmicateg diabetes prevhyp prevap prevmi cholcateg smokecateg/&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;rl&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;baseline&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;covariates&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=incidentvalid &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=_null_;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=out &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;atrisk&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=atrisk /&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;order&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=sorted;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;But I need more than just the number at risk... I need the survival and risk... &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2017 17:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Survival-risk-per-observation-using-proc-phreg/m-p/410566#M21452</guid>
      <dc:creator>chelseaxxlutz</dc:creator>
      <dc:date>2017-11-04T17:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Survival/risk per observation using proc phreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Survival-risk-per-observation-using-proc-phreg/m-p/410582#M21454</link>
      <description>&lt;P&gt;How are you defining 'risk'?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Survival estimates are created by adding SURVIVAL to the OUTPUT statement. I think I mentioned this to you before, but if not, it helps if you post code that we can actually run. So this means either taking the time to create a test data set or using the data set from SASHELP or the documentation examples as a data source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;output&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=out &lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;atrisk&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=atrisk &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;SURVIVAL = P_SURVIVAL&lt;/STRONG&gt;&lt;/FONT&gt; /&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;order&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=sorted;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've linked you to the&amp;nbsp;relevant&amp;nbsp;documentation section as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_syntax18.htm&amp;amp;docsetVersion=14.2&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_phreg_syntax18.htm&amp;amp;docsetVersion=14.2&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2017 19:30:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Survival-risk-per-observation-using-proc-phreg/m-p/410582#M21454</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-04T19:30:22Z</dc:date>
    </item>
  </channel>
</rss>

