<?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: counting process for time-dependent covariate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/counting-process-for-time-dependent-covariate/m-p/872330#M344636</link>
    <description>Thanks so much and my apologies for the delayed response, a lot going on the past month!</description>
    <pubDate>Wed, 26 Apr 2023 17:51:53 GMT</pubDate>
    <dc:creator>Merdock</dc:creator>
    <dc:date>2023-04-26T17:51:53Z</dc:date>
    <item>
      <title>counting process for time-dependent covariate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-process-for-time-dependent-covariate/m-p/864947#M341538</link>
      <description>&lt;P&gt;I have the following dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID$ TRANSDATE:mmddyy. CENSDATE:mmddyy. FUTIME CENSOR SWITCHTIME GROUP$;
format TRANSDATE mmddyy10. CENSDATE mmddyy10.;
datalines;
001	7/2/2002	7/11/2003	344	1	344	1
002	8/23/2001	7/30/2002	311	0	311	1
003	3/27/2002	10/1/2007	1984	1	1984	1
004	1/28/2000	3/26/2011	4045	1	0	2
005	8/6/2002	12/16/2005	1198	0	1198	1
006	1/23/2001	9/8/2005	1659	0	12	3
007	4/10/2003	3/10/2006	1035	0	1035	1
008	8/26/2002	3/26/2008	2009	0	2009	1
009	8/14/2014	9/15/2016	733	0	18	3
010	11/3/2000	11/10/2003	1072	0	1072	1
011	4/11/2001	9/12/2007	2315	0	2315	1
012	2/5/2002	1/2/2006	1397	0	1397	1
013	7/11/2000	1/2/2008	2701	0	0	2
014	5/7/2002	11/10/2008	2349	0	2349	1
015	9/23/2001	2/7/2005	1203	0	6	3
;
run;
proc print data=have; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How can I get this dataset into a counting process format for time-dependent covariate survival analysis? The time-dependent covariate would be “switch” from table below. The IDs whose FUTIME NE SWITCHTIME (group=3) are the ones who switched from group 1 to group 2 at that respective SWITCHTIME so they would get switch=1. I also want everybody who had SWITCHTIME=0 to have switch=1.&lt;/P&gt;
&lt;P&gt;I’ve already done this in R but I want to double check my results in SAS and also learn how to convert this dataset using data steps, as opposed to programming statement.&lt;/P&gt;
&lt;P&gt;So basically I want my final dataset to look like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Merdock_0-1679076261476.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81730i5DECBCB0D261ADC5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Merdock_0-1679076261476.png" alt="Merdock_0-1679076261476.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 18:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-process-for-time-dependent-covariate/m-p/864947#M341538</guid>
      <dc:creator>Merdock</dc:creator>
      <dc:date>2023-03-17T18:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: counting process for time-dependent covariate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-process-for-time-dependent-covariate/m-p/864998#M341560</link>
      <description>&lt;P&gt;Where do the values of&amp;nbsp; Tstart, Tstop and status come from??? Your want also shows two values of Id=006. Why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have accurately described how Switch is to be set then maybe:&lt;/P&gt;
&lt;PRE&gt;data switch;
   set have;
   switch= ( (FUTIME NE SWITCHTIME) or  (SWITCHTIME=0) );
run;&lt;/PRE&gt;
&lt;P&gt;But you appear to be missing a number of details.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 22:21:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-process-for-time-dependent-covariate/m-p/864998#M341560</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-17T22:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: counting process for time-dependent covariate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-process-for-time-dependent-covariate/m-p/872330#M344636</link>
      <description>Thanks so much and my apologies for the delayed response, a lot going on the past month!</description>
      <pubDate>Wed, 26 Apr 2023 17:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-process-for-time-dependent-covariate/m-p/872330#M344636</guid>
      <dc:creator>Merdock</dc:creator>
      <dc:date>2023-04-26T17:51:53Z</dc:date>
    </item>
  </channel>
</rss>

