<?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 Determine the largest and second largest value in proc freq in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284016#M59283</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am searching for a solution to determine and put out the largest and second value in a proc freq analysis. The proc freq look as the follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;proc freq data = Personen (where = (&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;sex = '1' AND&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;type in ('X','Y','Z') ));&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;title 'Sex Types';&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;tables typ * geschlecht&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;/ NOROW NOCOL Nopercent format=commax18.0 out=WORK.sex_type;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Pesonen is a variable like 'tallness', with a numeric tallness value. Now i want to give out the tallest and the second tallest person in the defined group, each in an own column in the table above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you haven idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;T1000&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>Wed, 13 Jul 2016 12:52:48 GMT</pubDate>
    <dc:creator>t1000</dc:creator>
    <dc:date>2016-07-13T12:52:48Z</dc:date>
    <item>
      <title>Determine the largest and second largest value in proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284016#M59283</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am searching for a solution to determine and put out the largest and second value in a proc freq analysis. The proc freq look as the follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;proc freq data = Personen (where = (&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;sex = '1' AND&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;type in ('X','Y','Z') ));&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;title 'Sex Types';&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;tables typ * geschlecht&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;/ NOROW NOCOL Nopercent format=commax18.0 out=WORK.sex_type;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Pesonen is a variable like 'tallness', with a numeric tallness value. Now i want to give out the tallest and the second tallest person in the defined group, each in an own column in the table above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you haven idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;T1000&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>Wed, 13 Jul 2016 12:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284016#M59283</guid>
      <dc:creator>t1000</dc:creator>
      <dc:date>2016-07-13T12:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the largest and second largest value in proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284031#M59285</link>
      <description>&lt;P&gt;See the article &lt;A href="http://blogs.sas.com/content/iml/2013/01/09/create-a-bar-chart-with-only-a-few-categories.html" target="_self"&gt;"Create a bar chart with only a few categories,"&lt;/A&gt;&amp;nbsp;which starts by using PROC FREQ to extract the top categories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The main idea is to use the ORDER=FREQ option to sort the categories and use the OUT= option on the TABLES statement to save the categories to a data set. Here is an example of the top 2 categories of vehicles:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.cars ORDER=FREQ noprint;
  tables make / out=FreqOut;
run;

proc print data=FreqOut(obs=2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jul 2016 13:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284031#M59285</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-07-13T13:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the largest and second largest value in proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284103#M59297</link>
      <description>&lt;P&gt;It might help to show what your output is expected to look like.&lt;/P&gt;
&lt;P&gt;Are you looking for the tallest within each level of Type (or typ) or combination of typ * geschlecht&lt;/P&gt;
&lt;P&gt;or overall in the data set?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 16:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284103#M59297</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-07-13T16:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the largest and second largest value in proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284124#M59301</link>
      <description>&lt;P&gt;I just noticed that you have a 2-way table. Therefore you need to throw in a PROC SORT call to find the two cells that have the largest frequency counts:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=FreqOut;
by Count;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jul 2016 17:14:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284124#M59301</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-07-13T17:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the largest and second largest value in proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284815#M59363</link>
      <description>&lt;P&gt;Thank´s a lot for your replies. As output I am looking for the second tallest observation in the combination of typ* geschlecht. Like the Maximum in proc means, but just the second Maximum (I have just one variable for analysis and one for classification) - I hope that´s the correct translation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to sort in a data step a select the second observation of a variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish you a nice Weekend&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2016 13:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Determine-the-largest-and-second-largest-value-in-proc-freq/m-p/284815#M59363</guid>
      <dc:creator>t1000</dc:creator>
      <dc:date>2016-07-15T13:00:46Z</dc:date>
    </item>
  </channel>
</rss>

