<?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: How to retain crosstab table percentages in output dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928506#M365306</link>
    <description>&lt;P&gt;I think you should provide example of what exactly is "not correct" and what you expect the result to be.&lt;/P&gt;
&lt;P&gt;By default the OUT= only provides the PERCENT, not the row and column percentages. If you want those using the OUT= option then you need the OUTPCT option to add them the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc freq data=work.test;

table x*y / nopercent nocol outpct out=work.test_freq;
run;&lt;/PRE&gt;</description>
    <pubDate>Wed, 15 May 2024 16:44:15 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-05-15T16:44:15Z</dc:date>
    <item>
      <title>How to retain crosstab table percentages in output dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928501#M365303</link>
      <description>&lt;P&gt;I'm outputting the frequency counts and %s from a crosstab table to a data set (out=test_freq in example code below).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The conditional percentages by x values are correct in the SAS Results tab, however the %s in the test_freq output dataset are not correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is my syntax incorrect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input x $ y $;
cards;
Alice blue
Alice blue
Alice blue
Alice green
Alice green
Alice red
Bob blue
Bob green
Bob green
Bob green
Bob red
Bob red
Bob red
Bob red
;
run;&lt;BR /&gt;
proc freq data=test;
table x*y / nopercent nocol out=test_freq;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 May 2024 16:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928501#M365303</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2024-05-15T16:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to retain crosstab table percentages in output dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928504#M365305</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/408179"&gt;@RobertWF1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The conditional percentages by x values are correct in the SAS Results tab, however the %s in the test_freq output dataset are not correct.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Never say something is incorrect without explanation.&amp;nbsp; We don't know what you expect. What is not correct about the percents?&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 16:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928504#M365305</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-05-15T16:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to retain crosstab table percentages in output dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928506#M365306</link>
      <description>&lt;P&gt;I think you should provide example of what exactly is "not correct" and what you expect the result to be.&lt;/P&gt;
&lt;P&gt;By default the OUT= only provides the PERCENT, not the row and column percentages. If you want those using the OUT= option then you need the OUTPCT option to add them the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc freq data=work.test;

table x*y / nopercent nocol outpct out=work.test_freq;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 May 2024 16:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928506#M365306</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-15T16:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to retain crosstab table percentages in output dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928519#M365312</link>
      <description>The row percents in the crosstab output don't match the table %s in the output dataset.</description>
      <pubDate>Wed, 15 May 2024 17:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928519#M365312</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2024-05-15T17:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to retain crosstab table percentages in output dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928520#M365313</link>
      <description>The OUTPCT option is what I'm looking for, thank you!</description>
      <pubDate>Wed, 15 May 2024 17:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retain-crosstab-table-percentages-in-output-dataset/m-p/928520#M365313</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2024-05-15T17:32:13Z</dc:date>
    </item>
  </channel>
</rss>

