<?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: Using an array to count allocations in clinical trial in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-an-array-to-count-allocations-in-clinical-trial/m-p/471845#M120891</link>
    <description>&lt;P&gt;And you want to use an array doing this or?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 19:24:32 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-06-20T19:24:32Z</dc:date>
    <item>
      <title>Using an array to count allocations in clinical trial</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-an-array-to-count-allocations-in-clinical-trial/m-p/471841#M120888</link>
      <description>&lt;P&gt;I am working on a clinical trial where I have to count the updated allocation of each treatments. There are 3 treatments(T)(1,2,3) and 3 age factors(J)(1,2,3). The current data set looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Subject&amp;nbsp; &amp;nbsp;T&amp;nbsp; &amp;nbsp; &amp;nbsp;J&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;........................&lt;/P&gt;&lt;P&gt;2310&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If J=1 and T=1 are equal to each other then Z11(variable for allocation) increases by 1&lt;/P&gt;&lt;P&gt;If J=1 and T=2&amp;nbsp; then Z12 count remains the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;if J=1 and T=3&amp;nbsp; then Z13 count remains the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above condition repeats for when J=2 and when J=3. And iterates each time a subject is added into the trial.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So basically Zjt=count+1 if T=J and Zjt=count if T is not equal to Z.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dataset Z should look something like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;Z11 Z12 Z13 Z21 Z22 Z23 Z31 Z32 Z33&lt;/P&gt;&lt;P&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; 7&amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; 15&amp;nbsp; &amp;nbsp;12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote the code below but it does not give me the result I want&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data z;&lt;BR /&gt;set data;&lt;BR /&gt;array a z11-z13;&lt;BR /&gt;do i=1 to dim(a);&lt;BR /&gt;if t=1 and fac1=1 then z11=count+1;&lt;BR /&gt;else if t=2 and fac1=1 then z12=count;&lt;BR /&gt;else if t=3 and fac1=1 then z13=count;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any help at all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 19:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-an-array-to-count-allocations-in-clinical-trial/m-p/471841#M120888</guid>
      <dc:creator>azt5173</dc:creator>
      <dc:date>2018-06-20T19:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using an array to count allocations in clinical trial</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-an-array-to-count-allocations-in-clinical-trial/m-p/471845#M120891</link>
      <description>&lt;P&gt;And you want to use an array doing this or?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 19:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-an-array-to-count-allocations-in-clinical-trial/m-p/471845#M120891</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-06-20T19:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using an array to count allocations in clinical trial</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-an-array-to-count-allocations-in-clinical-trial/m-p/471848#M120892</link>
      <description>&lt;P&gt;Array or anything useful that will help me do this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 19:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-an-array-to-count-allocations-in-clinical-trial/m-p/471848#M120892</guid>
      <dc:creator>azt5173</dc:creator>
      <dc:date>2018-06-20T19:26:43Z</dc:date>
    </item>
  </channel>
</rss>

