<?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 How to get percentages? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52859#M2430</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not feasible to debug your code long distance, but &lt;/P&gt;&lt;P&gt;1) make sure your data are sorted by the BY group var&lt;/P&gt;&lt;P&gt;2) try &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; TABLES sex*tobhrd3;&lt;/P&gt;&lt;P&gt;Do you correctly get the cross tab? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Nov 2011 18:58:18 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2011-11-22T18:58:18Z</dc:date>
    <item>
      <title>How to get percentages?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52853#M2424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this variable tobhrd3 (stands for: How many of you have heard of electronic cigarettes?). I want to find the % and 95% CI of each category&amp;nbsp; (sex, age groups, race, income, education, region, etc) that has heard of electronic cigarettes. How do I do that? Not PROC FREQ or PROC UNIVARIATE. PROC TABULATE?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 17:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52853#M2424</guid>
      <dc:creator>VNS0</dc:creator>
      <dc:date>2011-11-22T17:16:51Z</dc:date>
    </item>
    <item>
      <title>How to get percentages?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52854#M2425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, you can get that from PROC FREQ; -- look&amp;nbsp; at the TABLES option BINOMIAL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 18:00:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52854#M2425</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-11-22T18:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get percentages?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52855#M2426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I might be confused, but can't you use PROC FREQ with a BY statement? Here's what I'm thinking (data for SEX):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;input tobhrd3 sex;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 0&lt;/P&gt;&lt;P&gt;0 0&lt;/P&gt;&lt;P&gt;0 0&lt;/P&gt;&lt;P&gt;0 0&lt;/P&gt;&lt;P&gt;0 0&lt;/P&gt;&lt;P&gt;1 0&lt;/P&gt;&lt;P&gt;0 0&lt;/P&gt;&lt;P&gt;1 1&lt;/P&gt;&lt;P&gt;1 1&lt;/P&gt;&lt;P&gt;1 1&lt;/P&gt;&lt;P&gt;0 1&lt;/P&gt;&lt;P&gt;0 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;value MF 1='Male' 0='Female';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=a;&lt;/P&gt;&lt;P&gt;by sex;&lt;/P&gt;&lt;P&gt;format sex MF.;&lt;/P&gt;&lt;P&gt;tables tobhrd3 / binomial(level=1);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BINOMIAL option is described at &lt;A href="http://support.sas.com/documentation/cdl/en/procstat/63963/HTML/default/viewer.htm#procstat_freq_a0000000563.htm"&gt;http://support.sas.com/documentation/cdl/en/procstat/63963/HTML/default/viewer.htm#procstat_freq_a0000000563.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It can be used only for one-way tables. Is that why you say "not PROC FREQ"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 18:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52855#M2426</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-11-22T18:04:42Z</dc:date>
    </item>
    <item>
      <title>How to get percentages?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52856#M2427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I tried your way but I'm seeing output for just male and not female and 2 observations only. When I ran proc freq for tobhrd3 there are total of 2433 people that heard of electronic cigarettes. Something is not right..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 18:47:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52856#M2427</guid>
      <dc:creator>VNS0</dc:creator>
      <dc:date>2011-11-22T18:47:34Z</dc:date>
    </item>
    <item>
      <title>How to get percentages?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52857#M2428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; What do you get if you run PROC FREQ on the SEX variable? Do you correctly get k males and 2433-k females?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 18:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52857#M2428</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-11-22T18:50:01Z</dc:date>
    </item>
    <item>
      <title>How to get percentages?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52858#M2429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I do proc freq on sex, I find 1971 males and 2079 females.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 18:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52858#M2429</guid>
      <dc:creator>VNS0</dc:creator>
      <dc:date>2011-11-22T18:54:51Z</dc:date>
    </item>
    <item>
      <title>How to get percentages?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52859#M2430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not feasible to debug your code long distance, but &lt;/P&gt;&lt;P&gt;1) make sure your data are sorted by the BY group var&lt;/P&gt;&lt;P&gt;2) try &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; TABLES sex*tobhrd3;&lt;/P&gt;&lt;P&gt;Do you correctly get the cross tab? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 18:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52859#M2430</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-11-22T18:58:18Z</dc:date>
    </item>
    <item>
      <title>How to get percentages?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52860#M2431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it worked. it gave me the correct numbers in the table. how do I get 95% CI?&lt;/P&gt;&lt;P&gt;proc freq data=merged;&lt;/P&gt;&lt;P&gt;tables sex*tobhrd3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 19:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52860#M2431</guid>
      <dc:creator>VNS0</dc:creator>
      <dc:date>2011-11-22T19:05:06Z</dc:date>
    </item>
    <item>
      <title>How to get percentages?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52861#M2432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I already gave you the answer. I don't have any further suggestions.&amp;nbsp; Anybody else?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 19:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52861#M2432</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-11-22T19:07:37Z</dc:date>
    </item>
    <item>
      <title>How to get percentages?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52862#M2433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Calculate the % in a datastep if you're not using the default sas output from binomial as mentioned by Rick. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval"&gt;http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For results similar to Ricks that might be more useful you could consider doing the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods table binomialprop=sample;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=merged;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by sex;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables tobhrd3/binomial(level=1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sample2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sample;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where name1 in ("_BIN_", "L_BIN", "U_BIN");&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=sample2 out=answer;&lt;/P&gt;&lt;P&gt;by sex;&lt;/P&gt;&lt;P&gt;var nvalue1;&lt;/P&gt;&lt;P&gt;id name1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 19:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-get-percentages/m-p/52862#M2433</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2011-11-22T19:53:46Z</dc:date>
    </item>
  </channel>
</rss>

