<?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: Compute Mean for Cross-tab Columns in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176044#M45146</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;Which method/procedure are you using for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Aug 2014 14:48:37 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2014-08-26T14:48:37Z</dc:date>
    <item>
      <title>Compute Mean for Cross-tab Columns</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176043#M45145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to compute the mean&amp;nbsp; for each column when cross-tabbing the variables q46 (categorical) and q118 (nominal; 1,2,3,4,5,6,7......). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 14:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176043#M45145</guid>
      <dc:creator>GregBond</dc:creator>
      <dc:date>2014-08-26T14:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Compute Mean for Cross-tab Columns</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176044#M45146</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;Which method/procedure are you using for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 14:48:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176044#M45146</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-08-26T14:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Compute Mean for Cross-tab Columns</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176045#M45147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi: What code have you tried? Are you using PROC FREQ? PROC TABULATE? PROC REPORT? PROC MEANS? Generally, it would be easier to get the mean using PROC TABULATE than PROC FREQ. And PROC TABULATE will give you percents and statistics like PROC MEANS. Since you did not post data, I made you a test program using SASHELP.SHOES so you can get the idea of how it might work.&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html file='c:\temp\getmean.html' style=htmlblue;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc tabulate data=sashelp.shoes f=comma14.2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;class product region;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;var sales inventory;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;table region all,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sales*(product all)*(n pctsum mean);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;table region all,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inventory*product*(min max);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 14:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176045#M45147</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-08-26T14:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Compute Mean for Cross-tab Columns</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176046#M45148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had been using Proc Freq, however that has given me only the %'s and n's. The code i have been using to get the %'s and n's is a simple one, just:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=work.pwl_spss;&lt;/P&gt;&lt;P&gt;table q46*q118;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Cynthia, will the code you posted above work given that I am only using two variables? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks again!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 15:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176046#M45148</guid>
      <dc:creator>GregBond</dc:creator>
      <dc:date>2014-08-26T15:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Compute Mean for Cross-tab Columns</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176047#M45149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Yes, but you will have to CHANGE the code. And, because TABULATE doesn't make any assumptions, you will have to explicitly ask for the statistics you want. For example, PROC FREQ will automatically give you the N (count), Row Percent, Col Percent and overall percent, but TABULATE will only give you the count or the sum by default. So you have a bit of a TABULATE learning curve. In addition, the TABULATE table is structured differently than the FREQ table. Here are some papers on the subject to get you started:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi30/258-30.pdf" title="http://www2.sas.com/proceedings/sugi30/258-30.pdf"&gt;http://www2.sas.com/proceedings/sugi30/258-30.pdf&lt;/A&gt;&amp;nbsp; and &lt;A href="http://www.lexjansen.com/phuse/2005/ss/ss02.pdf" title="http://www.lexjansen.com/phuse/2005/ss/ss02.pdf"&gt;http://www.lexjansen.com/phuse/2005/ss/ss02.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and, just for fun, here's an example using PROC REPORT &lt;A href="http://www.wuss.org/proceedings11/Papers_Miller_E_76116.pdf" title="http://www.wuss.org/proceedings11/Papers_Miller_E_76116.pdf"&gt;http://www.wuss.org/proceedings11/Papers_Miller_E_76116.pdf&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 16:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Compute-Mean-for-Cross-tab-Columns/m-p/176047#M45149</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-08-26T16:32:01Z</dc:date>
    </item>
  </channel>
</rss>

