<?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: how to set up dataset for survival analysis with time-dependent covariate in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860073#M42505</link>
    <description>Thank you for the reference. I was actually reading that exact paper right before I posted but I didn't find it very helpful  since it uses hypertension as an example of time-dependent binary variable but I'd like to know how to do this for my continuous time-dependent covariate, which is time of first switch. How would I create my (start, tstop] intervals and account for both the event (graft failure/loss) and time to first switch as the time-dependent predictor? I guess I don't really see how time to first switch can even be seen as a time-dependent covariate..</description>
    <pubDate>Wed, 22 Feb 2023 05:43:24 GMT</pubDate>
    <dc:creator>Merdock</dc:creator>
    <dc:date>2023-02-22T05:43:24Z</dc:date>
    <item>
      <title>how to set up dataset for survival analysis with time-dependent covariate</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860063#M42503</link>
      <description>&lt;P&gt;I have a dataset with patients who had liver transplant. Some of them were in group 1 (if on drug A at baseline), others were in group 2 (if on drug B at baseline), depending on the immunosuppressive med they were taking. I am interested in seeing how the time of first switch from med A to med B impacts graft survival. The issue is that I am relatively new to survival analysis and have definitely no experience with time-dependent covariates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given this, I would like to know if anybody can give me a step-by-step on how I could model time of first switch as a time-dependent covariate in a Cox model with time to graft loss as the outcome? I have read a few theoretical, and some more practical tutorials for how to do this in R, so I know I need the data in long format or so-called counting process format with tstart and tstop and all that, but I am still having trouble getting situated and figuring out an action plan for how to analyze this, and in SAS too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a test dataset similar to the one I have, where GROUP=1, if on drug A; 2 if on drug B, and 3 if they switched from A to B;&lt;/P&gt;
&lt;P&gt;CENSOR=1, if event (graft failure) happened, 0 otherwise;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FUTIME = total follow-up time (months) (=CENSDT – transplant date), where CENSDT (not shown here, is either date of event, or date of last follow-up/death);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EVTIME= time of event (months); EVTIME=FUTIME when CENSOR=1, else EVTIME= . ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SWITCHDATE (not shown here) =date of first switch from drug A to drug B;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SWITCHTIME=time of first switch from group 1 to group 2 (=SWITCHDATE – transplant date); this will be 0 for those patients who start off on drug B at baseline, and it is FUTIME for those who start off on drug A and never switch.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID$ CENSOR$ FUTIME EVTIME SWITCHTIME GROUP$;
datalines;
001	0	1229	.		333		3
002	0	1659	.		343		3
003	0	733	 	.		509		3
004	0	6998	.		1630	3
005	1	1005	1005	558		3
006	1	4726	4726	147		3
007	0	3790	.		2856	3
008	1	672		672		504		3
009	0	5224	.		2648	3
010	0	4143	.		149		3
011	0	4973	.		500		3
012	1	3626	3626	3624	3
013	0	4296	.		3998	3
014	0	977		.		0		2
015	0	2898	.		331		3
016	0	1382	.		1187	3
017	1	1164	1164	1164	1
018	0	1232	.		336		3
019	1	1599	1599	143		3
020	0	1795	.		111		3
021	0	3171	.		3171	1
022	1	483		483		333		3
023	1	824		824		351		3
024	0	662		.		662		3
025	1	597		597		0		2
026	0	1269	.		0		2
027	0	4120	.		4120	1
028	1	621		621		0		2
029	0	3452	.		3452	1
030	0	1842	.		0		2
;
run;
proc print data=have; run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 03:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860063#M42503</guid>
      <dc:creator>Merdock</dc:creator>
      <dc:date>2023-02-22T03:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up dataset for survival analysis with time-dependent covariate</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860068#M42504</link>
      <description>Please check out this paper:&lt;BR /&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings12/168-2012.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings12/168-2012.pdf&lt;/A&gt;</description>
      <pubDate>Wed, 22 Feb 2023 04:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860068#M42504</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2023-02-22T04:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up dataset for survival analysis with time-dependent covariate</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860073#M42505</link>
      <description>Thank you for the reference. I was actually reading that exact paper right before I posted but I didn't find it very helpful  since it uses hypertension as an example of time-dependent binary variable but I'd like to know how to do this for my continuous time-dependent covariate, which is time of first switch. How would I create my (start, tstop] intervals and account for both the event (graft failure/loss) and time to first switch as the time-dependent predictor? I guess I don't really see how time to first switch can even be seen as a time-dependent covariate..</description>
      <pubDate>Wed, 22 Feb 2023 05:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860073#M42505</guid>
      <dc:creator>Merdock</dc:creator>
      <dc:date>2023-02-22T05:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up dataset for survival analysis with time-dependent covariate</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860805#M42532</link>
      <description>On this page, ctrl-F “ Notice the creation of start and stop variables, which denote the beginning and end intervals defined by hospitalization and death”:&lt;BR /&gt;&lt;A href="https://stats.oarc.ucla.edu/sas/seminars/sas-survival/" target="_blank"&gt;https://stats.oarc.ucla.edu/sas/seminars/sas-survival/&lt;/A&gt;. Anything useful?</description>
      <pubDate>Sat, 25 Feb 2023 05:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860805#M42532</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2023-02-25T05:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to set up dataset for survival analysis with time-dependent covariate</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860984#M42558</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/235176"&gt;@pink_poodle&lt;/a&gt;, thanks! At first glance, I think there might actually be something in this article that could indeed be of help. I will need to read it more carefully though and see if I can adapt some of this for my data.</description>
      <pubDate>Mon, 27 Feb 2023 02:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-set-up-dataset-for-survival-analysis-with-time-dependent/m-p/860984#M42558</guid>
      <dc:creator>Merdock</dc:creator>
      <dc:date>2023-02-27T02:32:42Z</dc:date>
    </item>
  </channel>
</rss>

