<?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 Draw Histogram and obtain 95% quantile verticle line in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Draw-Histogram-and-obtain-95-quantile-verticle-line/m-p/368361#M12780</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set named A including two columns:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9479iAA3980B895A6077F/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Dataset.PNG" title="Dataset.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9480i26338B6BB84A9F3D/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Dataset2.PNG" title="Dataset2.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wuld like to draw histogram which reflects 'Booking_Lead' and its corresponding 'Avg_Percent'. Besides, I would like to draw a 90% quantile that starting from the largest 'Booking_Lead', and in this example, it is between 0 and 1, but near 1. And output the result called Table B.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics off;&lt;/P&gt;&lt;P&gt;proc univariate data=A noprint;&lt;BR /&gt;var Booking_Lead;&lt;BR /&gt;histogram Booking_Lead /BARLABEL=percent STATREF=P 90 STATREFLABEL="90th Pctl";&lt;BR /&gt;output out=B&amp;nbsp;p90=p90pct;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this is not correct, How could I change the code, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2017 15:30:16 GMT</pubDate>
    <dc:creator>Crubal</dc:creator>
    <dc:date>2017-06-19T15:30:16Z</dc:date>
    <item>
      <title>Draw Histogram and obtain 95% quantile verticle line</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Draw-Histogram-and-obtain-95-quantile-verticle-line/m-p/368361#M12780</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set named A including two columns:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9479iAA3980B895A6077F/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Dataset.PNG" title="Dataset.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9480i26338B6BB84A9F3D/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Dataset2.PNG" title="Dataset2.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wuld like to draw histogram which reflects 'Booking_Lead' and its corresponding 'Avg_Percent'. Besides, I would like to draw a 90% quantile that starting from the largest 'Booking_Lead', and in this example, it is between 0 and 1, but near 1. And output the result called Table B.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics off;&lt;/P&gt;&lt;P&gt;proc univariate data=A noprint;&lt;BR /&gt;var Booking_Lead;&lt;BR /&gt;histogram Booking_Lead /BARLABEL=percent STATREF=P 90 STATREFLABEL="90th Pctl";&lt;BR /&gt;output out=B&amp;nbsp;p90=p90pct;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this is not correct, How could I change the code, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 15:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Draw-Histogram-and-obtain-95-quantile-verticle-line/m-p/368361#M12780</guid>
      <dc:creator>Crubal</dc:creator>
      <dc:date>2017-06-19T15:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Histogram and obtain 95% quantile verticle line</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Draw-Histogram-and-obtain-95-quantile-verticle-line/m-p/368369#M12781</link>
      <description>&lt;P&gt;It looks like your data is a summarization of the raw data. Does the avg_percent column sum to 1? Do you have the raw data? &amp;nbsp;If so, please post as a DATA step, not as an image file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't have the raw data, then compute the cumulative proportions by summing the avg_percent column:&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set A;&lt;/P&gt;
&lt;P&gt;cum_percent + avg_percent;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first observation for which cum_percent &amp;gt;= 0.9 is an estimate of the 90th percentile.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 15:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Draw-Histogram-and-obtain-95-quantile-verticle-line/m-p/368369#M12781</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-06-19T15:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Histogram and obtain 95% quantile verticle line</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Draw-Histogram-and-obtain-95-quantile-verticle-line/m-p/368400#M12782</link>
      <description>&lt;P&gt;Hi Rick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you! &amp;nbsp;The 'Avg_Percent' column sum to 1. And my prior code to obtain this data is as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc Sql;&lt;BR /&gt;Create Table Work.A&lt;BR /&gt;as select distinct&lt;BR /&gt;Operating_Div_CD,&lt;BR /&gt;Chain_Cd,&lt;BR /&gt;LOC_ID,&lt;BR /&gt;Booking_Lead,&lt;BR /&gt;avg(Percentage) as Avg_Percent&lt;BR /&gt;from Work.A_1&lt;BR /&gt;group by 1, 2, 3, 4&lt;BR /&gt;order by 4 desc;&lt;BR /&gt;Quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I figured out the corresponding 'Booking_Lead' versus 90% quantile from your hint.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 17:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Draw-Histogram-and-obtain-95-quantile-verticle-line/m-p/368400#M12782</guid>
      <dc:creator>Crubal</dc:creator>
      <dc:date>2017-06-19T17:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Histogram and obtain 95% quantile verticle line</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Draw-Histogram-and-obtain-95-quantile-verticle-line/m-p/368402#M12783</link>
      <description>&lt;P&gt;The simpler way is to use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc histogram data=A_1;&lt;/P&gt;
&lt;P&gt;histogram Percentage;&lt;/P&gt;
&lt;P&gt;etc.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 17:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Draw-Histogram-and-obtain-95-quantile-verticle-line/m-p/368402#M12783</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-06-19T17:32:12Z</dc:date>
    </item>
  </channel>
</rss>

