<?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 How to adjust variable for Survival Analysis in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-variable-for-Survival-Analysis/m-p/814582#M321528</link>
    <description>&lt;P&gt;Im running a survival analysis and I have a variable 'age' where the data ranges from 30-90 years old but how do I cut it off and make it so the survival probability graph will only include up to the age of 60? Also how might I group them in categories of say 30-50 years, 50-70 years, and 70-90 years?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc lifetest data=lungcancer plots=survival(atrisk);
time survival*status(0);
strata age / test=logrank;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 21 May 2022 20:11:52 GMT</pubDate>
    <dc:creator>nic_perry</dc:creator>
    <dc:date>2022-05-21T20:11:52Z</dc:date>
    <item>
      <title>How to adjust variable for Survival Analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-variable-for-Survival-Analysis/m-p/814582#M321528</link>
      <description>&lt;P&gt;Im running a survival analysis and I have a variable 'age' where the data ranges from 30-90 years old but how do I cut it off and make it so the survival probability graph will only include up to the age of 60? Also how might I group them in categories of say 30-50 years, 50-70 years, and 70-90 years?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc lifetest data=lungcancer plots=survival(atrisk);
time survival*status(0);
strata age / test=logrank;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 20:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-variable-for-Survival-Analysis/m-p/814582#M321528</guid>
      <dc:creator>nic_perry</dc:creator>
      <dc:date>2022-05-21T20:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to adjust variable for Survival Analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-variable-for-Survival-Analysis/m-p/814609#M321536</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/425850"&gt;@nic_perry&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/425850"&gt;@nic_perry&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Im running a survival analysis and I have a variable 'age' where the data ranges from 30-90 years old but how do I cut it off and make it so the survival probability graph will only include up to the age of 60? Also how might I group them in categories of say 30-50 years, 50-70 years, and 70-90 years?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, you want all ages in the LIFETEST analysis but only the ages up till 60 (included) in the survival probability plot, correct?&lt;BR /&gt;In that case, capture all results in an output dataset and plot that output dataset with PROC SGPLOT and a where clause :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where age &amp;lt;= 60 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And with regard to grouping into age categories ...&lt;BR /&gt;Same question : is this grouping only meant for plotting or also for the preceding analysis?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.want;
 set work.have;
 if 10 &amp;lt;= age &amp;lt; 20 then ageclass='10';
 else if 20 &amp;lt;= age &amp;lt; 30 then ageclass='20';
 ...
 else if 90 &amp;lt;= age &amp;lt; 150 then ageclass='90';
 else ageclass='00';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 22 May 2022 14:30:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-variable-for-Survival-Analysis/m-p/814609#M321536</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-05-22T14:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to adjust variable for Survival Analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-variable-for-Survival-Analysis/m-p/814610#M321537</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/425850"&gt;@nic_perry&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Im running a survival analysis and I have a variable 'age' where the data ranges from 30-90 years old but how do I cut it off and make it so the survival probability graph will only include up to the age of 60? Also how might I group them in categories of say 30-50 years, 50-70 years, and 70-90 years?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;proc lifetest data=lungcancer plots=survival(atrisk);
time survival*status(0);
strata age / test=logrank;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Are you just asking to change the set of STRATA you ask it to use?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are there implications about censoring if you truncate AGE at 60?&amp;nbsp; In other words if there is a data point with an age of 65 and a survival of 10 years does that mean that 5 of those years was after age 60?&amp;nbsp; Do you want to censor that survival time to just the 5 years to correspond to truncating the age at 60?&lt;/P&gt;</description>
      <pubDate>Sun, 22 May 2022 14:59:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-adjust-variable-for-Survival-Analysis/m-p/814610#M321537</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-22T14:59:46Z</dc:date>
    </item>
  </channel>
</rss>

