<?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: Add Mean and Median Text Values to a Simple SGPLOT Series Plot? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365696#M12725</link>
    <description>&lt;P&gt;Another slight variation on the INSET you might want to try is the code below. It is a "table" form of inset. Either version should work for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=customer_ages;
   series x=age y=buyers;
   xaxis values=(18 to 90 by 2);
   yaxis grid;
   inset ('Mean'='42.3' 'Median'='40') / position = topright;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 09 Jun 2017 14:34:50 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2017-06-09T14:34:50Z</dc:date>
    <item>
      <title>Add Mean and Median Text Values to a Simple SGPLOT Series Plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365563#M12721</link>
      <description>&lt;P&gt;What is the easiest way to indicate the mean and median values on a simple series plot like the following?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=customer_ages;
   series x=age y=buyers;
   xaxis values=(18 to 90 by 2);
   yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the example above, I'd like to indicate both the mean age and median age somewhere either outside or inside the graph. &amp;nbsp;No need for reference lines, just want to show the values, such as &lt;STRONG&gt;Mean: 42.3&lt;/STRONG&gt; and &lt;STRONG&gt;Median: 40&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 00:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365563#M12721</guid>
      <dc:creator>doesper</dc:creator>
      <dc:date>2017-06-09T00:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add Mean and Median Text Values to a Simple SGPLOT Series Plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365567#M12722</link>
      <description>&lt;P&gt;Try the inset statement in sgplot, it will insert the text inside, top right position of graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=customer_ages;
   series x=age y=buyers;
   xaxis values=(18 to 90 by 2);
   yaxis grid;
inset 'Mean: 42.3' 'Median: 40 ' / position = topright;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 00:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365567#M12722</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-06-09T00:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Add Mean and Median Text Values to a Simple SGPLOT Series Plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365696#M12725</link>
      <description>&lt;P&gt;Another slight variation on the INSET you might want to try is the code below. It is a "table" form of inset. Either version should work for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=customer_ages;
   series x=age y=buyers;
   xaxis values=(18 to 90 by 2);
   yaxis grid;
   inset ('Mean'='42.3' 'Median'='40') / position = topright;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2017 14:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365696#M12725</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-06-09T14:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Add Mean and Median Text Values to a Simple SGPLOT Series Plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365702#M12726</link>
      <description>&lt;P&gt;Ah, so there isn't any way for SGPLOT to actually calculate the mean and median? &amp;nbsp;I'll need to pre-process the data in another step, output macro variables, and then insert the macro variable references into the SGPLOT Inset statement, correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Was hoping SGPLOT could do this for me...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your responses, Jagadishkatam and DanH_sas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 14:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365702#M12726</guid>
      <dc:creator>doesper</dc:creator>
      <dc:date>2017-06-09T14:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add Mean and Median Text Values to a Simple SGPLOT Series Plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365711#M12727</link>
      <description>&lt;P&gt;Correct, but you can calculate the stats outside the procedure, set it in a macro variable(s), and use the macro variable(s) in the INSET statement.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 14:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Add-Mean-and-Median-Text-Values-to-a-Simple-SGPLOT-Series-Plot/m-p/365711#M12727</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-06-09T14:59:16Z</dc:date>
    </item>
  </channel>
</rss>

