<?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: Adding confidence bands to survival plot using PHREG in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Adding-confidence-bands-to-survival-plot-using-PHREG/m-p/614632#M19268</link>
    <description>&lt;P&gt;It sounds like you are trying to output the information to a SAS data set and then use PROC SGPLOT to create the graph. If so, you can use the BAND statement to create prediction intervals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
do Group = 1, 2;
   do t = 0 to 10;
      Prob = exp(-Group*t/10);
      Lower = max(0, Prob - 0.05*Group);
      Upper = min(1, Prob + 0.05*Group);
      output;
   end;
end;
run;

proc sgplot data=Have;
band x=t lower=Lower upper=Upper / group=Group transparency=0.5;
series x=t y=Prob / group=Group;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regarding the counts (AtRsik, etc), you can use a XAXISTABLE statement to create a table of numbers inside the plot, See these examples:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2018/02/19/survival-plot-twist-using-sgplot-procedure/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2018/02/19/survival-plot-twist-using-sgplot-procedure/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2014/02/09/survival-plot/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2014/02/09/survival-plot/&lt;/A&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2016/07/17/graph-table-with-class/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2016/07/17/graph-table-with-class/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jan 2020 00:35:34 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2020-01-01T00:35:34Z</dc:date>
    <item>
      <title>Adding confidence bands to survival plot using PHREG</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Adding-confidence-bands-to-survival-plot-using-PHREG/m-p/614505#M19267</link>
      <description>&lt;P&gt;Hello - I'm using PHREG to estimate survival functions for 2 groups.&amp;nbsp; I have clustered observations (2 hips per person) so cannot use LIFETEST.&amp;nbsp; I've generated the plot but would like to add additional information, especially the confidence bands.&amp;nbsp; Options like NOCENSOR and ATRISK would be helpful, too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;PROC PHREG DATA=WORK.DDH2340&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PLOTS(OVERLAY=ROW)=S&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COVS(AGGREGATE);&lt;/P&gt;&lt;P&gt;MODEL&amp;nbsp;NEWSURV_YR*CENSOR(1)=COHORT/ TIES=BRESLOW;&lt;/P&gt;&lt;P&gt;STRATA COHORT;&lt;/P&gt;&lt;P&gt;ID ID;&lt;/P&gt;&lt;P&gt;BASELINE OUT=A SURVIVAL=S LOWER=LCL UPPER=UCL;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideas?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2019 02:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Adding-confidence-bands-to-survival-plot-using-PHREG/m-p/614505#M19267</guid>
      <dc:creator>LD4224</dc:creator>
      <dc:date>2019-12-31T02:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding confidence bands to survival plot using PHREG</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Adding-confidence-bands-to-survival-plot-using-PHREG/m-p/614632#M19268</link>
      <description>&lt;P&gt;It sounds like you are trying to output the information to a SAS data set and then use PROC SGPLOT to create the graph. If so, you can use the BAND statement to create prediction intervals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
do Group = 1, 2;
   do t = 0 to 10;
      Prob = exp(-Group*t/10);
      Lower = max(0, Prob - 0.05*Group);
      Upper = min(1, Prob + 0.05*Group);
      output;
   end;
end;
run;

proc sgplot data=Have;
band x=t lower=Lower upper=Upper / group=Group transparency=0.5;
series x=t y=Prob / group=Group;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regarding the counts (AtRsik, etc), you can use a XAXISTABLE statement to create a table of numbers inside the plot, See these examples:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2018/02/19/survival-plot-twist-using-sgplot-procedure/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2018/02/19/survival-plot-twist-using-sgplot-procedure/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2014/02/09/survival-plot/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2014/02/09/survival-plot/&lt;/A&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2016/07/17/graph-table-with-class/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2016/07/17/graph-table-with-class/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jan 2020 00:35:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Adding-confidence-bands-to-survival-plot-using-PHREG/m-p/614632#M19268</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-01-01T00:35:34Z</dc:date>
    </item>
  </channel>
</rss>

