<?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 a frequency table with classes listed are columns and variables listed as rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/494266#M130216</link>
    <description>&lt;P&gt;Hi. I still need a solution to this problem. Below is a SAS program that can be used to read in the Excel data. Again, I am looking for a fast way to generate a frequency distribution table formatted for publication, per the example I gave previously.&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;Cristian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let Path = C:\Users\PGugiu\Desktop; /* You will need to update this with the location of where you saved the Excel file */&lt;BR /&gt;%let File = mini;&lt;BR /&gt;%let Sheet= data;&lt;BR /&gt;%let Name = mini ;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.&amp;amp;Name&lt;BR /&gt;DATAFILE= "&amp;amp;Path\&amp;amp;File..xlsx"&lt;BR /&gt;DBMS=EXCELCS REPLACE;&lt;BR /&gt;SHEET="&amp;amp;Sheet";&lt;BR /&gt;SCANTEXT=YES;&lt;BR /&gt;USEDATE=YES;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Sep 2018 19:00:00 GMT</pubDate>
    <dc:creator>PCG</dc:creator>
    <dc:date>2018-09-10T19:00:00Z</dc:date>
    <item>
      <title>Generating a frequency table with classes listed are columns and variables listed as rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/485528#M126158</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have survey data that I would like to summarize. PROC FREQ does an okay job but it does not format the data they way I want it to look. For example, here is how the data produced by PROC FREQ looks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;Cumulative Cumulative&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;B1C Frequency Percent Frequency Percent&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;1 539 27.56 539 27.56&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;2 539 27.56 1078 55.11&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;3 549 28.07 1627 83.18&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;4 329 16.82 1956 100.00&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;Frequency Missing = 1631&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;Cumulative Cumulative&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;B2C Frequency Percent Frequency Percent&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;1 397 34.70 397 34.70&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;2 350 30.59 747 65.30&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;3 267 23.34 1014 88.64&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;4 130 11.36 1144 100.00&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;Frequency Missing = 2443&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;Cumulative Cumulative&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;B3C Frequency Percent Frequency Percent&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;1 80 33.61 80 33.61&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;2 67 28.15 147 61.76&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;3 69 28.99 216 90.76&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;4 22 9.24 238 100.00&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;Frequency Missing = 3349&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;But, I want it to look like...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Item stem&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Every/Almost every day (4)&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Few times&lt;BR /&gt;/week (3)&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Once or a few times&lt;BR /&gt;/month (2)&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Less than once/month (1)&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Never (0)&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;B1C&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;[Mom] shouted, yelled, screamed, swore or cursed at you?&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;%&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;#129;%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;#128;%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;B2C&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;[Dad] shouted, yelled, screamed, swore or cursed at you?&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;#129;%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;#128;%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;B3C&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;[Partner] shouted, yelled, screamed, swore or cursed at you?&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;%&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;#129;%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;#128;%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where the cells are just the percentages. Is there a way to produce this? I don't necessarily need the labels since I was just planning on cutting-and-pasting the values into Excel.&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;Cristian&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 17:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/485528#M126158</guid>
      <dc:creator>PCG</dc:creator>
      <dc:date>2018-08-09T17:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a frequency table with classes listed are columns and variables listed as rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/485534#M126160</link>
      <description>&lt;P&gt;This will likely involve a restructure of data in some form.&lt;/P&gt;
&lt;P&gt;If you could provide a small example of data as a data step you might get better help. The example should probably have 3 variables and different counts of responses of each category.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 17:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/485534#M126160</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-09T17:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a frequency table with classes listed are columns and variables listed as rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/485545#M126165</link>
      <description>&lt;P&gt;I am attaching a mini dataset, just 50 cases and 4 variables. Variables&amp;nbsp;B1C and B1D were measured with a 4-point scale while variables Q1J and K10F were measured with an 8-point scale. However, only 7 response categories were observed for K10F. I am trying to produce a frequency response table that I can insert in a manuscript. I used a lot of variables in my analysis, so it would take a fair amount of cutting-and-pasting to manually generate the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cristian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS, I posted an Excel file because the uploader would not allow me to post a sas dataset.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 17:53:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/485545#M126165</guid>
      <dc:creator>PCG</dc:creator>
      <dc:date>2018-08-09T17:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a frequency table with classes listed are columns and variables listed as rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/485615#M126185</link>
      <description>&lt;P&gt;Provide data as a data step.&lt;/P&gt;
&lt;P&gt;XLSX are not data sets. I would have to convert that to a data set an the choices I make may mean that my variables are not the same type as yours and so any code written for my data set may not work for yours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 22:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/485615#M126185</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-09T22:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a frequency table with classes listed are columns and variables listed as rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/494266#M130216</link>
      <description>&lt;P&gt;Hi. I still need a solution to this problem. Below is a SAS program that can be used to read in the Excel data. Again, I am looking for a fast way to generate a frequency distribution table formatted for publication, per the example I gave previously.&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;Cristian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let Path = C:\Users\PGugiu\Desktop; /* You will need to update this with the location of where you saved the Excel file */&lt;BR /&gt;%let File = mini;&lt;BR /&gt;%let Sheet= data;&lt;BR /&gt;%let Name = mini ;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.&amp;amp;Name&lt;BR /&gt;DATAFILE= "&amp;amp;Path\&amp;amp;File..xlsx"&lt;BR /&gt;DBMS=EXCELCS REPLACE;&lt;BR /&gt;SHEET="&amp;amp;Sheet";&lt;BR /&gt;SCANTEXT=YES;&lt;BR /&gt;USEDATE=YES;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 19:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/494266#M130216</guid>
      <dc:creator>PCG</dc:creator>
      <dc:date>2018-09-10T19:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Generating a frequency table with classes listed are columns and variables listed as rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/496296#M131208</link>
      <description>&lt;P&gt;Never mind. I figured it out myself using PROC IML. -C.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 16:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-a-frequency-table-with-classes-listed-are-columns-and/m-p/496296#M131208</guid>
      <dc:creator>PCG</dc:creator>
      <dc:date>2018-09-17T16:21:19Z</dc:date>
    </item>
  </channel>
</rss>

