<?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: Creating a time-dependent covariate in a Cox proportional hazards model in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458216#M23898</link>
    <description>&lt;P&gt;Thank you very much for looking into it. As suggested, I added "do" in the statement, but unfortunately, I got another error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ERROR: Invalid DO loop control information, either the INITIAL or TO expression is missing or the BY expression is missing,&lt;BR /&gt;zero, or invalid.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will there be another solution?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Apr 2018 18:50:43 GMT</pubDate>
    <dc:creator>ejay0503</dc:creator>
    <dc:date>2018-04-27T18:50:43Z</dc:date>
    <item>
      <title>Creating a time-dependent covariate in a Cox proportional hazards model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458206#M23895</link>
      <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a time-dependent variable in a cox proportional hazard model, using the counting process, which is guided by &lt;A href="http://support.sas.com/resources/papers/proceedings12/168-2012.pdf" target="_self"&gt;http://support.sas.com/resources/papers/proceedings12/168-2012.pdf&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I keep seeing this error message below.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ERROR 161-185: No matching DO/SELECT statement.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;579  data perm.habc_cox10;
580      set perm.habc_cox9;
581
582      array symptotal_(*) symptotal_1 - symptotal_12;
583      array chng (11);
584      t= 1;
585      do i = 2 TO 12;
586          if symptotal_(i) NE symptotal_(i-1) THEN DO; /*NE = not equal to */
587             chng(t) = i-1;
588             t = t+1;
589      end;
590  end;
591  run;

592  data perm.habc_cox11;
593      set perm.habc_cox10;
594
595      array symptotal_(*) symptotal_1 - symptotal_12;
596      array chng (*) chng1 - chng11;
597      start = 0;
598      censor2 = 0;
599      t = 1;
600
601      do i = 1 to time_event;
602
603      if chng(t) &amp;gt;. and (chng(t) &amp;lt; time_event) or i=time_event then;
604
605      if chng(t)&amp;gt;. then burden = symptotal_(chng(t));
606      else burden = symptotal_(time_event);
607
608      stop = min(chng(t), time_event);
609
610      if i = time_event then censor2 = censor;
611
612      if t&amp;gt;1 then start = chng(t-1);
613
614      t = t+1;
615      output;
616      end;
617  end;
     ---
     161
ERROR 161-185: No matching DO/SELECT statement.

618  run;

&lt;/PRE&gt;&lt;P&gt;I would really appreciate your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 18:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458206#M23895</guid>
      <dc:creator>ejay0503</dc:creator>
      <dc:date>2018-04-27T18:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a time-dependent covariate in a Cox proportional hazards model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458212#M23896</link>
      <description>&lt;P&gt;You have two END statement but only one DO statement, so these statements are unmatched. I don't understand your logic, but from your indenting I am going to guess that you meant to say&lt;/P&gt;
&lt;P&gt;if chng(t) &amp;gt;. and (chng(t) &amp;lt; time_event) or i=time_event then &lt;STRONG&gt;do&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 18:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458212#M23896</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-04-27T18:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a time-dependent covariate in a Cox proportional hazards model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458216#M23898</link>
      <description>&lt;P&gt;Thank you very much for looking into it. As suggested, I added "do" in the statement, but unfortunately, I got another error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ERROR: Invalid DO loop control information, either the INITIAL or TO expression is missing or the BY expression is missing,&lt;BR /&gt;zero, or invalid.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will there be another solution?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 18:50:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458216#M23898</guid>
      <dc:creator>ejay0503</dc:creator>
      <dc:date>2018-04-27T18:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a time-dependent covariate in a Cox proportional hazards model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458218#M23899</link>
      <description>&lt;P&gt;You need to include your full code and log again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134564"&gt;@ejay0503&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you very much for looking into it. As suggested, I added "do" in the statement, but unfortunately, I got another error message:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;ERROR: Invalid DO loop control information, either the INITIAL or TO expression is missing or the BY expression is missing,&lt;BR /&gt;zero, or invalid.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will there be another solution?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 19:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458218#M23899</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-27T19:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a time-dependent covariate in a Cox proportional hazards model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458256#M23907</link>
      <description>&lt;P&gt;In this code follow the highlighted comment:&lt;/P&gt;
&lt;PRE&gt;579  data perm.habc_cox10;
580      set perm.habc_cox9;
581
582      array symptotal_(*) symptotal_1 - symptotal_12;
583      array chng (11);
584      t= 1;
585      do i = 2 TO 12;
586          if symptotal_(i) NE symptotal_(i-1) THEN DO; /*NE = not equal to */
587             chng(t) = i-1;
588             t = t+1;
589      end;
590  end; &lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;&amp;lt;= Remove this End for this code&lt;/FONT&gt;&lt;/STRONG&gt;
591  run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This error can occur in a number of ways. You will have to examine your code to see if you are missing a needed DO or other statement that uses End or if a specific End is extra or just in the wrong place.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 20:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/458256#M23907</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-27T20:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a time-dependent covariate in a Cox proportional hazards model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/459731#M23995</link>
      <description>&lt;P&gt;I have tried all the suggestions, but unfortunately, I wasn't able to run the code. Still error messages appear. Still, I really appreciate all the suggestions and help. Thank you very much.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 16:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/459731#M23995</guid>
      <dc:creator>ejay0503</dc:creator>
      <dc:date>2018-05-03T16:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a time-dependent covariate in a Cox proportional hazards model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/459765#M23996</link>
      <description>&lt;P&gt;&amp;nbsp;If you post the log, we can help&amp;nbsp;identify the source of the error. It might be that the indenting in the&amp;nbsp;code is confusing you. If you paste the code into an Enterprise Guide or SAS Studio program, those interfaces can auto-indent your code so that you will see the nesting levels as SAS sees them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In EG,&amp;nbsp;select the entire program (CTRL+A) and then CRTL+I to indent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS Studio,&amp;nbsp;&lt;SPAN&gt;select the entire program (CTRL+A) and then&amp;nbsp;click the "Format Code" icon. I don't seem able to attach an image right now, but it is the second-to-last icon on the right side of the toolbar.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 17:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Creating-a-time-dependent-covariate-in-a-Cox-proportional/m-p/459765#M23996</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-05-03T17:32:12Z</dc:date>
    </item>
  </channel>
</rss>

