<?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 Freq &amp;quot;if&amp;quot; command in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312146#M270734</link>
    <description>&lt;P&gt;Am I able to use an "if" command while generating a two-way table using proc freq? Say for example I have information on treatment versus control and gender, that is, male vs female and want to find out the proportion of males in treatment and the proportion of males in control. Is there a way to set my table statement to something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tables treatment * sex (if sex=1);&lt;/P&gt;</description>
    <pubDate>Wed, 16 Nov 2016 22:37:32 GMT</pubDate>
    <dc:creator>amajeau</dc:creator>
    <dc:date>2016-11-16T22:37:32Z</dc:date>
    <item>
      <title>Proc Freq "if" command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312146#M270734</link>
      <description>&lt;P&gt;Am I able to use an "if" command while generating a two-way table using proc freq? Say for example I have information on treatment versus control and gender, that is, male vs female and want to find out the proportion of males in treatment and the proportion of males in control. Is there a way to set my table statement to something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tables treatment * sex (if sex=1);&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 22:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312146#M270734</guid>
      <dc:creator>amajeau</dc:creator>
      <dc:date>2016-11-16T22:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq "if" command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312147#M270735</link>
      <description>&lt;P&gt;WHERE not if, but it applies to the whole proc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=sashelp.class;&lt;/P&gt;
&lt;P&gt;table age*sex;&lt;/P&gt;
&lt;P&gt;where sex='F';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use a BY statement or just look at the column&amp;nbsp;percents/totals in the PROC FREQ output. There are summaries for the overall table, for each row and column in the default output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=sashelp.class out=class;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;by sex;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=class;&lt;/P&gt;
&lt;P&gt;by sex;&lt;/P&gt;
&lt;P&gt;table age*sex;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 22:40:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312147#M270735</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-16T22:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq "if" command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312149#M270736</link>
      <description>&lt;P&gt;Is this no longer applicable when using proc surveyfreq instead of just proc freq?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 22:48:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312149#M270736</guid>
      <dc:creator>amajeau</dc:creator>
      <dc:date>2016-11-16T22:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq "if" command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312152#M270737</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114032"&gt;@amajeau&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Is&lt;FONT color="#FF0000"&gt; &lt;STRONG&gt;this&lt;/STRONG&gt;&lt;/FONT&gt; no longer applicable when using proc surveyfreq instead of just proc freq?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What's this? Your question said proc freq..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 22:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312152#M270737</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-16T22:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq "if" command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312154#M270738</link>
      <description>&lt;P&gt;With surveyfreq if you use the where clause you remove some information and really wouldn't want to have a table statement with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tables age*sex.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are perhaps looking to do domain analysis of age? You may want to look at SURVEYMEANS and use a Domain Sex statement.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 23:03:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-quot-if-quot-command/m-p/312154#M270738</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-16T23:03:40Z</dc:date>
    </item>
  </channel>
</rss>

