<?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 LIFETEST output at-risk in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924765#M363995</link>
    <description>&lt;P&gt;Timelist does not give at-risk numbers.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2024 22:10:33 GMT</pubDate>
    <dc:creator>PamG</dc:creator>
    <dc:date>2024-04-17T22:10:33Z</dc:date>
    <item>
      <title>PROC LIFETEST output at-risk</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924762#M363993</link>
      <description>&lt;P&gt;Is there a way to output at-risk numbers at specific time points to a file? With the following code, it outputs below the graph and I need to use something like PROC PRINT to view the data.&amp;nbsp; Also it does not give heading on what the timepoints are.&amp;nbsp; I need to share this with others and I am not satified with the way it is presented currently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a sample code-&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data vagcan;
   label days  ='Days from Exposure to Death'
         group ='Treatment Group';
   input days @@;
   censored = (days &amp;lt; 0);
   days = abs(days);
   if _n_ &amp;gt; 19 then group = 'pretrt1';
   else group = 'pretrt2';
   datalines;
143 164 188 188 190 192 206 209 213 216
220 227 230 234 246 265 304  -216  -244
142 156 163 198 205 232 232 233 233 233 233 239
240 261 280 280 296 296 323 -204 -344
;

PROC LIFETEST data=vagcan plots=survival(atrisk(outside(0.25))=150 160 180 300); 
   time days*censored(1);
strata Group; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Apr 2024 21:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924762#M363993</guid>
      <dc:creator>PamG</dc:creator>
      <dc:date>2024-04-17T21:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: PROC LIFETEST output at-risk</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924763#M363994</link>
      <description>Have you tried the timelist option on the PROC LIFETEST? &lt;BR /&gt;&lt;BR /&gt;I'm not quite sure exactly what you're looking for as well, can you more clearly illustrate what you're looking for in terms of graphics?</description>
      <pubDate>Wed, 17 Apr 2024 22:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924763#M363994</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-04-17T22:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: PROC LIFETEST output at-risk</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924765#M363995</link>
      <description>&lt;P&gt;Timelist does not give at-risk numbers.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 22:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924765#M363995</guid>
      <dc:creator>PamG</dc:creator>
      <dc:date>2024-04-17T22:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: PROC LIFETEST output at-risk</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924766#M363996</link>
      <description>&lt;P&gt;Timelist and ATRISK option gives identical results.&amp;nbsp; I am running this on my real data and the numbers are off.&amp;nbsp; Also on my real data, timelist gives a value of zero at the last time of followup while the ATRISK gives a number.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 22:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924766#M363996</guid>
      <dc:creator>PamG</dc:creator>
      <dc:date>2024-04-17T22:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC LIFETEST output at-risk</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924767#M363997</link>
      <description>&lt;P&gt;If you want something that appears in the results generally you can get that into a data set using ODS OUTPUT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You use ODS TRACE to get a list of objects created by a procedure. Then use ODS OUTPUT statement(s) to place the output into a data set.&lt;/P&gt;
&lt;P&gt;An example you can run:&lt;/P&gt;
&lt;PRE&gt;ods trace on;

proc freq data=sashelp.class ;
   tables sex * age / chisq ;
run;

ods trace off;&lt;/PRE&gt;
&lt;P&gt;The Log will show after the code in addition to typical log output:&lt;/P&gt;
&lt;PRE&gt;Output Added:
-------------
Name:       CrossTabFreqs
Label:      Cross-Tabular Freq Table
Template:   Base.Freq.CrossTabFreqs
Path:       Freq.Table1.CrossTabFreqs
-------------

Output Added:
-------------
Name:       ChiSq
Label:      Chi-Square Tests
Template:   Base.Freq.ChiSq
Path:       Freq.Table1.ChiSq
-------------
&lt;/PRE&gt;
&lt;P&gt;The important part for getting the objects into data sets is the NAME: and what follows.&lt;/P&gt;
&lt;P&gt;To get the basic frequency information is the Crosstabfreqs and the Chi-Square tests then name is Chisq.&lt;/P&gt;
&lt;P&gt;So this code will create data sets Mycrosstabset and Mychisquareset with the results.&lt;/P&gt;
&lt;PRE&gt;ods output crosstabfreqs= mycrosstabset
           chisq = mychisquareset
;
proc freq data=sashelp.class ;
   tables sex * age / chisq ;
run;&lt;/PRE&gt;
&lt;P&gt;If you are generating plots the objects will include the plots and you can capture data from them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Caveat: some of these ODS OUTPUT generated data sets have quite a bit more than appears in the results window and may take some work to get pieces you want for other purposes.&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>Wed, 17 Apr 2024 22:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924767#M363997</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-17T22:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: PROC LIFETEST output at-risk</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924787#M364002</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
As ballardw said, using ODS table to save these data.
*/
data vagcan;
   label days  ='Days from Exposure to Death'
         group ='Treatment Group';
   input days @@;
   censored = (days &amp;lt; 0);
   days = abs(days);
   if _n_ &amp;gt; 19 then group = 'pretrt1';
   else group = 'pretrt2';
   datalines;
143 164 188 188 190 192 206 209 213 216
220 227 230 234 246 265 304  -216  -244
142 156 163 198 205 232 232 233 233 233 233 239
240 261 280 280 296 296 323 -204 -344
;
ods select none;
ods output SurvivalPlot=SurvivalPlot ;
PROC LIFETEST data=vagcan plots=survival(atrisk(outside(0.25))=150 160 180 300) ; 
   time days*censored(1);
strata Group; 
run;
ods select all;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1713420268019.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95645i22851EC81B03267D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1713420268019.png" alt="Ksharp_0-1713420268019.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 06:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924787#M364002</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-04-18T06:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC LIFETEST output at-risk</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924827#M364020</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;Thank you so much.&amp;nbsp; This is exactly what I was looking for!!!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 13:23:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-LIFETEST-output-at-risk/m-p/924827#M364020</guid>
      <dc:creator>PamG</dc:creator>
      <dc:date>2024-04-18T13:23:17Z</dc:date>
    </item>
  </channel>
</rss>

