<?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: Get summary statistics by class level and overall in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542164#M7497</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=workdata;
    class binaryvar;
    var continuousvar;
    output out=_stats_ mean=continuousvar_mean;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Look up the &lt;A href="https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0aq3hsvflztfzn1xa2wt6s35oy6.htm&amp;amp;locale=en" target="_self"&gt;documentation for PROC SUMMARY&lt;/A&gt;, please see the NWAY option, as well as the TYPES command and the WAYS command in PROC SUMMARY, these give you complete control over what combinations of CLASS variables are to be included in the output.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Mar 2019 19:09:19 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-03-11T19:09:19Z</dc:date>
    <item>
      <title>Get summary statistics by class level and overall</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542154#M7493</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched the knowledge base and Google, but can't see to find the answer to what seems to be a simple question. Is it possible to run a single proc means/summary or proc tabulate statement and get the class level summary statistics for a variable as well as the overall summary statistics? I have to run two separate procedures, to get both - one with the class statement and one omitting the class statement. I don't want to have to output it to a data set either. Does anyone know a more efficient way to do this? Example of the longhand code I run below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Cara&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=workdata; class binaryvar ; var continuousvar; run;
proc means data=workdata; var continuousvar; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 18:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542154#M7493</guid>
      <dc:creator>cbt2119</dc:creator>
      <dc:date>2019-03-11T18:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Get summary statistics by class level and overall</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542155#M7494</link>
      <description>&lt;P&gt;If you take the top PROC MEANS, and add an OUTPUT statement (with all the necessary details), the output data set will contain just what you are asking for.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 18:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542155#M7494</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-11T18:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get summary statistics by class level and overall</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542164#M7497</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=workdata;
    class binaryvar;
    var continuousvar;
    output out=_stats_ mean=continuousvar_mean;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Look up the &lt;A href="https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0aq3hsvflztfzn1xa2wt6s35oy6.htm&amp;amp;locale=en" target="_self"&gt;documentation for PROC SUMMARY&lt;/A&gt;, please see the NWAY option, as well as the TYPES command and the WAYS command in PROC SUMMARY, these give you complete control over what combinations of CLASS variables are to be included in the output.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 19:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542164#M7497</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-11T19:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get summary statistics by class level and overall</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542197#M7507</link>
      <description>&lt;P&gt;Is there a way to do it without using the output statement? Like is there an option in the class statement that also computes the overall statistics, like the totals rows and columns in proc freq?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 20:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542197#M7507</guid>
      <dc:creator>cbt2119</dc:creator>
      <dc:date>2019-03-11T20:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get summary statistics by class level and overall</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542201#M7509</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/125665"&gt;@cbt2119&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Is there a way to do it without using the output statement?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, use PROC MEANS instead of PROC SUMMARY, and the WAYS or TYPES command. But without the OUTPUT statement, you get output to HTML or to the LISTING or some other print destination. With the OUTPUT statement, you get a data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;... is there an option in the class statement that also computes the overall statistics, like the totals rows and columns in proc freq?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, the WAYS or TYPES command will force the overall statistics to be printed out.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 20:16:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542201#M7509</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-11T20:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get summary statistics by class level and overall</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542203#M7510</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.class;
  class sex;
  var height;
  ways 0 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27844i25D8566E38822FF3/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 20:23:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542203#M7510</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-11T20:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Get summary statistics by class level and overall</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542205#M7511</link>
      <description>Thanks, this works well too!</description>
      <pubDate>Mon, 11 Mar 2019 20:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Get-summary-statistics-by-class-level-and-overall/m-p/542205#M7511</guid>
      <dc:creator>cbt2119</dc:creator>
      <dc:date>2019-03-11T20:25:58Z</dc:date>
    </item>
  </channel>
</rss>

