<?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: About inset statement: proc sgplot vs. proc univariate in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/344384#M11963</link>
    <description>&lt;P&gt;Thank you all for your kindly help&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Mar 2017 05:36:27 GMT</pubDate>
    <dc:creator>Jonate_H</dc:creator>
    <dc:date>2017-03-26T05:36:27Z</dc:date>
    <item>
      <title>About inset statement: proc sgplot vs. proc univariate</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/342390#M11876</link>
      <description>&lt;P&gt;I apply the proc sgplot to put two PDF curves on one graph, like the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=have;&lt;BR /&gt;density var1 / legendlabel="var1" lineattrs=(pattern=solid);&lt;BR /&gt;density var2 / legendlabel="var2" lineattrs=(pattern=dot);&lt;BR /&gt;xaxis label="value";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then, I try to add the mean and std for both curves, which can be done in proc univariate by the inset statement:&amp;nbsp;&lt;/P&gt;&lt;P&gt;inset normal(mu sigma);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that the inset statement does not work in the same way in proc sgplot as it does in proc univariate. Any idea to let the above proc sgplot also output mean and std for both PDF curves? Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 20:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/342390#M11876</guid>
      <dc:creator>Jonate_H</dc:creator>
      <dc:date>2017-03-19T20:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: About inset statement: proc sgplot vs. proc univariate</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/342415#M11879</link>
      <description>&lt;P&gt;Yes, you are exactly right. PROC SGPLOT is primarily a graphical procedure. It does not contain the same analytical capabilities as ROC UNIVARIATE. &amp;nbsp;In particular, the INSET statement requires that you specify the text to display, which means you probably want to use PROC UNIVARIATE to&amp;nbsp;fit the distribution to the data. Let's say that PROC UNIVARIATE displays a table that states that the parameters are mu=1.2 and sigma=3.4. Then you might use the following INSET statement in PROC SGPLOT:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;inset ("mu" = "1.2" "sigma" = "3.4") / border;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 22:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/342415#M11879</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-03-19T22:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: About inset statement: proc sgplot vs. proc univariate</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/342450#M11883</link>
      <description>&lt;P&gt;Here is an example of one of many ways to display these statistics:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=sashelp.heart noprint;
var ageatstart ageatdeath;
output out=ageStats mean=muStart muDeath std=stdStart stdDeath;
run;

data _null_;
set ageStats;
str = catt(put(muStart,4.1),"/(",put(stdStart,4.2),")");
call symputx("startLabel",str);
str = catt(put(muDeath,4.1),"/(",put(stdDeath,4.2),")");
call symputx("deathLabel",str);
run;

proc sgplot data=sashelp.heart;
density ageatstart / legendlabel="Start Age" 
    curvelabel="&amp;amp;startLabel" curvelabelpos=max splitchar="/" splitjustify=center
    lineattrs=(pattern=solid);
density ageatdeath / legendlabel="Death Age" 
    curvelabel="&amp;amp;deathLabel" curvelabelpos=max splitchar="/" splitjustify=center
    lineattrs=(pattern=dot);
xaxis label="Age";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7832iB742C8008C49FFF7/image-size/medium?v=1.0&amp;amp;px=-1" border="0" alt="SGPlot2.png" title="SGPlot2.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 03:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/342450#M11883</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-03-20T03:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: About inset statement: proc sgplot vs. proc univariate</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/344384#M11963</link>
      <description>&lt;P&gt;Thank you all for your kindly help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2017 05:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/344384#M11963</guid>
      <dc:creator>Jonate_H</dc:creator>
      <dc:date>2017-03-26T05:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: About inset statement: proc sgplot vs. proc univariate</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/344385#M11964</link>
      <description>&lt;P&gt;I add &amp;nbsp;name="curve1" and&amp;nbsp;name="curve2" in those two &amp;nbsp;&lt;SPAN&gt;density statements, separately. So that legendlabel can also display.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2017 05:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/About-inset-statement-proc-sgplot-vs-proc-univariate/m-p/344385#M11964</guid>
      <dc:creator>Jonate_H</dc:creator>
      <dc:date>2017-03-26T05:41:20Z</dc:date>
    </item>
  </channel>
</rss>

