<?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: Summary Statistics for Different Variables for different Groups using SQL in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543568#M150285</link>
    <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; for the reminder about using the n.&lt;/P&gt;
&lt;P&gt;I don't do myself very often, since I came from the old world of only using only 8 charters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2019 14:54:11 GMT</pubDate>
    <dc:creator>VDD</dc:creator>
    <dc:date>2019-03-15T14:54:11Z</dc:date>
    <item>
      <title>Summary Statistics for Different Variables for different Groups using SQL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543560#M150279</link>
      <description>&lt;P&gt;This is the code I'm using. I keep getting a lot of errors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;select&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;min(logat) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'MinLogofTotalAssets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;min(roa) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'MinReturnofAssets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;min(bus_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'MinBusinessSegment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;min(geo_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'MinGeographicSegment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;min(ln_nas) &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;'MinLNofNAS'&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;min(city_ind_fees) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'MinCityIndependentFees'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;min(big4) &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;'MinBigFour'&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;min(audit_tenure) &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;'MinAuditTenure'&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;max(logat) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Max Log of Total Assets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;max(roa) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Max of Return of Assets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;max(bus_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Max of Business Segment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;max(geo_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Max Geographic Segment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;max(ln_nas) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Max LN of NAS'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;max(city_ind_fees) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Max City Independent Fees'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;max(big4) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Max Big Four'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;max(audit_tenure) &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;'Max Audit Tenure'&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;mean(logat) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Mean Log of Total Assets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;mean(roa) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Mean Return of Assets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;mean(bus_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Mean Business Segment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;mean(geo_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Mean Geographic Segment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;mean(ln_nas) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Mean of LN NAS'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;mean(city_ind_fees) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Mean of City Independent Fees'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;mean(big4) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Mean of Big Four'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;mean(audit_tenure) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Mean of Audit Tenure'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;median(logat) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Median Log of Total Assets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;median(roa) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'MedianReturnofAssets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;median(bus_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Median Business Segment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;median(geo_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Median Geographic Segment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;median(ln_nas) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Median of LN NAS'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;median(city_ind_fees) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Median of City Independent Fees'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;median(big4) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Median of Big Four'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;median(audit_tenure) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Median of Audit Tenure'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;std(logat) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'STD Log of Total Assets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;std(roa) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'STD Return of Assets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;std(bus_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'STD Business Segment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;std(geo_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'STD Geographic Segment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;std(ln_nas) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'STD of LN NAS'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;std(city_ind_fees) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'STD of City Independent Fees'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;std(big4) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'STD of Big Four'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;std(audit_tenure) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'STD of Audit Tenure'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var(logat) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Var Log of Total Assets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var(roa) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Var Return of Assets'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var(bus_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Var Business Segment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var(geo_seg) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Var Geographic Segment'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var(ln_nas) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Var of LN NAS'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var(city_ind_fees) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Var of City Independent Fees'&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var(big4) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Var of Big Four'&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var(audit_tenure) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; 'Var of Audit Tenure'&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;from&lt;/SPAN&gt; audit&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;group&lt;/SPAN&gt; &lt;SPAN&gt;by&lt;/SPAN&gt; 'Group 1'&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for you help in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 14:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543560#M150279</guid>
      <dc:creator>taygehring</dc:creator>
      <dc:date>2019-03-15T14:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Summary Statistics for Different Variables for different Groups using SQL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543564#M150282</link>
      <description>&lt;P&gt;are these&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #f4f4f4; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; 'Group 1'&lt;/SPAN&gt; valid variable names?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 14:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543564#M150282</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-15T14:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Summary Statistics for Different Variables for different Groups using SQL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543565#M150283</link>
      <description>&lt;P&gt;Sorry, that code made me chuckle.&amp;nbsp; We were just discussing how SQL seems to be taking over from Base SAS programming, and that illustrates it only too well.&amp;nbsp; You have effectively hand coded a proc means, and possibly a proc transpose in one long statement.&amp;nbsp; And to cap it all are using named literals for no apparent reason, or with reference to the syntax.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to answer why you code produces errors, named literals have to be quoted, and finish with an n:&lt;/P&gt;
&lt;PRE&gt;min(logat) as 'MinLogofTotalAssets'n,&lt;/PRE&gt;
&lt;P&gt;No to fix using named literals at all, as its not needed and messy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;min(logat) as MinLogofTotalAssets,&lt;/PRE&gt;
&lt;P&gt;However, simplifying to:&lt;/P&gt;
&lt;PRE&gt;proc means data=audit;
  class group1;
  var logat roa bus_seg...;
  output out=want min= max= mean= median= stddev= / autoname;
run;&lt;/PRE&gt;
&lt;P&gt;(note not sure what the var() equivalent is, perhaps one of the statos can advise), would do the same, and probably by in the high percentage times faster than your code.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 14:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543565#M150283</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-15T14:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Summary Statistics for Different Variables for different Groups using SQL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543566#M150284</link>
      <description>&lt;P&gt;If you want to refer to a variable name in SAS,&amp;nbsp; you don't need quotes.&amp;nbsp; Correct:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;min(logat)&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;MinLogofTotalAssets&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;If you want to refer to a variable name that includes special characters, such as blanks as part of the name, you need to add the letter "n":&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;var(audit_tenure)&amp;nbsp;as&amp;nbsp;'Var of Audit Tenure'n&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;Using special characters as part of variable names gives you the headache later of referring to those variable names with the quotes and with the "n" at the end.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 14:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543566#M150284</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-15T14:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Summary Statistics for Different Variables for different Groups using SQL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543568#M150285</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; for the reminder about using the n.&lt;/P&gt;
&lt;P&gt;I don't do myself very often, since I came from the old world of only using only 8 charters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 14:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543568#M150285</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-15T14:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Summary Statistics for Different Variables for different Groups using SQL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543587#M150295</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry, that code made me chuckle.&amp;nbsp; We were just discussing how SQL seems to be taking over from Base SAS programming, and that illustrates it only too well.&amp;nbsp; You have effectively hand coded a proc means, and possibly a proc transpose in one long statement.&amp;nbsp; And to cap it all are using named literals for no apparent reason, or with reference to the syntax.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, simplifying to:&lt;/P&gt;
&lt;PRE&gt;proc means data=audit;
  class group1;
  var logat roa bus_seg...;
  output out=want min= max= mean= median= stddev= / autoname;
run;&lt;/PRE&gt;
&lt;P&gt;(note not sure what the var() equivalent is, perhaps one of the statos can advise), would do the same, and probably by in the high percentage times faster than your code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;VAR, variance, would be VAR in proc means.&lt;/P&gt;
&lt;P&gt;And I had the same reaction that Proc Means or Summary may be more appropriate and certainly shorter to code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/266730"&gt;@taygehring&lt;/a&gt;&amp;nbsp;may also be interested to know that the statistics when using proc means/ summary will inherit labels as well.&lt;/P&gt;
&lt;P&gt;Using: var _numeric_ ; will do the summary of ALL of the numeric variables in the data set.&lt;/P&gt;
&lt;P&gt;Also other variable lists can be used on Class or Var&amp;nbsp;that Proc SQL will not.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2019 16:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-Statistics-for-Different-Variables-for-different-Groups/m-p/543587#M150295</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-15T16:33:34Z</dc:date>
    </item>
  </channel>
</rss>

