<?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: How to show regression equation and calculate predicted value for new observation? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/259952#M13742</link>
    <description>&lt;PRE&gt;

1) " calculate predicted value for new observation"
Put your train table and test table together, then you will magically find SAS has already done it for you .
2) "show regression equation "
Save these parameter and use proc sgplot get it .

I remember proc gplot can directly get the fitted function no need save these parameter. But I can't recall that .




data train;
 set sashelp.class(keep=weight height);
run;

data test;
 height=71;output;
 height=72;output;
run;

data have;
 set train test;
run;

proc reg data=have outest=est noprint;
model weight=height;
output out=want predicted=predicted;
run;
proc print data=want noobs;run;
data _null_;
 set est;
 call symputx('func',cats('weight=',intercept,'+',height,'*height'));
run;
proc sgplot data=train aspect=1;
reg x=height y=weight/ cli clm;
inset "&amp;amp;func"/ position=topleft textattrs=graphdata1(size=12);
run;
&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Mar 2016 03:30:54 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-03-30T03:30:54Z</dc:date>
    <item>
      <title>How to show regression equation and calculate predicted value for new observation?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/259922#M13735</link>
      <description>&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2545i80F8C277619D5E96/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Snap.PNG" title="Snap.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;so,fo example i have this results (PROC REG). now i have to show regresson equaton (which is y=0.33096x+1028.57177) on my graph. Moreover, &amp;nbsp;i need find &amp;nbsp;"y" for different x?&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Goal:&amp;nbsp;Displaying Regression Equations in Fit Plots and use this equation to find "y" for certain x&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 01:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/259922#M13735</guid>
      <dc:creator>bigban777</dc:creator>
      <dc:date>2016-03-30T01:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to show regresson equaton and substitute?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/259924#M13736</link>
      <description>&lt;P&gt;How are you making your graph? Where do you want to include equation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look at score and/or proc score to calculate predictions.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 01:05:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/259924#M13736</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-30T01:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to show regression equation and calculate predicted value for new observation?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/259939#M13739</link>
      <description>&lt;P&gt;If you are plotting using SGPLOT, use INSET statement to show the equation. &amp;nbsp;If you want the predicted y values for your data x values, then use an OUTPUT statement in PROC REG. You can also create the SAS code for the calculation of predicted values in a separate data step with the CODE statement in PROC REG.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 02:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/259939#M13739</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-03-30T02:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to show regression equation and calculate predicted value for new observation?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/259952#M13742</link>
      <description>&lt;PRE&gt;

1) " calculate predicted value for new observation"
Put your train table and test table together, then you will magically find SAS has already done it for you .
2) "show regression equation "
Save these parameter and use proc sgplot get it .

I remember proc gplot can directly get the fitted function no need save these parameter. But I can't recall that .




data train;
 set sashelp.class(keep=weight height);
run;

data test;
 height=71;output;
 height=72;output;
run;

data have;
 set train test;
run;

proc reg data=have outest=est noprint;
model weight=height;
output out=want predicted=predicted;
run;
proc print data=want noobs;run;
data _null_;
 set est;
 call symputx('func',cats('weight=',intercept,'+',height,'*height'));
run;
proc sgplot data=train aspect=1;
reg x=height y=weight/ cli clm;
inset "&amp;amp;func"/ position=topleft textattrs=graphdata1(size=12);
run;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Mar 2016 03:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/259952#M13742</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-30T03:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to show regression equation and calculate predicted value for new observation?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/260062#M13747</link>
      <description>&lt;P&gt;You didn't say what version of SAS you are using, but here &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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to get REALLY fancy, you can &lt;A href="http://blogs.sas.com/content/iml/2012/09/04/eqn-of-line-string-concatenation.html" target="_self"&gt;use string concatenation to construct an "equation"&lt;/A&gt; and display the equation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many ways&amp;nbsp;to&amp;nbsp;score a regression model. See examples and explanations in this article: &lt;A href="http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html" target="_self"&gt;Techniques for scoring a regression model in SAS&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 13:06:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-show-regression-equation-and-calculate-predicted-value/m-p/260062#M13747</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-03-30T13:06:00Z</dc:date>
    </item>
  </channel>
</rss>

