<?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: Can you utilize the mean and median functions within a proc sgplot? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Can-you-utilize-the-mean-and-median-functions-within-a-proc/m-p/526497#M5097</link>
    <description>&lt;P&gt;Thank you kindly good sir!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I went about it the long way, but have bookmarked this for the future. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jan 2019 20:59:24 GMT</pubDate>
    <dc:creator>joebacon</dc:creator>
    <dc:date>2019-01-11T20:59:24Z</dc:date>
    <item>
      <title>Can you utilize the mean and median functions within a proc sgplot?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-you-utilize-the-mean-and-median-functions-within-a-proc/m-p/526455#M5087</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some time series data with which I want to plot the means and medians. I am wondering if you are able to call upon the mean and median (and other functions) within the proc sgplot?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance, I have the following code where I am making 14 separate line plots :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Macro Line(ET); 

proc sgplot data = Sub.Tall_M_IndEXP_Better_JB_011119;
	where ExpenseType like &amp;amp;ET;
	series x = Month y = mean(Value) / group= Trichot_1YR  curvelabel;
	xaxis values =(1 to 12 by 1);
run;
%mend;
%Line('Tax')
%Line('Trans')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am getting an error when trying to utilize the function in this way that states that the variable MEAN is not found. The way around it is simply take the means before and&amp;nbsp;utilize this new data, but it had me thinking if you could utilize these functions in the middle of a Proc step?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping that someone would be able to explain to me why or why not as I am still trying to learn the intricacies of SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like always, if you see any problems/inefficiencies in my code, please point it out! I am always trying to learn. Also, thank you in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 19:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-you-utilize-the-mean-and-median-functions-within-a-proc/m-p/526455#M5087</guid>
      <dc:creator>joebacon</dc:creator>
      <dc:date>2019-01-11T19:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can you utilize the mean and median functions within a proc sgplot?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-you-utilize-the-mean-and-median-functions-within-a-proc/m-p/526458#M5088</link>
      <description>&lt;P&gt;You can't use the MEAN function inside of PROC SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you can do is run a PROC SUMMARY to compute the means (and medians and any other statistic you want) and then take the results of PROC SUMMARY and run that through PROC SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hashtag: #PROCSUMMARYRULEZ&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 19:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-you-utilize-the-mean-and-median-functions-within-a-proc/m-p/526458#M5088</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-11T19:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can you utilize the mean and median functions within a proc sgplot?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-you-utilize-the-mean-and-median-functions-within-a-proc/m-p/526470#M5091</link>
      <description>&lt;P&gt;You can use the VLINE statement in SGPLOT to plot statistics. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
vline age / group=sex response=weight stat=median;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26204iA46406A03998E834/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot.png" alt="SGPlot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 20:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-you-utilize-the-mean-and-median-functions-within-a-proc/m-p/526470#M5091</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-01-11T20:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can you utilize the mean and median functions within a proc sgplot?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-you-utilize-the-mean-and-median-functions-within-a-proc/m-p/526497#M5097</link>
      <description>&lt;P&gt;Thank you kindly good sir!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I went about it the long way, but have bookmarked this for the future. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 20:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-you-utilize-the-mean-and-median-functions-within-a-proc/m-p/526497#M5097</guid>
      <dc:creator>joebacon</dc:creator>
      <dc:date>2019-01-11T20:59:24Z</dc:date>
    </item>
  </channel>
</rss>

