<?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: Separating categories within a variable in a table in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192718#M10261</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TThat's already your second picture? Or do you need it summarized/aggregated somehow?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Dec 2014 08:57:44 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-12-03T08:57:44Z</dc:date>
    <item>
      <title>Separating categories within a variable in a table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192715#M10258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there a way to separate the sub levels of a variable so that the sub levels are in rows and the variables are as columns.&amp;nbsp; To illustrate what i mean, attached is a picture. First picture is in sas, second picture is what i would like to do in sas.&amp;nbsp; Apologies if this is covered else where, but i have literally searched everywhere without success.&amp;nbsp; I am guessing it is called something else since these seems like a pretty simple/common approach to creating a table.&amp;nbsp; Below is the code. Any guidance would be greatly appreciated!&amp;nbsp; thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="tab.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/8141_tab.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data=scores;&lt;/P&gt;&lt;P&gt;class Q1 Q2;&lt;/P&gt;&lt;P&gt;table N,&lt;/P&gt;&lt;P&gt;Q1 Q2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 04:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192715#M10258</guid>
      <dc:creator>rikhan</dc:creator>
      <dc:date>2014-12-03T04:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Separating categories within a variable in a table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192716#M10259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First picture can't be your data in SAS, that's the report. You need to show what your actual data looks like. &lt;/P&gt;&lt;P&gt;Unless you have them backwards?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The word you're looking for is transpose though:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.ats.ucla.edu/stat/sas/modules/wtol_transpose.htm" title="http://www.ats.ucla.edu/stat/sas/modules/wtol_transpose.htm"&gt;SAS Learning Module: How to reshape data wide to long using proc transpose&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/modules/widetolong_data.htm" title="http://www.ats.ucla.edu/stat/sas/modules/widetolong_data.htm"&gt;SAS Learning Module: Reshaping wide to long using a data step&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 04:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192716#M10259</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-03T04:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Separating categories within a variable in a table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192717#M10260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apologies, yes the data looks like in the picture below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="q.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/8143_q.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 05:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192717#M10260</guid>
      <dc:creator>rikhan</dc:creator>
      <dc:date>2014-12-03T05:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Separating categories within a variable in a table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192718#M10261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TThat's already your second picture? Or do you need it summarized/aggregated somehow?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 08:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192718#M10261</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-03T08:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Separating categories within a variable in a table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192719#M10262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yup exactly, I need the raw data (pic 3) summed like it is in pic 1 and pic 2.&amp;nbsp;&amp;nbsp; the first picture shows the counts for the subcategories within a variable (categorical) from sas, pic 2 is the format i would like it in.&amp;nbsp; So for example, the possible choices for Q1 are 1 - 5.&amp;nbsp; 8 people responded 1, 7 people ressponded 2 etc.&amp;nbsp; So It shows the counts for each choice.&amp;nbsp; The third picture is just the raw data.&amp;nbsp; For now what i do is get counts, export it to excel and create pivot tables to achieve this.&amp;nbsp; But Im wondering if htere is a quicker way to do this. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 15:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192719#M10262</guid>
      <dc:creator>rikhan</dc:creator>
      <dc:date>2014-12-03T15:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Separating categories within a variable in a table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192720#M10263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, but the data you showed only shows a portion of your problem. It would help if you would illustrate the full problem with sample data in the text here so we can use it directly rather than type it out. The general solution will be along the lines of query, with a specific group by clause and then sum or count the values as required. That will create the data set and then you can easily print out that data set using the LIST task&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 19:35:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192720#M10263</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-03T19:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Separating categories within a variable in a table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192721#M10264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are wanting two univariate summaries.&lt;/P&gt;&lt;P&gt;One way is to put all the results into a single variable:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; allscores;&amp;nbsp; * or use proc transpose;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SET scores;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; q='q1'; result=q1; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; q='q2'; result=q2; output;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;tabulate&lt;/STRONG&gt; data=allscores;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class q result;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table result,q ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 22:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Separating-categories-within-a-variable-in-a-table/m-p/192721#M10264</guid>
      <dc:creator>KenDodds</dc:creator>
      <dc:date>2014-12-03T22:10:11Z</dc:date>
    </item>
  </channel>
</rss>

