<?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 create KM curves and Cox PH model with time-dependent covariate in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-KM-curves-and-Cox-PH-model-with-time-dependent/m-p/825365#M40893</link>
    <description>&lt;P&gt;Some patient received an treatment as treated group and some did not as control group. In order to consider &lt;STRONG&gt;"immortal time bias"&lt;/STRONG&gt;, I coded the treatment as a time-dependent covariate.&lt;/P&gt;&lt;P&gt;For example, there are two patients:&lt;/P&gt;&lt;P&gt;P1 received the treatment 30 days after the start of this study and died 30 days after receiving the treatment.&lt;/P&gt;&lt;P&gt;P2 did not received the treatment and survived at the end of this study (80 days).&lt;/P&gt;&lt;P&gt;Here I code the data as follow:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Treatment&lt;/TD&gt;&lt;TD&gt;Time&lt;/TD&gt;&lt;TD&gt;Death&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;P1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;P1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;P2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;80&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I just used SAS code to create KM curves&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/*Survival curve*/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;proc lifetest data=treatment;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;time Time*Dearg(0);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;strata Treatment;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and run Cox PH model&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/*Cox PH Model*/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;proc phreg data=treatment;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;model Time*Death(0)=treatment;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2022 21:40:49 GMT</pubDate>
    <dc:creator>SeaMoon_168</dc:creator>
    <dc:date>2022-07-25T21:40:49Z</dc:date>
    <item>
      <title>How to create KM curves and Cox PH model with time-dependent covariate</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-KM-curves-and-Cox-PH-model-with-time-dependent/m-p/825365#M40893</link>
      <description>&lt;P&gt;Some patient received an treatment as treated group and some did not as control group. In order to consider &lt;STRONG&gt;"immortal time bias"&lt;/STRONG&gt;, I coded the treatment as a time-dependent covariate.&lt;/P&gt;&lt;P&gt;For example, there are two patients:&lt;/P&gt;&lt;P&gt;P1 received the treatment 30 days after the start of this study and died 30 days after receiving the treatment.&lt;/P&gt;&lt;P&gt;P2 did not received the treatment and survived at the end of this study (80 days).&lt;/P&gt;&lt;P&gt;Here I code the data as follow:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Treatment&lt;/TD&gt;&lt;TD&gt;Time&lt;/TD&gt;&lt;TD&gt;Death&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;P1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;P1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;P2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;80&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I just used SAS code to create KM curves&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/*Survival curve*/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;proc lifetest data=treatment;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;time Time*Dearg(0);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;strata Treatment;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and run Cox PH model&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/*Cox PH Model*/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;proc phreg data=treatment;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;model Time*Death(0)=treatment;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 21:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-KM-curves-and-Cox-PH-model-with-time-dependent/m-p/825365#M40893</guid>
      <dc:creator>SeaMoon_168</dc:creator>
      <dc:date>2022-07-25T21:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to create KM curves and Cox PH model with time-dependent covariate</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-KM-curves-and-Cox-PH-model-with-time-dependent/m-p/825803#M40901</link>
      <description>I am not sure what I did is right or not? Could anyone who dealt with, immortal time bias, give me some advice on it? Thanks.</description>
      <pubDate>Thu, 28 Jul 2022 00:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-KM-curves-and-Cox-PH-model-with-time-dependent/m-p/825803#M40901</guid>
      <dc:creator>SeaMoon_168</dc:creator>
      <dc:date>2022-07-28T00:46:49Z</dc:date>
    </item>
  </channel>
</rss>

