<?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: Is there a way to get a frequency between 2 variables, where order doesn't matter? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313219#M68026</link>
    <description>&lt;P&gt;&lt;U&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding﻿&lt;/a&gt;&lt;/U&gt;Great minds think alike &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2016 19:30:05 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-11-21T19:30:05Z</dc:date>
    <item>
      <title>Is there a way to get a frequency between 2 variables, where order doesn't matter?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313189#M68010</link>
      <description>&lt;P&gt;Is there a way to get a frequency between 2 variables, where order doesn't matter?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with 2 ratings. Is there an easy way to get a frequency, that combines when R1/R2 is equivalent to R2/R1? This is a very large dataset -- I'm hoping to avoid typing out "IF R1=1 and R2=2 OR R1=2 and R2=1 THEN ID=1", then doing a proc freq statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Rating1 &amp;nbsp; Rating2 &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would be a count of:&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 18:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313189#M68010</guid>
      <dc:creator>NR13</dc:creator>
      <dc:date>2016-11-21T18:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get a frequency between 2 variables, where order doesn't matter?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313200#M68014</link>
      <description>&lt;P&gt;How many values of Rating1 and Rating2 are there? Are one or more of the values missing for either of those variables? If missing how would the "combination" of the two be treated?&lt;/P&gt;
&lt;P&gt;I would be tempted to create a variable combining Rating1 and 2 then custom informat to turn 12 or 21 into a single category. Then I do a count on the formatted value.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313200#M68014</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-21T19:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get a frequency between 2 variables, where order doesn't matter?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313201#M68015</link>
      <description>&lt;P&gt;it's 0-16 for both ratings - no missing values for either.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:12:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313201#M68015</guid>
      <dc:creator>NR13</dc:creator>
      <dc:date>2016-11-21T19:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get a frequency between 2 variables, where order doesn't matter?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313204#M68016</link>
      <description>&lt;P&gt;How many observations do you have?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313204#M68016</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-21T19:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get a frequency between 2 variables, where order doesn't matter?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313205#M68017</link>
      <description>&lt;P&gt;It varies - usually around one thousand&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:20:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313205#M68017</guid>
      <dc:creator>NR13</dc:creator>
      <dc:date>2016-11-21T19:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get a frequency between 2 variables, where order doesn't matter?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313214#M68023</link>
      <description>&lt;P&gt;That's small....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data temp;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;first = min(rating1, rating2);&lt;/P&gt;
&lt;P&gt;second = max(rating1, rating2);&lt;/P&gt;
&lt;P&gt;Run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=temp noprint;&lt;/P&gt;
&lt;P&gt;table first*second/out=want;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313214#M68023</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-21T19:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get a frequency between 2 variables, where order doesn't matter?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313216#M68024</link>
      <description>&lt;P&gt;An easy way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;lower_rating = min(Rating1, Rating2);&lt;/P&gt;
&lt;P&gt;high_rating = max(Rating1, Rating2);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=want;&lt;/P&gt;
&lt;P&gt;tables lower_rating * higher_rating / list;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have missing values, however, this treats the missing rating as if it were the same as the rating that is not missing.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313216#M68024</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-11-21T19:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get a frequency between 2 variables, where order doesn't matter?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313217#M68025</link>
      <description>&lt;P&gt;Thank you all!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313217#M68025</guid>
      <dc:creator>NR13</dc:creator>
      <dc:date>2016-11-21T19:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get a frequency between 2 variables, where order doesn't matter?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313219#M68026</link>
      <description>&lt;P&gt;&lt;U&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding﻿&lt;/a&gt;&lt;/U&gt;Great minds think alike &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313219#M68026</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-21T19:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get a frequency between 2 variables, where order doesn't matter?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313240#M68034</link>
      <description>&lt;P&gt;And to the OP if you ever need to extend this then the function SMALLEST would come into play.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;first&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; = smallest(1,var1,var2,var3,var4);&lt;/P&gt;
&lt;P&gt;second = smallest(2,var1,var2,var3,var4);&lt;/P&gt;
&lt;P&gt;third&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = smallest(3,var1,var2,var3,var4);&lt;/P&gt;
&lt;P&gt;fourth&amp;nbsp;&amp;nbsp;&amp;nbsp; = smallest(4,var1,var2,var3,var4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;though it would likely&amp;nbsp; best to declare a couple of arrays for this.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 20:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-a-frequency-between-2-variables-where/m-p/313240#M68034</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-21T20:30:54Z</dc:date>
    </item>
  </channel>
</rss>

