<?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 selecting the largest variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/selecting-the-largest-variable/m-p/30200#M7135</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;libname xx v9 'c:\';
data want;
 set xx.out_2;
 array _y{*} y1-y8;
 max=max(of y1-y8);
 i=whichN(max,of _y{*});
 max_var=vname(_y{i});
 drop max i;
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Oct 2011 06:42:37 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2011-10-18T06:42:37Z</dc:date>
    <item>
      <title>selecting the largest variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/selecting-the-largest-variable/m-p/30197#M7132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SAS experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a series of variables and would like to choose the variable with the largest value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some background:&lt;/P&gt;&lt;P&gt;I have ran a program that classifies the probability of&amp;nbsp; individuals belonging to a specific class(y1-y8). I need to write a code to select the highest probability among these classes. I have attached a sample file with 10,000 examinees and their probability for belonging to each class. How can I select the variable with highest value/probability?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for any help in advance &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 02:00:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/selecting-the-largest-variable/m-p/30197#M7132</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-10-18T02:00:39Z</dc:date>
    </item>
    <item>
      <title>selecting the largest variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/selecting-the-largest-variable/m-p/30198#M7133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not quite sure from your question what type of maximum value you are looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are two possible answers to two possible questions...&lt;/P&gt;&lt;P&gt;find the by row maximum value: the max function. ie. ymax=max(of y1-y8);&lt;/P&gt;&lt;P&gt;find the by column maximum value: one option is proc summary. ie. proc means data=out_2 max; var y1-y8; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 02:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/selecting-the-largest-variable/m-p/30198#M7133</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-10-18T02:58:31Z</dc:date>
    </item>
    <item>
      <title>selecting the largest variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/selecting-the-largest-variable/m-p/30199#M7134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I read your request slightly differently.&amp;nbsp; Would the following provide what you want?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc summary data=out_2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var y1-y8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output out=need (drop=_:) mean=;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=need out=want;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from want&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having col1 eq max(col1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 03:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/selecting-the-largest-variable/m-p/30199#M7134</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-18T03:40:54Z</dc:date>
    </item>
    <item>
      <title>selecting the largest variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/selecting-the-largest-variable/m-p/30200#M7135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;libname xx v9 'c:\';
data want;
 set xx.out_2;
 array _y{*} y1-y8;
 max=max(of y1-y8);
 i=whichN(max,of _y{*});
 max_var=vname(_y{i});
 drop max i;
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 06:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/selecting-the-largest-variable/m-p/30200#M7135</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-10-18T06:42:37Z</dc:date>
    </item>
  </channel>
</rss>

