<?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 which variables have the 5 highest values in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/488979#M15249</link>
    <description>&lt;P&gt;It depends on your data structure.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you show a sample of what you have and what you expect as output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Aug 2018 16:54:49 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-08-22T16:54:49Z</dc:date>
    <item>
      <title>finding which variables have the 5 highest values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/488975#M15247</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with 16 variables where subjects rate their symptoms (values from 0 to 10).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, for each subject, I need to use SAS code to identify&amp;nbsp;the 5 variables where they rated their symptoms the highest.&amp;nbsp; I need to perform a calculation for each subject using those 5 variables only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate any help that you can provide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 16:50:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/488975#M15247</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2018-08-22T16:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: finding which variables have the 5 highest values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/488978#M15248</link>
      <description>&lt;P&gt;First of all, provide some example data to get a usable code answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Secondly, what do you mean by &lt;STRONG&gt;"&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;where they rated their symptoms the highest"&lt;/STRONG&gt;? Does highest mean the sum of the entire variable or?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 16:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/488978#M15248</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-22T16:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: finding which variables have the 5 highest values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/488979#M15249</link>
      <description>&lt;P&gt;It depends on your data structure.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you show a sample of what you have and what you expect as output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 16:54:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/488979#M15249</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-22T16:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: finding which variables have the 5 highest values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/488982#M15250</link>
      <description>&lt;P&gt;This is really going to need some example starting data, fake is fine as long as it is representative of what you have, &lt;STRONG&gt;and&lt;/STRONG&gt; what you expect the result to look like afterward.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What KIND of calculation do you mean to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code will take the 5 largest values from 16 variables v1-v16 (since you provided no variable names replace with your variables) and place them from largest to smallest in variables L1-L5;&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   array v v1-v16;
   array l{5};
   do i=1 to dim(l);
      l[i] = largest(i,of v(*));
   end;
run;&lt;/PRE&gt;
&lt;P&gt;If you need to know which variable contributed which value you need to provide more information on what you are doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 17:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/488982#M15250</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-22T17:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: finding which variables have the 5 highest values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/489009#M15252</link>
      <description>&lt;P&gt;If you need the variables that instead of the values, then i suggest transpose the dataset and sort descending and take the first 5 values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test ;
input val1-val10;
datalines;
1 2 3 4 5 6 7 8 9 10
;
run;
proc transpose data=test out=tr ;
run;

proc sort  data=tr;
by descending col1;
run;
data var_max;
set tr;
if _n_&amp;lt;=5;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please provide more information to&amp;nbsp; be more specific;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 19:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/489009#M15252</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-08-22T19:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: finding which variables have the 5 highest values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/489313#M15258</link>
      <description>The subject enter a number from 0 to 10 for each variable.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Of the 16 variables for symptoms, for each subject I need SAS to determine which of the 5 variables had the highest ratings (i.e., 10 or closest to 10). I need to do calculations on the 5 highest values for each subject.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Aug 2018 15:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/489313#M15258</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2018-08-23T15:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: finding which variables have the 5 highest values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/489318#M15259</link>
      <description>This the 5 highest values, which I can then do the calculation on!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Aug 2018 15:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/489318#M15259</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2018-08-23T15:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: finding which variables have the 5 highest values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/562832#M17259</link>
      <description>&lt;P&gt;What kind of calculation would you do on &amp;nbsp;ordinal variables?&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 13:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/562832#M17259</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2019-05-31T13:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: finding which variables have the 5 highest values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/562896#M17262</link>
      <description>Means, Medians and Modes are common for likert data.</description>
      <pubDate>Fri, 31 May 2019 16:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/finding-which-variables-have-the-5-highest-values/m-p/562896#M17262</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-31T16:12:33Z</dc:date>
    </item>
  </channel>
</rss>

