<?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: Frequencies and percentages in multiple columns with same variable in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329411#M21905</link>
    <description>&lt;P&gt;There is just one line that needs to change:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to plug in the name of your data set here.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2017 13:50:43 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-02-02T13:50:43Z</dc:date>
    <item>
      <title>Frequencies and percentages in multiple columns with same variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329313#M21899</link>
      <description>&lt;P&gt;Hello people&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new with SAS and have just started using Enterprise Guide. I've got a bit stuck with the statistics and I hope you can help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A segment of my sheet looks something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graft_comp1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graft_comp2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graft_comp3&lt;/U&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ascites&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rejection&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hypoalbuminemia&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Hypoalbuminemia&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hypoalbuminemia&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ascites&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ascites&lt;BR /&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rejection&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rejection&lt;BR /&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ascites&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to get the frequencies and percentages of each complication (after surgery) from all the columns. I have tried with this:&lt;/P&gt;&lt;P&gt;proc freq data=komplib.cdmerged;&lt;BR /&gt;tables graft_comp1 graft_comp2 graft_comp3 / nocum ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this way I get the data in tree different tables.&lt;/P&gt;&lt;P&gt;Is there any way I can get the results as a sum of all data in the columns collectively?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Plese helt me. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 07:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329313#M21899</guid>
      <dc:creator>ThomasRDaugaard</dc:creator>
      <dc:date>2017-02-02T07:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Frequencies and percentages in multiple columns with same variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329370#M21901</link>
      <description>&lt;P&gt;Not without jumping through some sort of hoop. &amp;nbsp;The easiest hoop to jump through is probably this one:&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;if graft_comp1 &amp;gt; ' ' then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;complication = graft_comp1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;if graft_comp2 &amp;gt; ' ' then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;complication = graft_comp2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;if graft_comp3 &amp;gt; ' ' then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;complication = graft_comp3;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;output;&lt;/P&gt;
&lt;P&gt;end;&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;&lt;/P&gt;
&lt;P&gt;tables complication / nocum;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a large number of variables, not just 3, you don't have to spell out the logic for all of them. &amp;nbsp;Instead, you could create an array in the DATA step, and process each variable in the array.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 11:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329370#M21901</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-02-02T11:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Frequencies and percentages in multiple columns with same variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329395#M21902</link>
      <description>&lt;P&gt;Thank you very much for your reply.&lt;/P&gt;&lt;P&gt;I will try if I can get it to work.&lt;/P&gt;&lt;P&gt;Should I just copy past your codes or is there any changes I need to make? I am very new with SAS so I might need some very specific directions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 12:24:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329395#M21902</guid>
      <dc:creator>ThomasRDaugaard</dc:creator>
      <dc:date>2017-02-02T12:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Frequencies and percentages in multiple columns with same variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329411#M21905</link>
      <description>&lt;P&gt;There is just one line that needs to change:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to plug in the name of your data set here.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 13:50:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329411#M21905</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-02-02T13:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Frequencies and percentages in multiple columns with same variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329491#M21908</link>
      <description>&lt;P&gt;Another option is to use the Data &amp;gt; Transpose task in EG. Make sure your data is sorted by "id", and then put "id" in the "Group Analysis By" variable and the three "comp" variables in "Transpose Variables". Then you'll just need a quick query to eliminate the blank cells.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 16:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Frequencies-and-percentages-in-multiple-columns-with-same/m-p/329491#M21908</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-02-02T16:08:47Z</dc:date>
    </item>
  </channel>
</rss>

