<?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: Generating SE with Proc Freq in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479627#M71490</link>
    <description>&lt;P&gt;I have tried the following statements:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data = merged12 STDERR;&lt;BR /&gt;tables ATTOBEVR;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data = merged12;&lt;BR /&gt;tables ATTOBEVR / cl; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc freq data = merged12;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tables ATTOBEVR / std; run;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jul 2018 18:19:26 GMT</pubDate>
    <dc:creator>kgrover</dc:creator>
    <dc:date>2018-07-19T18:19:26Z</dc:date>
    <item>
      <title>Generating SE with Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479597#M71477</link>
      <description>&lt;P&gt;I am trying to get Standard error for percentage for different levels of categorical variables (such as race) by using proc freq.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've had no difficulty getting that with proc means but nothing seems to be working with Proc Freq.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kiran&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:34:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479597#M71477</guid>
      <dc:creator>kgrover</dc:creator>
      <dc:date>2018-07-19T17:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Generating SE with Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479602#M71480</link>
      <description>&lt;P&gt;The standard error of a percentage is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sqrt (p * (1 - p) / n)&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:40:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479602#M71480</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-19T17:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Generating SE with Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479624#M71489</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I've had no difficulty getting that with proc means but nothing seems to be working with Proc Freq.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;What did you try?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:15:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479624#M71489</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-19T18:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Generating SE with Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479627#M71490</link>
      <description>&lt;P&gt;I have tried the following statements:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data = merged12 STDERR;&lt;BR /&gt;tables ATTOBEVR;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data = merged12;&lt;BR /&gt;tables ATTOBEVR / cl; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc freq data = merged12;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tables ATTOBEVR / std; run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479627#M71490</guid>
      <dc:creator>kgrover</dc:creator>
      <dc:date>2018-07-19T18:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Generating SE with Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479631#M71491</link>
      <description>&lt;P&gt;There is no STD option in PROC FREQ. The CL option does not apply to percentage. The formula I posted earlier provides the proper way to get standard errors of percentages.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479631#M71491</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-19T18:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Generating SE with Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479640#M71492</link>
      <description>&lt;P&gt;I'm beyond my depth here, statistically speaking.&amp;nbsp; But syntax-wise, I know that &lt;A href="http://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.3&amp;amp;docsetTarget=statug_surveyfreq_gettingstarted.htm&amp;amp;locale=en" target="_self"&gt;PROC SURVEYFREQ calculates Standard Error of Percentage&lt;/A&gt; out of the box:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyfreq data=sashelp.class;
 tables age ; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="surveyfreq.png" style="width: 268px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21864i7619B56041E9C739/image-size/large?v=v2&amp;amp;px=999" role="button" title="surveyfreq.png" alt="surveyfreq.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479640#M71492</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-07-19T18:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Generating SE with Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479643#M71493</link>
      <description>&lt;P&gt;I don't think those are the same thing, because those take into account the survey design somehow. At least, they don't match the calculations of the formula for standard error of a percent in the non-survey case.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479643#M71493</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-19T18:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Generating SE with Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479680#M71494</link>
      <description>&lt;P&gt;So it's a one way table. So you can calculate the percentages and the CI for them using the BINOMIAL option. Not sure how this works with more than two levels so make sure you test it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.class ;
table sex / binomial (level='F'); *specifies Cl and boundaries for F;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since this is one level at a time it's definitely easier to do the hand calculations shown by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*This program calculates binomial percentages and confidence limits.
Howver, this has no correction methodology so the lower bound can go below 0.
In this case a different method is needed*/


*set table name to summarize;
%let dsin=sashelp.class;
*set variable name to get percentages;
%let var = sex;
*set name of output data set;
%let dsout = Want;


*get counts of each by group and the total count;
proc sql noprint;
create table _freq as
select &amp;amp;var., count(*) as N
from &amp;amp;dsin
group by &amp;amp;var.;
select count(*) into :Ntotal from &amp;amp;dsin.;
quit;

*calculate percentages and upper/lower confidence limits;
data &amp;amp;dsout.;
set _freq;

Ntotal=&amp;amp;ntotal.;
PCT = n/Ntotal;

STD = ((PCT*(1-PCT))/NTotal)**(1/2);

UL = PCT + 1.96*STD;
LL = PCT - 1.96*STD;

run;

*remove temporary tables;
proc sql noprint;
drop table _freq;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Jul 2018 20:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/479680#M71494</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-19T20:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Generating SE with Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/480135#M71528</link>
      <description>&lt;P&gt;This might be more information than you want, but&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;previously &lt;A href="https://communities.sas.com/t5/SAS-Statistical-Procedures/95-CI-for-Categorical-Variables/td-p/245713" target="_self"&gt;wrote an excellent answer to a related question&lt;/A&gt; and provided a program that computes standard errors of multinomial proportions and shows how to get the proportions, std errs, and CIs from PROC FREQ (and from a simulation). I wrote&amp;nbsp;a&amp;nbsp; blog post on estimating&amp;nbsp;simultaneous multinomial proportions and used the computations to &lt;A href="https://blogs.sas.com/content/iml/2017/02/20/proportion-of-colors-mandms.html" target="_self"&gt;estimate the proportion of colors in plain M&amp;amp;M candies.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 13:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-SE-with-Proc-Freq/m-p/480135#M71528</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-21T13:04:34Z</dc:date>
    </item>
  </channel>
</rss>

