<?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: proc sgplot: how to show equation of 95 % prediction limits in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307893#M61140</link>
    <description>&lt;P&gt;Not entireley sure on the spefics in this question - where the "equation" comes from. &amp;nbsp;Is that part of an output table from proc reg or something you hard code in? &amp;nbsp;As for plotting it, well that pretty simple. &amp;nbsp;Add into your plot data, the text you want to show, at the places you want to show, then have another statement in your sgplot:&lt;/P&gt;
&lt;P&gt;scatter y=dif x=mean / markechars=(&amp;lt;variable&amp;gt;)&lt;/P&gt;
&lt;P&gt;Examples here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/?s=scatter+markerchar" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/?s=scatter+markerchar&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Oct 2016 12:04:37 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-10-28T12:04:37Z</dc:date>
    <item>
      <title>proc sgplot: how to show equation of 95 % prediction limits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307887#M61139</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using proc sgplot to calculate the best fit regression line as well as the 95% prediction limits. I want the equation for all three lines plotted on the graph (or showed in the results). Now I can only see the the Parameter estimates for the best fit line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
      set outputds;
      if variable eq 'Intercept' then call symput('Int', put(estimate, BEST.));    
      else            call symput('Slope', put(estimate, BEST.));  
	  ods output outputds;
   run;
proc sgplot data=diffs noautolegend;
   title "Regression Line with Slope and Intercept";
   reg y=diff x=mean / cli;
   ods output parameterestimates=outputds; 
   inset "Intercept = &amp;amp;Int" "Slope = &amp;amp;Slope" / 
         border title="Parameter Estimates" position=topleft;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 11:09:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307887#M61139</guid>
      <dc:creator>morten1</dc:creator>
      <dc:date>2016-10-28T11:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot: how to show equation of 95 % prediction limits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307893#M61140</link>
      <description>&lt;P&gt;Not entireley sure on the spefics in this question - where the "equation" comes from. &amp;nbsp;Is that part of an output table from proc reg or something you hard code in? &amp;nbsp;As for plotting it, well that pretty simple. &amp;nbsp;Add into your plot data, the text you want to show, at the places you want to show, then have another statement in your sgplot:&lt;/P&gt;
&lt;P&gt;scatter y=dif x=mean / markechars=(&amp;lt;variable&amp;gt;)&lt;/P&gt;
&lt;P&gt;Examples here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/?s=scatter+markerchar" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/?s=scatter+markerchar&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 12:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307893#M61140</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-28T12:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot: how to show equation of 95 % prediction limits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307914#M61143</link>
      <description>&lt;P&gt;To show the estimated slope and intercept, see the article &lt;A href="http://blogs.sas.com/content/iml/2013/02/27/slope-of-a-regression-line.html" target="_self"&gt;"How to use PROC SGPLOT to display the slope and intercept of a regression line"&lt;/A&gt;, which gives complete step-by-step code and an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In particular, you are trying to use the REG statement in PROC SGPLOT, but you need to use PROC REG if you want to use ODS OUTPUT to capture the ParameterEstimates table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The title of your question is "show equation of 95% prediction limits," which different from the slope/intercept equation that you seem to want. See the documentation for &lt;A href="http://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_introreg_sect010.htm" target="_self"&gt;"Statistical Background in Linear Regression"&lt;/A&gt; if you want to see the formulas used to compute those limits.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 13:44:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307914#M61143</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-10-28T13:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot: how to show equation of 95 % prediction limits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307951#M61144</link>
      <description>&lt;P&gt;Thank you! I was maybe a little bit unclear in my explanation: I already have the intercept and slope (with this I mean equation) for the fit-line in my Parameter Estimates, but I also need&amp;nbsp;the intercept and slope for the upper and lower 95 % prediction limits. I can not see this in the example and I am also not very good at programming in SAS so it would be great if you know a code for this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 16:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307951#M61144</guid>
      <dc:creator>morten1</dc:creator>
      <dc:date>2016-10-28T16:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot: how to show equation of 95 % prediction limits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307961#M61146</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp; I also need&amp;nbsp;the intercept and slope for the upper and lower 95 % prediction limits.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, the prediction limits are not linear, so they do not have an intercept or slope. &amp;nbsp;Run the following code. The graph that is produced shows that the prediction limits are wide at the extreme of the X variable and narrow in the middle. &amp;nbsp;There is no simple equation&amp;nbsp;for those curves in terms of X.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on;
proc reg data=sashelp.class plots(only)=fitplot;
model weight = height;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Oct 2016 17:12:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sgplot-how-to-show-equation-of-95-prediction-limits/m-p/307961#M61146</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-10-28T17:12:17Z</dc:date>
    </item>
  </channel>
</rss>

