<?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: Finding the Tmax in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412793#M100970</link>
    <description>&lt;P&gt;One of your collegues already asked&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Help-with-maximum-and-array/td-p/412594" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Help-with-maximum-and-array/td-p/412594&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Nov 2017 04:39:12 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2017-11-13T04:39:12Z</dc:date>
    <item>
      <title>Finding the Tmax in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412731#M100943</link>
      <description>&lt;P&gt;I have a project and I have done every step but I cannot figure out this step....&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For each patient, compute the following: MEAN of the concentration values and MINIMUM of the concentration values.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The professor stated that...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;max&lt;SPAN&gt;&amp;nbsp;is&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;U&gt;not&lt;/U&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;simply the maximum time value. It is the “&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;time value&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;” at which the “&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;maximum drug concentration value&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;” occurs for each person.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This was his feed back to me...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Once you find the CMAX, you are going to use the two arrays: As an example, you would need a statement such as the following with DO and END statements if c{i} = cmax then tmax = t{i}; Hope this helps. I cannot give you anymore hint on this. Prof. Rajaram&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;HELP!! I have been working on this all week, put multiple hours in to it, contacted the professor, went to a tutor and cannot figure it out. Now it is due tonight... and I have run out of options.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro one (v1,v2);&lt;BR /&gt;proc import out = &amp;amp;v1&lt;BR /&gt;datafile = "\\Client\C$\Users\brian\Desktop\data\&amp;amp;v2"&lt;BR /&gt;DBMS = xlsx replace;&lt;BR /&gt;getnames = YES;&lt;BR /&gt;run;&lt;BR /&gt;proc print data= &amp;amp;v1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend one;&lt;BR /&gt;%one (Project2, Project2_f17);&lt;/P&gt;&lt;P&gt;proc transpose data= Project2 out=new prefix= T;&lt;BR /&gt;by subject;&lt;/P&gt;&lt;P&gt;var time;&lt;BR /&gt;run;&lt;BR /&gt;proc transpose data= Project2 out=new2 prefix= C;&lt;BR /&gt;by subject;&lt;BR /&gt;&lt;BR /&gt;var concentration;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data Project2New;&lt;BR /&gt;merge new (drop= _name_ _label_) new2 (drop= _name_ _label_);&lt;BR /&gt;by subject;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data= Project2New;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data max_C;&lt;BR /&gt;set project2new;&lt;BR /&gt;array x[*] c1-c13;&lt;BR /&gt;CmaxValue = max(of x[*]);&lt;BR /&gt;run;&lt;BR /&gt;data max_T;&lt;BR /&gt;set project2new;&lt;BR /&gt;array y[*] t1-t13;&lt;BR /&gt;Do i= 1 to 13;&lt;BR /&gt;if c{i}=cmax then tmax={i};&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc print data=max_C;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=max_T;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc means data= project2;&lt;BR /&gt;var concentration;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only need help with the mentioned part.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Nov 2017 21:18:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412731#M100943</guid>
      <dc:creator>briannagowin1</dc:creator>
      <dc:date>2017-11-12T21:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the Tmax in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412757#M100948</link>
      <description>&lt;P&gt;Replace the next two steps in your code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data max_C;
set project2new;
array x[*] c1-c13;
CmaxValue = max(of x[*]);
run;
data max_T;
set project2new;
array y[*] t1-t13;
Do i= 1 to 13;
if c{i}=cmax then tmax={i};
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with the next step code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set project2new;
     array x[*] c1-c13;
     array y[*] t1-t13;
     Cmax  = max(of x[*]);

    Do i= 1 to 13;
       if x{i} = cmax then tmax = y{i};
    end;
run;
&lt;BR /&gt;proc print data=want; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Nov 2017 00:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412757#M100948</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-11-13T00:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the Tmax in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412764#M100951</link>
      <description>&lt;P&gt;What happens if there are multiple values of the maximum?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 00:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412764#M100951</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-13T00:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the Tmax in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412779#M100960</link>
      <description>&lt;P&gt;Maybe his?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data MAX_C;
  set PROJECT2NEW;
  array C[*] C1-C13;
  array T[*] T1-T13;
  CMAX = max(of C[*]);
  do I= 1 to 13;
    if C[I]=CMAX then TMAX=T[I];
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Nov 2017 01:12:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412779#M100960</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-11-13T01:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the Tmax in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412793#M100970</link>
      <description>&lt;P&gt;One of your collegues already asked&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Help-with-maximum-and-array/td-p/412594" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Help-with-maximum-and-array/td-p/412594&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 04:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-Tmax-in-SAS/m-p/412793#M100970</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-11-13T04:39:12Z</dc:date>
    </item>
  </channel>
</rss>

