<?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 Proc tabulate with percent that do not add up to 100%? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158172#M41372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 21 variables named HS04A --&amp;gt; HS04U with possible values 1,2,8 and 9. I need to find out for every variable how many times the value 1 occurs and make a percentage out of it (divided by all observations). Basically the variables are diseases and value 1 means disease is present for that record (a person). I need to find out for every disease in how many percent out of all the people it occurs. Then I need to output a table where the 21 variables are rows and the one column is the percentage. I include also image of the layout of desired output. Is it possible to make something like that with proc tabulate? Or should I rather find out how to do it with proc sql? Thanks in advance for any advice &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="output9.jpg" class="jive-image" src="https://communities.sas.com/legacyfs/online/9092_output9.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 08 Feb 2015 14:35:39 GMT</pubDate>
    <dc:creator>gabon</dc:creator>
    <dc:date>2015-02-08T14:35:39Z</dc:date>
    <item>
      <title>Proc tabulate with percent that do not add up to 100%?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158172#M41372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 21 variables named HS04A --&amp;gt; HS04U with possible values 1,2,8 and 9. I need to find out for every variable how many times the value 1 occurs and make a percentage out of it (divided by all observations). Basically the variables are diseases and value 1 means disease is present for that record (a person). I need to find out for every disease in how many percent out of all the people it occurs. Then I need to output a table where the 21 variables are rows and the one column is the percentage. I include also image of the layout of desired output. Is it possible to make something like that with proc tabulate? Or should I rather find out how to do it with proc sql? Thanks in advance for any advice &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="output9.jpg" class="jive-image" src="https://communities.sas.com/legacyfs/online/9092_output9.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2015 14:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158172#M41372</guid>
      <dc:creator>gabon</dc:creator>
      <dc:date>2015-02-08T14:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate with percent that do not add up to 100%?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158173#M41373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you have values from a survey with the question coded as 1=YES 2=NO with 8 and 9 some type of missing categories.&lt;/P&gt;&lt;P&gt;If you recode it into a a nice BINARY variable then the MEAN is the PERCENTAGE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2015 15:04:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158173#M41373</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-02-08T15:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate with percent that do not add up to 100%?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158174#M41374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Tom, thanks a lot for the idea, tried it and it worked. I did some primitive recoding, not sure if it's effective, instead of 1 I put 100 so the percentage is in format for example 3,1 instead of 0,031 and then executed proc means.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data work.subset6a;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set library.database;&lt;/P&gt;&lt;P&gt;&amp;nbsp; keep pid HS04A--HS06U WGT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if HS04A^=1 then HS04A=0; else if HS04a=1 then HS04A=100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if HS04B^=1 then HS04B=0; else if HS04b=1 then HS04b=100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if HS04C^=1 then HS04C=0; else if HS04c=1 then HS04c=100;&lt;/P&gt;&lt;P&gt;....etc.&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=work.subset6a mean maxdec=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var HS04A--HS04U;&lt;/P&gt;&lt;P&gt;&amp;nbsp; freq WGT;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the output looked like this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="output11.jpg" class="jive-image" src="https://communities.sas.com/legacyfs/online/9094_output11.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2015 19:35:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158174#M41374</guid>
      <dc:creator>gabon</dc:creator>
      <dc:date>2015-02-08T19:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate with percent that do not add up to 100%?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158175#M41375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To expand on Tom's response,with a binary 0/1 coding you can use:&lt;/P&gt;&lt;P&gt;var*mean*f=percent8.1 (for example to get a percent) or if you don't want % signs then use a custom picture format.&lt;/P&gt;&lt;P&gt;The added advantages of this coding (besides use in logistic regression)&lt;/P&gt;&lt;P&gt;Sum= will give you the total Yes answers&lt;/P&gt;&lt;P&gt;N= gives you the number of responses&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 16:43:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158175#M41375</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-02-09T16:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate with percent that do not add up to 100%?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158176#M41376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, at first I tried to recode the data with hundreds and zeros to get my mean correct, but after your advice that formatting can help, I found proc template for proc means and changed format for mean to percent and it worked, so I can have my data recoded to ones and zeros. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 21:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-with-percent-that-do-not-add-up-to-100/m-p/158176#M41376</guid>
      <dc:creator>gabon</dc:creator>
      <dc:date>2015-02-09T21:13:44Z</dc:date>
    </item>
  </channel>
</rss>

