<?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: Histogram per Group of Values Only Greater than Q3 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777748#M247489</link>
    <description>&lt;P&gt;Here is an example of the data structure. Each group could have as many as 1000 different values of "Number of Cycles", so each group will have a different Q3. Thus, I am looking to create a separate graph for each group, but the histogram will only display values that are greater than Q3 for that particular group. I apologize if my original question was to ambiguous.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Group&lt;/TD&gt;&lt;TD&gt;Number of Cycles&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 2&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Mon, 01 Nov 2021 19:08:02 GMT</pubDate>
    <dc:creator>JonKetchup</dc:creator>
    <dc:date>2021-11-01T19:08:02Z</dc:date>
    <item>
      <title>Histogram per Group of Values Only Greater than Q3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777740#M247482</link>
      <description>&lt;P&gt;I have a dataset with about 100 groups, and I need a histogram of "Number of Cycles" for each group; however, I only want to display values of "Number of Cycles" that are greater than Q3. Is there a convenient way to do this?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 18:43:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777740#M247482</guid>
      <dc:creator>JonKetchup</dc:creator>
      <dc:date>2021-11-01T18:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram per Group of Values Only Greater than Q3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777741#M247483</link>
      <description>You can add a WHERE statement/clause to your procedure to filter out the data. How exactly the statement/clause structured depends on your data. &lt;BR /&gt;If it's a SAS date for example it could be the following since 4 is the only quarter greater than 3. &lt;BR /&gt;&lt;BR /&gt;where qtr(date) = 4;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Nov 2021 18:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777741#M247483</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-01T18:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram per Group of Values Only Greater than Q3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777744#M247485</link>
      <description>&lt;P&gt;Appreciate the help. My variable of interest is not a date; it takes on values from 0 to 1500. Also the Q3 will be different for each group, and I believe a where statement will apply universally to all groups.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 18:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777744#M247485</guid>
      <dc:creator>JonKetchup</dc:creator>
      <dc:date>2021-11-01T18:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram per Group of Values Only Greater than Q3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777745#M247486</link>
      <description>Please provide an example of your data/use case if you need specific coding help. With what you've provided here we can only suggest an approach, as already done.</description>
      <pubDate>Mon, 01 Nov 2021 18:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777745#M247486</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-01T18:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram per Group of Values Only Greater than Q3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777748#M247489</link>
      <description>&lt;P&gt;Here is an example of the data structure. Each group could have as many as 1000 different values of "Number of Cycles", so each group will have a different Q3. Thus, I am looking to create a separate graph for each group, but the histogram will only display values that are greater than Q3 for that particular group. I apologize if my original question was to ambiguous.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Group&lt;/TD&gt;&lt;TD&gt;Number of Cycles&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 2&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Group 3&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777748#M247489</guid>
      <dc:creator>JonKetchup</dc:creator>
      <dc:date>2021-11-01T19:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram per Group of Values Only Greater than Q3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777752#M247491</link>
      <description>&lt;P&gt;Please show an example of your data and the code you have so far.&amp;nbsp; By Q3, do you mean third quartile / 75th percentile?&amp;nbsp; If so, then you could calculate the 75th percentile&amp;nbsp; (by group) using PROC MEANS or whatever and merge it onto your data (by group), then use a where statement Where Var&amp;gt;Var_Q3.&amp;nbsp; But that's just a wild guess, without seeing sample data.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777752#M247491</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2021-11-01T19:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram per Group of Values Only Greater than Q3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777754#M247493</link>
      <description>&lt;P&gt;Use PROC MEANS to get the values of the Q3 in each group. They merge the Q3 values with the data and output only the values that exceed Q3:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
input Group	N;
datalines;
1	1
1	9
1	2
1	1
1	10
1	5
2	1
2	2
2	3
2  3
2  4
2  6
2  20
2	45
3	2
3	5
3	6
3	4
3	5
3	3
;

proc means data=Have noprint;
by Group;
var N;
output out=Q3Out Q3=Q3;
run;

data Want;
merge Have Q3Out;
by Group;
if N &amp;gt; Q3;
run;

proc print data=Want;
var Group N Q3;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I don't fully understand if you want a histogram for each group or if you want one histogram that combines all the data across groups.&amp;nbsp; I think the first. If so, you can use &lt;STRONG&gt;PROC SGPANEL&lt;/STRONG&gt; and &lt;STRONG&gt;PANELBY Group&lt;/STRONG&gt;, or if you want many small histograms (not paneled), use &lt;STRONG&gt;PROC SGPLOT&lt;/STRONG&gt; and &lt;STRONG&gt;BY Group&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:19:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-per-Group-of-Values-Only-Greater-than-Q3/m-p/777754#M247493</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-11-01T19:19:58Z</dc:date>
    </item>
  </channel>
</rss>

