<?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: How to count quartiles (Q1 and Q3) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781904#M249218</link>
    <description>&lt;P&gt;A few pointers to help you get an answer faster&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Provide the "have" data in code form. That way we can cut/paste it into SAS and not spend time writing the code to generate the "have" data&lt;/LI&gt;
&lt;LI&gt;Provide the "want" data i.e. what you want the output data to look like&lt;/LI&gt;
&lt;LI&gt;Provide what you have tried so far&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;The description of what you want might be obvious to you, but it is unclear to me (and probably others)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 23 Nov 2021 11:16:18 GMT</pubDate>
    <dc:creator>AMSAS</dc:creator>
    <dc:date>2021-11-23T11:16:18Z</dc:date>
    <item>
      <title>How to count quartiles (Q1 and Q3)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781899#M249216</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I need to find outliers using the Interquartile Range(IQR) but first I have to count&amp;nbsp;first and the third quartile. How can I achieve this in easly way? Also I want to group my calculation. Let's say I have example data like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
input FRUIT $ COUNT;
datalines;
Apple 2
Apple 5
Apple 7
Apple 9 
Apple 19
Banana 1
Banana 3
Banana 3
Banana 5
Banana 8
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What I've done is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC MEANS data=HAVE q1 q3 ;
BY FRUIT;
VAR COUNT;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But what I got is a proc means report, I need results in table to refer to them further like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WANT;
input FRUIT $ Q1 Q3;
datalines;
Apple 5 9
Banana 3 5
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Nov 2021 11:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781899#M249216</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2021-11-23T11:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to count quartiles (Q1 and Q3)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781904#M249218</link>
      <description>&lt;P&gt;A few pointers to help you get an answer faster&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Provide the "have" data in code form. That way we can cut/paste it into SAS and not spend time writing the code to generate the "have" data&lt;/LI&gt;
&lt;LI&gt;Provide the "want" data i.e. what you want the output data to look like&lt;/LI&gt;
&lt;LI&gt;Provide what you have tried so far&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;The description of what you want might be obvious to you, but it is unclear to me (and probably others)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 11:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781904#M249218</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2021-11-23T11:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to count quartiles (Q1 and Q3)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781908#M249220</link>
      <description>You are right, my post was chaotic. I corrected it on your advice. My result is in the form of a report and I would like to have it listed in the table because I want to refer to these results from quartiles 1 and 3.</description>
      <pubDate>Tue, 23 Nov 2021 11:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781908#M249220</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2021-11-23T11:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to count quartiles (Q1 and Q3)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781909#M249221</link>
      <description>&lt;P&gt;I've found solution myself. It's possible to add output function to proc means procedure.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC MEANS data=HAVE;
BY FRUIT;
VAR COUNT;
output out=FRUIT_CALC Q1= Q3= /autoname;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Nov 2021 11:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781909#M249221</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2021-11-23T11:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to count quartiles (Q1 and Q3)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781923#M249229</link>
      <description>&lt;P&gt;You could get " Interquartile Range(IQR) " directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.heart nway;
class status;
VAR height;
output out=FRUIT_CALC qrange= /autoname;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Nov 2021 12:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-quartiles-Q1-and-Q3/m-p/781923#M249229</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-11-23T12:35:47Z</dc:date>
    </item>
  </channel>
</rss>

