<?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: equivalent of a pivot table in sas in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611492#M18210</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302184"&gt;@sasprogramming&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution provided by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; should have a variable called _freq_ in the output dataset. I think that's what you are looking for .&lt;/P&gt;
&lt;P&gt;You could rename that as count&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;output out=stats (drop=_type_ rename=(_freq_=count)) mean= ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302184"&gt;@sasprogramming&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This works well thanks, but is there anyway to add a column that is the count, i.e. the frequency of ID?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Dec 2019 00:35:13 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-12-13T00:35:13Z</dc:date>
    <item>
      <title>equivalent of a pivot table in sas</title>
      <link>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611481#M18204</link>
      <description>&lt;P&gt;I have the current set of data that looks like this:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Score&lt;/TD&gt;&lt;TD&gt;PB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;0.4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;90&lt;/TD&gt;&lt;TD&gt;0.6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;TD&gt;0.3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;TD&gt;0.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;95&lt;/TD&gt;&lt;TD&gt;0.15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;85&lt;/TD&gt;&lt;TD&gt;0.12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;63&lt;/TD&gt;&lt;TD&gt;0.11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;0.19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;52&lt;/TD&gt;&lt;TD&gt;0.53&lt;/TD&gt;&lt;/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&gt;2&lt;/TD&gt;&lt;TD&gt;0.25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0.23&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I go about doing this in SAS? Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 00:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611481#M18204</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2019-12-13T00:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: equivalent of a pivot table in sas</title>
      <link>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611482#M18205</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
    class score;
    var pb;
    output out=stats mean=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Dec 2019 00:11:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611482#M18205</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-13T00:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: equivalent of a pivot table in sas</title>
      <link>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611483#M18206</link>
      <description>&lt;P&gt;This works well thanks, but is there anyway to add a column that is the count, i.e. the frequency of ID?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 00:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611483#M18206</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2019-12-13T00:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: equivalent of a pivot table in sas</title>
      <link>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611491#M18209</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302184"&gt;@sasprogramming&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This works well thanks, but is there anyway to add a column that is the count, i.e. the frequency of ID?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is wrong with the count it already produces?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 00:34:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611491#M18209</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-12-13T00:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: equivalent of a pivot table in sas</title>
      <link>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611492#M18210</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302184"&gt;@sasprogramming&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution provided by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; should have a variable called _freq_ in the output dataset. I think that's what you are looking for .&lt;/P&gt;
&lt;P&gt;You could rename that as count&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;output out=stats (drop=_type_ rename=(_freq_=count)) mean= ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302184"&gt;@sasprogramming&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This works well thanks, but is there anyway to add a column that is the count, i.e. the frequency of ID?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 00:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611492#M18210</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-13T00:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: equivalent of a pivot table in sas</title>
      <link>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611493#M18211</link>
      <description>&lt;P&gt;Oh I understand now, thank you&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 00:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/equivalent-of-a-pivot-table-in-sas/m-p/611493#M18211</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2019-12-13T00:38:27Z</dc:date>
    </item>
  </channel>
</rss>

