<?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: Data question in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547783#M8435</link>
    <description>&lt;P&gt;Then you are going to have to get a different solution. The LARGEST() function just returns the values. Not where it came from.&lt;/P&gt;
&lt;P&gt;Why not transpose the columns into rows to make it easier?&lt;/P&gt;</description>
    <pubDate>Tue, 02 Apr 2019 01:03:55 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-04-02T01:03:55Z</dc:date>
    <item>
      <title>Data question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547721#M8423</link>
      <description>&lt;P&gt;I used code like this (see below) to pull the highest 5 scores out of a list of variables, and then I calculated the mean of the 5 highest scores.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;array v{*} sd_1wk_1c sd_1wk_2c sd_1wk_3c sd_1wk_4c sd_1wk_5c sd_1wk_6c sd_1wk_7c sd_1wk_8c sd_1wk_9c sd_1wk_10c&lt;BR /&gt;&amp;nbsp;sd_1wk_11c sd_1wk_12c sd_1wk_13c sd_1wk_14c sd_1wk_15c sd_1wk_16c;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;array l{5};&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;do i=1 to dim(l);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;l[i] = largest(i,of v(*));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;end;&lt;BR /&gt;&amp;nbsp;mdasisdhigh5_1wk=mean(of l1,l2,l3,l4,l5);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;You can see the attachment to see what the resulting data look like.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Now I need to pull which 5 variables supplied the 5 highest values.&amp;nbsp; That will tell me which of the 16 symptoms were the highest for each subject.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;How would I do that?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Thanks!&lt;/FONT&gt;&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;</description>
      <pubDate>Mon, 01 Apr 2019 20:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547721#M8423</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2019-04-01T20:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Data question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547729#M8424</link>
      <description>&lt;P&gt;How do you want the five contributing variables to be presented? As names in other variables or?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 20:19:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547729#M8424</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-04-01T20:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Data question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547733#M8425</link>
      <description>&lt;P&gt;Names of the variables would be okay, but variable labels would be even better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 20:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547733#M8425</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2019-04-01T20:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Data question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547736#M8426</link>
      <description>Look at the VNAME and VINFO functions.</description>
      <pubDate>Mon, 01 Apr 2019 20:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547736#M8426</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-04-01T20:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Data question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547783#M8435</link>
      <description>&lt;P&gt;Then you are going to have to get a different solution. The LARGEST() function just returns the values. Not where it came from.&lt;/P&gt;
&lt;P&gt;Why not transpose the columns into rows to make it easier?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 01:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547783#M8435</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-04-02T01:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Data question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547814#M8442</link>
      <description>&lt;P&gt;Do something like this and work from there. Makes the whole thing much easier &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have(drop=i);
   array v{*} sd_1wk_1c sd_1wk_2c sd_1wk_3c sd_1wk_4c sd_1wk_5c sd_1wk_6c sd_1wk_7c sd_1wk_8c sd_1wk_9c sd_1wk_10c
    sd_1wk_11c sd_1wk_12c sd_1wk_13c sd_1wk_14c sd_1wk_15c sd_1wk_16c;

   do _N_=1 to 10;
      do i=1 to dim(v);
         v[i]=rand('integer', 1, 10);
      end;
      output;
   end;
run;

data long(keep=n idx score var);
   set have;
   array v{*} sd_1wk:;
   n+1;
   do idx=1 to dim(v);
      score=v[idx];
      var=vname(v[idx]);
      output;
   end;
run;

proc sort data=long;
   by n descending score;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Apr 2019 07:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547814#M8442</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-04-02T07:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Data question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547943#M8460</link>
      <description>&lt;P&gt;That helped.&amp;nbsp; I was able to figure it out.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 16:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-question/m-p/547943#M8460</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2019-04-02T16:09:19Z</dc:date>
    </item>
  </channel>
</rss>

