<?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 BOCF(Best Observation Carry Forward) in Clinical trials in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885950#M350089</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Can anyone help me with an example SAS code of BOCF (Best Observation Carry Forward) in clinical trials? I have tried searching Google and&amp;nbsp;&lt;A href="https://www.lexjansen.com/" target="_blank"&gt;https://www.lexjansen.com/&lt;/A&gt;&amp;nbsp;but except for theoretical explanation,&amp;nbsp; I couldn't find any example code explaining the concept. It will be very helpful, if anyone can explain BOCF with an example code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 22 Jul 2023 17:17:45 GMT</pubDate>
    <dc:creator>Moksha</dc:creator>
    <dc:date>2023-07-22T17:17:45Z</dc:date>
    <item>
      <title>BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885950#M350089</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Can anyone help me with an example SAS code of BOCF (Best Observation Carry Forward) in clinical trials? I have tried searching Google and&amp;nbsp;&lt;A href="https://www.lexjansen.com/" target="_blank"&gt;https://www.lexjansen.com/&lt;/A&gt;&amp;nbsp;but except for theoretical explanation,&amp;nbsp; I couldn't find any example code explaining the concept. It will be very helpful, if anyone can explain BOCF with an example code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 17:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885950#M350089</guid>
      <dc:creator>Moksha</dc:creator>
      <dc:date>2023-07-22T17:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885955#M350093</link>
      <description>&lt;P&gt;Some example data in the form of a data step and the expected results will go a long way. Also a clear definition of what is a "best observation" for your use and based on the example data. "Best" is a value judgement in many cases and does not always have the same values given the concern(s) of interest.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 18:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885955#M350093</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-07-22T18:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885957#M350094</link>
      <description>&lt;P&gt;Best Observation Carry Forward??&lt;BR /&gt;Never heard about that.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":frowning_face:"&gt;☹️&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But ... &lt;STRONG&gt;Last Observation Carry Forward (LOCF)&lt;/STRONG&gt; : that's a very popular method for dealing with missing data in longitudinal data. If you search these SAS Communities for LOCF keyword, you will have numerous hits (and numerous code examples)!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, are you sure BOCF is "Best Observation Carry Forward"? What is "Best"?&lt;BR /&gt;Maybe it is&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;baseline-observation-carried-forward (BOCF)&lt;/STRONG&gt;, ... that approach is one method to&amp;nbsp;&lt;EM&gt;handle missing data from early treatment discontinuation&lt;/EM&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you give a bit more info on what exactly you try to achieve, we may be able to provide better help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 18:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885957#M350094</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-07-22T18:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885959#M350095</link>
      <description>&lt;P&gt;Let's say you data set HAVE is sorted by ID and DATE (BTW, will a date be repeated? that will add complications).&amp;nbsp; And it also has variables RESULT, a,b,c,x,y,z.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And by "best" result you mean the maximum (to date) of variable RESULT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And let's also say you also want to carry forward a subset of the other variables from the observation that has the best result (but renamed to avoid collision with values in the record-in-hand).&amp;nbsp; Say variables X Y and Z.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Untested, in the absence of sample data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data bocf;
  set have ;
  by ID;

  if first.id then call missing(of best_result);

  if result&amp;gt;best_result then set have (keep=result x y z
      rename=(result=best_result x=best_result_x y=best_result_y z=best_result_z))
      point=_n_;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The variable BEST_RESULT is being treated as a retained variable, even though there is no explicit RETAIN statement.&amp;nbsp; This is because, &lt;EM&gt;&lt;STRONG&gt;like all variables read via the SET statement&lt;/STRONG&gt;&lt;/EM&gt;, it is automatically retained.&amp;nbsp; Now most variables read by SET are replaced in every iteration of the DATA step, because the corresponding SET is executed in every iteration (the initial SET HAVE above).&amp;nbsp; But the BEST_RESULT variable, and the other BEST_RESULT_... vars, are read in only occasionally, so are retained until replaced when the "if result&amp;gt;best_result" test is met.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 23:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885959#M350095</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2023-07-22T23:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885985#M350107</link>
      <description>&lt;P&gt;Actually, it is Baseline Observation Carry Forward. As found in Google, it is defined as "&lt;SPAN&gt;The baseline observation carry forward (BOCF) method, in which&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;baseline observations are treated as the final responses from patients without any post-baseline observation or patients who drop out after the first post-baseline treatment&lt;/STRONG&gt;&lt;SPAN&gt;, has been suggested for certain such studies by some regulatory agencies.".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I don't have example data, but want help with this, if anyone can help me with an example of BOCF.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2023 06:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885985#M350107</guid>
      <dc:creator>Moksha</dc:creator>
      <dc:date>2023-07-23T06:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885986#M350108</link>
      <description>&lt;P&gt;Yes, you are right that it is Baseline Observation Carry Forward.&amp;nbsp; Any example code explaining this concept, will be a great help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2023 06:57:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885986#M350108</guid>
      <dc:creator>Moksha</dc:creator>
      <dc:date>2023-07-23T06:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885987#M350109</link>
      <description>&lt;P&gt;Thank you very much for the reply. I will try if I can use this example to BOCF (Baseline Observation Carry Forward).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2023 06:59:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885987#M350109</guid>
      <dc:creator>Moksha</dc:creator>
      <dc:date>2023-07-23T06:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885992#M350113</link>
      <description>&lt;P&gt;It's &lt;EM&gt;&lt;STRONG&gt;baseline&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;(not "best") observation carried forward?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then. if baseline data is always the first obs for each id:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data bocf;
  set have ;
  by ID;

  if first.id then set have (keep=result x y z
      rename=(result=baseline_result x=baseline_x y=baseline_y z=baseline_z))
      point=_n_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2023 11:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885992#M350113</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2023-07-23T11:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885998#M350116</link>
      <description>&lt;P&gt;It is usually BASELINE that is carried forward so that you can do a change from baseline analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the BASELINE reading is always recorded on the same VISIT then a simple MERGE will do and there is no need "carry forward" anything.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  merge have 
        have(keep=id score visit rename=(score=baseline visit=bvisit)
             where =(bvisit=1))
  ;
  by id;
  change = score-baseline;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise if finding the baseline value is more difficult then you will need to carry the baseline value forward by using a retained variable.&amp;nbsp; So if SCORE is always there are you want to use the first value as the BASELINE then something like this is enough.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  by id date ;
  if first.id then baseline=score;
  retain baseline;
  change = score-baseline;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But if score might be missing then you might need something more complicated.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  by id date ;
  if first.id then baseline=.;
  retain baseline;
  baseline=coalesce(baseline,score);
  if n(score,baseline)=2 then change = score-baseline;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Jul 2023 13:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885998#M350116</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-23T13:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885999#M350117</link>
      <description>&lt;P&gt;Thank you. I will try this.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2023 13:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/885999#M350117</guid>
      <dc:creator>Moksha</dc:creator>
      <dc:date>2023-07-23T13:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: BOCF(Best Observation Carry Forward) in Clinical trials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/886000#M350118</link>
      <description>&lt;P&gt;Thank you very much Tom, for a very detailed explanation. I will try all these cases.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2023 13:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BOCF-Best-Observation-Carry-Forward-in-Clinical-trials/m-p/886000#M350118</guid>
      <dc:creator>Moksha</dc:creator>
      <dc:date>2023-07-23T13:58:15Z</dc:date>
    </item>
  </channel>
</rss>

