<?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: Proc Freq comparing multiple ethnicities in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/410715#M279502</link>
    <description>&lt;P&gt;Did you run the code? It should generate the exact same results except for AggOther, which you could do the same way or this way but still requires multiple values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;German = whichc('31', of ethnicg1-ethnicg3) &amp;gt; 0; 
Swedish = whichc('32', of ethnicg1-ethnicg3) &amp;gt; 0; 
Norwegian = whichc('33', of ethnicg1-ethnicg3) &amp;gt; 0; &lt;BR /&gt;&lt;SPAN&gt;AggOther = a bunch of WHICHC statements or similar IF statements. &lt;/SPAN&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 05 Nov 2017 20:19:56 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-11-05T20:19:56Z</dc:date>
    <item>
      <title>Proc Freq comparing multiple ethnicities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/408914#M279496</link>
      <description>&lt;P&gt;Please help this SAS newbie!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Analysis of the data that I am working with requires finding and comparing the prevalence of certain diseases between different ethnic groups. I thought to make it easier I could just create subsets of ethnic data. So for example, all the German's are now in their own data set, the Swedish are assigned their own data set etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;data primhd.german;&lt;BR /&gt;set primhd.merged;&lt;BR /&gt;if (german=1) then output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using proc freq I am able to look at the prevalence of day heart disease for each individual group.&lt;/P&gt;&lt;P&gt;Is there is a way to create a single frequency table (using proc freq) from these multiple data sets of ethnicity for a said condition?&lt;/P&gt;&lt;P&gt;If not, is there a way to structure my original dataset (with all ethnicities) so that I can carry this out?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 21:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/408914#M279496</guid>
      <dc:creator>senac255</dc:creator>
      <dc:date>2017-10-30T21:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq comparing multiple ethnicities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/408933#M279497</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Is there is a way to create a single frequency table (using proc freq) from these multiple data sets of ethnicity for a said condition?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not easily.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;If not, is there a way to structure my original dataset (with all ethnicities) so that I can carry this out?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, but we would have to understand what your original data structure was in the first place. This would likely be the more efficient solution, rarely is splitting the data set a good idea.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 22:50:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/408933#M279497</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-30T22:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq comparing multiple ethnicities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/409180#M279498</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your example code of "german=1" it appears that you have multiple ethnicity variables. You may be better off to have a single ethnicity variable that has values indicating each different variable (unless your subjects are being analyzed as belonging to multiple ethnicities).&lt;/P&gt;
&lt;P&gt;Then in proc freq use a tables statement like:&lt;/P&gt;
&lt;P&gt;tables ethnicity * disease;&lt;/P&gt;
&lt;P&gt;Possibly with&amp;nbsp; the CHISQ option to see if the distribution differs across ethnicities.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 15:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/409180#M279498</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-31T15:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq comparing multiple ethnicities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/409312#M279499</link>
      <description>&lt;P&gt;Below is an example of the step I made prior to subsetting the data. In this data individuals can identify with up to three ethnicities. I am only interested in a&amp;nbsp;few ethnic groups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&amp;nbsp;primhd.client2;&lt;/P&gt;&lt;P&gt;set primhd.client1;&lt;/P&gt;&lt;P&gt;german=&lt;STRONG&gt;0&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;if ethnicg1='31'&lt;/P&gt;&lt;P&gt;or ethnicg2='31'&lt;/P&gt;&lt;P&gt;or ethnicg3='31' then german=&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;swedish=&lt;STRONG&gt;0&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;if ethnicg1='32'&lt;/P&gt;&lt;P&gt;or ethnicg2='32'&lt;/P&gt;&lt;P&gt;or ethnicg3='32' then swedish=&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;norwegian=&lt;STRONG&gt;0&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;if ethnicg1='33'&lt;/P&gt;&lt;P&gt;or ethnicg2='33'&lt;/P&gt;&lt;P&gt;or ethnicg3='33' then&amp;nbsp;norwegian =&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;aggother=&lt;STRONG&gt;0&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;if ethnicg1='30'&lt;/P&gt;&lt;P&gt;or ethnicg2='30'&lt;/P&gt;&lt;P&gt;or ethnicg3='30'&lt;/P&gt;&lt;P&gt;then aggother =&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;if ethnicg1='34'&lt;/P&gt;&lt;P&gt;or ethnicg2='34'&lt;/P&gt;&lt;P&gt;or ethnicg3='34'&lt;/P&gt;&lt;P&gt;then aggother =&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;if ethnicg1='35'&lt;/P&gt;&lt;P&gt;or ethnicg2='35'&lt;/P&gt;&lt;P&gt;or ethnicg3='35'&lt;/P&gt;&lt;P&gt;then aggother =&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;if ethnicg1='36'&lt;/P&gt;&lt;P&gt;or ethnicg2='36'&lt;/P&gt;&lt;P&gt;or ethnicg3='36'&lt;/P&gt;&lt;P&gt;then aggother =&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;if ethnicg1='37'&lt;/P&gt;&lt;P&gt;or ethnicg2='37'&lt;/P&gt;&lt;P&gt;or ethnicg3='37'&lt;/P&gt;&lt;P&gt;then aggother =&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;run:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not too taken with the resulting output of a bunch of a whole new variables. Other than the boolean expression above what expression could I use to create a single ethnicity variable?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 22:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/409312#M279499</guid>
      <dc:creator>senac255</dc:creator>
      <dc:date>2017-10-31T22:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq comparing multiple ethnicities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/409331#M279500</link>
      <description>How do you want to deal with multiples though? &amp;nbsp;If someone is both Norwegian and German?&amp;nbsp;

German = whichc('31', of ethnicg1-ethnicg3) &amp;gt; 0;
Swedish = whichc('32', of ethnicg1-ethnicg3) &amp;gt; 0;
Norwegian =&amp;nbsp;whichc('33', of ethnicg1-ethnicg3) &amp;gt; 0;

AggOther = a bunch of WHICHC statements or similar IF statements. &amp;nbsp;&amp;nbsp;

PS. This would have been easier if you had numeric variables.&amp;nbsp;</description>
      <pubDate>Wed, 01 Nov 2017 01:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/409331#M279500</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-01T01:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq comparing multiple ethnicities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/410714#M279501</link>
      <description>I was wanting to use a total response grouping method, hence a individual who was both norwegian and spanish would be included in both ethnic groups.</description>
      <pubDate>Sun, 05 Nov 2017 20:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/410714#M279501</guid>
      <dc:creator>senac255</dc:creator>
      <dc:date>2017-11-05T20:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq comparing multiple ethnicities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/410715#M279502</link>
      <description>&lt;P&gt;Did you run the code? It should generate the exact same results except for AggOther, which you could do the same way or this way but still requires multiple values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;German = whichc('31', of ethnicg1-ethnicg3) &amp;gt; 0; 
Swedish = whichc('32', of ethnicg1-ethnicg3) &amp;gt; 0; 
Norwegian = whichc('33', of ethnicg1-ethnicg3) &amp;gt; 0; &lt;BR /&gt;&lt;SPAN&gt;AggOther = a bunch of WHICHC statements or similar IF statements. &lt;/SPAN&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Nov 2017 20:19:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-comparing-multiple-ethnicities/m-p/410715#M279502</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-05T20:19:56Z</dc:date>
    </item>
  </channel>
</rss>

