<?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: Regression plots in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/830864#M41131</link>
    <description>&lt;P&gt;Show us a portion of your data. Show us your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you really want residuals and the raw data on the same plot? That really doesn't make sense to do.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Aug 2022 10:27:55 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-08-29T10:27:55Z</dc:date>
    <item>
      <title>Regression plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/830821#M41130</link>
      <description>&lt;P&gt;I want to draw a graph for observed vs predicted values with confidence and predicted intervals in&amp;nbsp;simple linear regression. And also need to show residuals versus model predicted values on the same graph (similar to the below graph).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="userbester1_0-1661747959071.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74805iB3A4B1A7FBFA9C6D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="userbester1_0-1661747959071.png" alt="userbester1_0-1661747959071.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to do it?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 04:41:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/830821#M41130</guid>
      <dc:creator>userbester1</dc:creator>
      <dc:date>2022-08-29T04:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Regression plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/830864#M41131</link>
      <description>&lt;P&gt;Show us a portion of your data. Show us your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you really want residuals and the raw data on the same plot? That really doesn't make sense to do.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 10:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/830864#M41131</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-29T10:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Regression plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/830872#M41132</link>
      <description>&lt;P&gt;How about this one ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 set sashelp.class;
run;

ods select none;
ods output FitStatistics=FitStatistics;
proc reg data=have ;
model weight= height;
output out=want p=pred r=residual ;
quit;
ods select all;
data _null_;
 set FitStatistics;
 call symputx('rsquare',put(nValue2,8.2));
 stop;
run;
data want;
 set want;
 residual=-residual;
run;
proc sgplot data=want;
title 'Hoffman Holstein Model';
reg x=weight y=pred/clm nomarkers;
scatter x=weight y=pred/markerattrs=(symbol=circlefilled) name='a' legendlabel='Observed DMI';
scatter x=weight y=residual/markerattrs=(symbol=diamondfilled) name='b' legendlabel='Residuals';
lineparm x=0 y=0 slope=1/lineattrs=(color=grey);
inset "R(*ESC*){sup '2'} = &amp;amp;rsquare."/  position=TopLeft border;
refline 0/axis=y;
yaxis label='Predicted DMI';
xaxis label='Observed DMI';
keylegend 'a' 'b';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1661774468074.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74822i5CA33E5A5F706189/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1661774468074.png" alt="Ksharp_0-1661774468074.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 12:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/830872#M41132</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-08-29T12:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regression plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/831093#M41144</link>
      <description>&lt;P&gt;Use the OUTPUT statement in your regression procedure to output the predicted and residual values to a data set. Use PROC SGPLOT to create the plot. You will use two SCATTER statements and a SERIES statement. As Paige says, you'd better hope that the scale of the residuals is such that you can plot both Y and Residuals on the same axis.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
set sashelp.class;
X = Height;
Y = Weight;
keep X Y;
run;

proc reg data=Have plots=none;
   model Y = X;
   output out=RegOut P=Pred R=Resid;
quit;

proc sort data=RegOut;
   by X;
run;

proc sgplot data=RegOut;
   scatter x=X y=Y;   /* origin data */
   series x=X y=Pred; /* regression fit */
   scatter x=x y=Resid / markerattrs=GraphData2;
   refline 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Aug 2022 13:15:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/831093#M41144</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-08-30T13:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regression plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/831384#M41152</link>
      <description>&lt;P&gt;Thank you so much&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 11:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/831384#M41152</guid>
      <dc:creator>userbester1</dc:creator>
      <dc:date>2022-09-01T11:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regression plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/831385#M41153</link>
      <description>Thanks for your help</description>
      <pubDate>Thu, 01 Sep 2022 11:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Regression-plots/m-p/831385#M41153</guid>
      <dc:creator>userbester1</dc:creator>
      <dc:date>2022-09-01T11:11:40Z</dc:date>
    </item>
  </channel>
</rss>

