<?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: skewness and kurtosis in proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/skewness-and-kurtosis-in-proc-sql/m-p/216258#M267707</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the explanation. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Aug 2015 03:59:19 GMT</pubDate>
    <dc:creator>Jonate_H</dc:creator>
    <dc:date>2015-08-13T03:59:19Z</dc:date>
    <item>
      <title>skewness and kurtosis in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/skewness-and-kurtosis-in-proc-sql/m-p/216256#M267705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My SAS version is 9.4 TS Level 1M2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.I tried something like below, it didn't work, the log error is about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;ERROR: Function SKEWNESS requires at least 3 argument(s).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;ERROR: Function KURTOSIS requires at least 4 argument(s).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let window=2;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; (select skewness(var_x) from have where id=a.id and year between a.year and (a.year + &amp;amp;window)) as var_x_skewness,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; (select kurtosis(var_x) from have where id=a.id and year between a.year and (a.year + &amp;amp;window)) as var_x_kurtosis&lt;/P&gt;&lt;P&gt;from have as a;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I searched online, looks like both functions can't use directly in proc sql.&lt;/P&gt;&lt;P&gt;but I also found something&amp;nbsp; as highlighted below in the following link,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/fedsqlref/67954/HTML/default/viewer.htm#p1p5rkkh0zqyhcn1qf5jqpk8nosr.htm" title="http://support.sas.com/documentation/cdl/en/fedsqlref/67954/HTML/default/viewer.htm#p1p5rkkh0zqyhcn1qf5jqpk8nosr.htm"&gt;SAS(R) 9.4 FedSQL Language Reference, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;DIV class="xis-paragraph" id="p09ge8uie1v00fn1lzqodk457fwn" style="margin-top: 1.4em;"&gt;&lt;SPAN class="xis-xrefSee"&gt;&lt;SPAN class="xis-xrefText"&gt;Table:&lt;/SPAN&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/fedsqlref/67954/HTML/default/n1qecf1698zimun0zigsk64vb4yd.htm" style="text-decoration: underline; color: #0e66ba;" title=""&gt; WORLDTEMPS&lt;/A&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;The following statement illustrates the SKEWNESS function:&lt;/P&gt;&lt;P&gt;Statements&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Results&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;select skewness(AvgHigh) from worldtemps;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;-0.69811&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 04:03:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/skewness-and-kurtosis-in-proc-sql/m-p/216256#M267705</guid>
      <dc:creator>Jonate_H</dc:creator>
      <dc:date>2015-08-04T04:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: skewness and kurtosis in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/skewness-and-kurtosis-in-proc-sql/m-p/216257#M267706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are mixing up several concepts.&lt;/P&gt;&lt;P&gt;- Skewness can be computed as of some tables (sas-datasets) This is done with SAS by proc usage means/univariate &lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146734.htm" title="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146734.htm"&gt;Base SAS(R) 9.2 Procedures Guide&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The calculation is done horizontally. This is normal classic sas usage.&lt;/P&gt;&lt;P&gt;- Skewness can be calculated on some number of variables in a records.. SAS has a function for that &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p0k4fzxui6xjk3n19au3kx2492co.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p0k4fzxui6xjk3n19au3kx2492co.htm"&gt;SAS(R) 9.4 Functions and CALL Routines: Reference, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- With Proc Sql SAS kept that on the ANSI 99 standard not following it to 2013 (interval group calculations)&lt;/P&gt;&lt;P&gt;&amp;nbsp; When coding whit that SQL you can call the SAS functions (horizontally) not the SQL vertically grouping way&lt;/P&gt;&lt;P&gt;- With PROC FEDSQL you have a part of a new SQL ANSI&amp;nbsp; version grouping is mentioned hey have been implemented as addons with aggregate functions (sql:99)&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; intended to be used with DS2 and supporting skewness vertical and horizontal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 19:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/skewness-and-kurtosis-in-proc-sql/m-p/216257#M267706</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-08-04T19:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: skewness and kurtosis in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/skewness-and-kurtosis-in-proc-sql/m-p/216258#M267707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the explanation. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 03:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/skewness-and-kurtosis-in-proc-sql/m-p/216258#M267707</guid>
      <dc:creator>Jonate_H</dc:creator>
      <dc:date>2015-08-13T03:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: skewness and kurtosis in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/skewness-and-kurtosis-in-proc-sql/m-p/216259#M267708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Jaap pointed out.&lt;/P&gt;&lt;P&gt;It is &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PROC FEDSQL&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PROC SQL;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 12:55:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/skewness-and-kurtosis-in-proc-sql/m-p/216259#M267708</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-08-13T12:55:09Z</dc:date>
    </item>
  </channel>
</rss>

