<?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 Q1,Q3 in proc sql in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Q1-Q3-in-proc-sql/m-p/48347#M13069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see.&amp;nbsp; It was the way to calculate Q1, Q3 with median function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your quick response, zinzuwadia.﻿&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Hide&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Feb 2012 04:30:45 GMT</pubDate>
    <dc:creator>Hoz</dc:creator>
    <dc:date>2012-02-08T04:30:45Z</dc:date>
    <item>
      <title>Q1,Q3 in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Q1-Q3-in-proc-sql/m-p/48345#M13067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like to use median function in proc sq.&lt;/P&gt;&lt;P&gt;It was OK when i wrote down "proc sql; --- select median(x) ----".&lt;/P&gt;&lt;P&gt;But it was NG when "proc sql; --- select q3(x) ---".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know to get Q1,Q3 in proc sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hide&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 03:10:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Q1-Q3-in-proc-sql/m-p/48345#M13067</guid>
      <dc:creator>Hoz</dc:creator>
      <dc:date>2012-02-08T03:10:23Z</dc:date>
    </item>
    <item>
      <title>Q1,Q3 in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Q1-Q3-in-proc-sql/m-p/48346#M13068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My assumption Q1 and Q3 - Interquartile Range &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, get the median of the variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select median(x) as M from tbl_nm;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex: M = 7500 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now that you have got your median you can find Q1 which is 25th Quantile. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select median(x) as Q1 where x &amp;lt;= 7500;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next, go for Q3 which is 75th Quantile:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select median(x) as Q3 where x &amp;gt;= 7500&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what you are looking for? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 03:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Q1-Q3-in-proc-sql/m-p/48346#M13068</guid>
      <dc:creator>Pritish</dc:creator>
      <dc:date>2012-02-08T03:39:41Z</dc:date>
    </item>
    <item>
      <title>Q1,Q3 in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Q1-Q3-in-proc-sql/m-p/48347#M13069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see.&amp;nbsp; It was the way to calculate Q1, Q3 with median function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your quick response, zinzuwadia.﻿&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Hide&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 04:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Q1-Q3-in-proc-sql/m-p/48347#M13069</guid>
      <dc:creator>Hoz</dc:creator>
      <dc:date>2012-02-08T04:30:45Z</dc:date>
    </item>
    <item>
      <title>Q1,Q3 in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Q1-Q3-in-proc-sql/m-p/48348#M13070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at your results more carefully and you will see that PROC SQL does not support MEDIAN as a summary statistic. You can use the SAS MEDIAN function in PROC SQL, but with one argument all you get is the trivial result that the median of a single number is that number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;means&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;median&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;data&lt;/SPAN&gt;=sashelp.class ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;var&lt;/SPAN&gt; age ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New; color: #000080;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New; color: #000080;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;select&lt;/SPAN&gt; median(age) &lt;SPAN style="color: #0000ff;"&gt;from&lt;/SPAN&gt; sashelp.class ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier New; color: #000080;"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Celko's SQL median has been implemented in SAS (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.sascommunity.org/wiki/Celko's_Median"&gt;http://www.sascommunity.org/wiki/Celko's_Median&lt;/A&gt;&lt;SPAN&gt;). That should get you started if you really have to do this in SQL.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 02:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Q1-Q3-in-proc-sql/m-p/48348#M13070</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2012-02-09T02:40:48Z</dc:date>
    </item>
  </channel>
</rss>

