<?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 Seeking a more efficient way of looking at distribution for multiple character vars w same values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Seeking-a-more-efficient-way-of-looking-at-distribution-for/m-p/595863#M76158</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 3 data files and I want to look at the distribution of a set of variables. This is a set of 15 character variables that exists across all 3 files with the same names and the same set of 20 possible values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To do this by hand, I'd have to run a freq on the set of variables within each of the 3 files and check all 45 distributions by hand.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping there's a more efficient way to approach this, but I'm not sure what it is. The fewer outputs that need to be checked, the better!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 11 Oct 2019 19:56:59 GMT</pubDate>
    <dc:creator>Walternate</dc:creator>
    <dc:date>2019-10-11T19:56:59Z</dc:date>
    <item>
      <title>Seeking a more efficient way of looking at distribution for multiple character vars w same values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Seeking-a-more-efficient-way-of-looking-at-distribution-for/m-p/595863#M76158</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 3 data files and I want to look at the distribution of a set of variables. This is a set of 15 character variables that exists across all 3 files with the same names and the same set of 20 possible values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To do this by hand, I'd have to run a freq on the set of variables within each of the 3 files and check all 45 distributions by hand.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping there's a more efficient way to approach this, but I'm not sure what it is. The fewer outputs that need to be checked, the better!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 19:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Seeking-a-more-efficient-way-of-looking-at-distribution-for/m-p/595863#M76158</guid>
      <dc:creator>Walternate</dc:creator>
      <dc:date>2019-10-11T19:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking a more efficient way of looking at distribution for multiple character vars w same value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Seeking-a-more-efficient-way-of-looking-at-distribution-for/m-p/595865#M76159</link>
      <description>&lt;P&gt;Combine them via a view and then run PROC FREQ on the one table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have /view=have;
set t1 (keep = charVariable) t2 (keep = charVariable) t3 (keep = charVariable) indsname = source;
dsn = source;
run;

proc freq data=have;
table charVariable*dsn;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37814"&gt;@Walternate&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 3 data files and I want to look at the distribution of a set of variables. This is a set of 15 character variables that exists across all 3 files with the same names and the same set of 20 possible values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To do this by hand, I'd have to run a freq on the set of variables within each of the 3 files and check all 45 distributions by hand.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm hoping there's a more efficient way to approach this, but I'm not sure what it is. The fewer outputs that need to be checked, the better!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 19:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Seeking-a-more-efficient-way-of-looking-at-distribution-for/m-p/595865#M76159</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-11T19:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking a more efficient way of looking at distribution for multiple character vars w same value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Seeking-a-more-efficient-way-of-looking-at-distribution-for/m-p/595886#M76169</link>
      <description>&lt;P&gt;Building on &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;'s proposal, I would suggest:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let charVariables=var1 var2 var3 var4; /* Adjust list */

data have /view=have;
set t1 t2 t3 indsname = source;
dsn = source;
run;

proc freq data = have;
by dsn notsorted;
table &amp;amp;charVariables. / out=freqs outpct;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Oct 2019 20:56:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Seeking-a-more-efficient-way-of-looking-at-distribution-for/m-p/595886#M76169</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-10-11T20:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking a more efficient way of looking at distribution for multiple character vars w same value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Seeking-a-more-efficient-way-of-looking-at-distribution-for/m-p/595920#M76173</link>
      <description>&lt;P&gt;It may help to describe the question(s) you have about your distribution(s).&lt;/P&gt;
&lt;P&gt;And about how may records are involved. If you have 20 possible values and only 100 records there probably isn't much to find.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And with the suggested Proc Freq solutions I would likely add a Chisq tables option.&lt;/P&gt;
&lt;P&gt;From &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc freq data = have;
table   dsn *( &amp;amp;charVariables. ) / chisq;
run;&lt;/PRE&gt;
&lt;P&gt;Which will give you statistical test of distribution similarity for each variable compared with the data source.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 23:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Seeking-a-more-efficient-way-of-looking-at-distribution-for/m-p/595920#M76173</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-11T23:17:30Z</dc:date>
    </item>
  </channel>
</rss>

