<?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 phreg - time-varying predictor in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-time-varying-predictor/m-p/468888#M24383</link>
    <description>&lt;P&gt;This appears to be data content related. Can you share a subset of your data that demonstrates the behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jun 2018 22:51:38 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-06-08T22:51:38Z</dc:date>
    <item>
      <title>Proc phreg - time-varying predictor</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-time-varying-predictor/m-p/468882#M24382</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question about the class statement in proc phreg. I am trying to run a cox regression model with a time-varying predictor. Whenever I run the model, I get completely blank output. I think it has something to do with the class statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to run the model with a time-nonvarying predictor (using only the first treatment that people received, instead of modeling treatment as time-varying), it only works if&amp;nbsp;I include the predictor in the class statement. This is an example of the model with the time-nonvarying predictor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc phreg data=outcomes;&lt;BR /&gt;Class treatment (ref="0");&lt;BR /&gt;Model Timetostatus*event1yes(0) = treatment1;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The code above does give me appropriate output. It does NOT work if I exclude the class statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I actually want to make treatment a time-varying predictor like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc phreg data=outcomes;&lt;BR /&gt;Model Timetostatus*&lt;SPAN&gt;event1yes&lt;/SPAN&gt;(0) = treatment;&lt;BR /&gt;If timetostatus &amp;lt; regimen1_timetoend then treatment = treatment1;&lt;/P&gt;&lt;P&gt;Else If timetostatus &amp;gt; regimen2_timetostart and timetostatus &amp;lt;= regimen2_timetoend then &lt;SPAN&gt;treatment = treatment2;&lt;/SPAN&gt;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the model above, the output is blank, and SAS shows as if no events occurred. I have carefully checked all the variables that I have used to make treatment a time-varying predictor; they have all been calculated correctly, and there are definitely events. &lt;STRONG&gt;So I am assuming that the reason why the output is blank is that I have not put treatment in the class statement, since I had to do that in the first model. Is there a way to include&amp;nbsp;a time-varying predictor in the class statement?&lt;/STRONG&gt; I have tried a model including the class statement with treatment; I also tried a model with treatment1 and treatment2 in the class statement. None of those worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts on this?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 22:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-time-varying-predictor/m-p/468882#M24382</guid>
      <dc:creator>SarahW13</dc:creator>
      <dc:date>2018-06-08T22:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc phreg - time-varying predictor</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-time-varying-predictor/m-p/468888#M24383</link>
      <description>&lt;P&gt;This appears to be data content related. Can you share a subset of your data that demonstrates the behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 22:51:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-time-varying-predictor/m-p/468888#M24383</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-08T22:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc phreg - time-varying predictor</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-time-varying-predictor/m-p/468892#M24384</link>
      <description>&lt;P&gt;Thanks, ballardw!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since posting my question, I was able to figure out what was wrong. My predictor (binary:1 = on treatment, 0 = not on treatment) was coded as a character variable instead of as a numeric variable, so SAS wanted me to include it in the class statement. I just changed the predictor from a character variable to a numeric variable, and now proc phreg is giving me appropriate Cox regression output even with the time-varying predictor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just thought I would post this in case anyone else runs into the same problem in the future.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 23:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-time-varying-predictor/m-p/468892#M24384</guid>
      <dc:creator>SarahW13</dc:creator>
      <dc:date>2018-06-08T23:23:20Z</dc:date>
    </item>
  </channel>
</rss>

