<?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: specifying time-varying predictor as class in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-specifying-time-varying-predictor-as-class/m-p/469825#M24441</link>
    <description>&lt;P&gt;Thank you, sld and PaulBrownPhD!&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&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sld, as you suggested, the problem was with my predictor being coded as a character variable. 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 for 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>Wed, 13 Jun 2018 02:47:52 GMT</pubDate>
    <dc:creator>SarahW13</dc:creator>
    <dc:date>2018-06-13T02:47:52Z</dc:date>
    <item>
      <title>Proc phreg: specifying time-varying predictor as class</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-specifying-time-varying-predictor-as-class/m-p/468590#M24412</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 as a time-nonvarying predictor, it only works if&amp;nbsp;I classify 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) = treatment;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code above does give me appropriate output. It does NOT work if I exclude the class statement.&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 triple-checked all the variables that I have used to make treatment a time-varying predictor; they have all been calculated correctly, and there are events. So I am assuming that the reason why the output is blank is that I have not put treatment in the class statement. Is there a way to include treatment in the class statement if it is a time-varying predictor? 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 03:49:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-specifying-time-varying-predictor-as-class/m-p/468590#M24412</guid>
      <dc:creator>SarahW13</dc:creator>
      <dc:date>2018-06-08T03:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc phreg: specifying time-varying predictor as class</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-specifying-time-varying-predictor-as-class/m-p/469082#M24413</link>
      <description>&lt;P&gt;but what does the log screen tell you? that will indicate why the output window is empty&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 02:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-specifying-time-varying-predictor-as-class/m-p/469082#M24413</guid>
      <dc:creator>pau13rown</dc:creator>
      <dc:date>2018-06-11T02:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc phreg: specifying time-varying predictor as class</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-specifying-time-varying-predictor-as-class/m-p/469279#M24418</link>
      <description>&lt;P&gt;In addition to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/183379"&gt;@pau13rown&lt;/a&gt;'s suggestion: Are the values for "treatment" numeric or text? They have to be numeric if you want to regress on treatment.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 15:11:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-specifying-time-varying-predictor-as-class/m-p/469279#M24418</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-06-11T15:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc phreg: specifying time-varying predictor as class</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-specifying-time-varying-predictor-as-class/m-p/469825#M24441</link>
      <description>&lt;P&gt;Thank you, sld and PaulBrownPhD!&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&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sld, as you suggested, the problem was with my predictor being coded as a character variable. 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 for 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>Wed, 13 Jun 2018 02:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-phreg-specifying-time-varying-predictor-as-class/m-p/469825#M24441</guid>
      <dc:creator>SarahW13</dc:creator>
      <dc:date>2018-06-13T02:47:52Z</dc:date>
    </item>
  </channel>
</rss>

