<?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 display Regression Line and R-Squared value in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-display-Regression-Line-and-R-Squared-value/m-p/294993#M10391</link>
    <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I amting two get different regression line plots, when I use PROC REG&amp;nbsp;and when I use proc gplot see below, could you help me why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;For R squared value using proc reg&lt;/P&gt;
&lt;P&gt;proc reg data = plot_data outest=reg_val outsscp=sscp1 rsquare;&lt;BR /&gt;model yaxis = xaxis ;&lt;BR /&gt;plot yaxis*xaxis;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for scatter plot using gplot&lt;/P&gt;
&lt;P&gt;symbol1 i=none v=dot w=2 l=3 h=4 color=blue;&lt;BR /&gt;symbol2 i=none v=C w=2 l=4 h=2.5 f=marker color=red;&lt;BR /&gt;symbol3 i=none v=U w=2 l=4 h=2.5 f=marker color=green;&lt;BR /&gt;symbol4 i=none w=2 l=3 h=3 i=rl color=black;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc gplot data = plot_data anno= anno1 ;&lt;BR /&gt;plot yaxis*xaxis=cohort_no /vaxis=axis1 haxis=axis2 nolegend noframe;&lt;BR /&gt;plot2 yaxis*xaxis/ noaxis;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12900i4870FE6BF1AA3E21/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Proc gplot.png" title="Proc gplot.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12901i33D0271A176CC2D9/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Proc Reg.png" title="Proc Reg.png" /&gt;</description>
    <pubDate>Mon, 29 Aug 2016 22:45:23 GMT</pubDate>
    <dc:creator>sfo</dc:creator>
    <dc:date>2016-08-29T22:45:23Z</dc:date>
    <item>
      <title>How to display Regression Line and R-Squared value</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-display-Regression-Line-and-R-Squared-value/m-p/294716#M10378</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have SAS 9.2 and I need to display the linear regression line and R-Squared or the p-value on the plot. I have three groups and my plot looks something like attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to display the regression line superimposed on&amp;nbsp;the colored dots? I am trying the following for scatter plot and regression analysis:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc gplot data = plot_data anno= anno ;&lt;BR /&gt;plot yaxis*xaxis=cohort_no /vaxis=axis1 haxis=axis nolegend noframe;&lt;BR /&gt;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc reg data = plot_data anno= anno1 ;&lt;BR /&gt;model yaxis = xaxis;&lt;BR /&gt;plot yaxis*xaxis ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12890i68DB4551D71154CC/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Plot.png" title="Plot.png" /&gt;</description>
      <pubDate>Mon, 29 Aug 2016 07:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-display-Regression-Line-and-R-Squared-value/m-p/294716#M10378</guid>
      <dc:creator>sfo</dc:creator>
      <dc:date>2016-08-29T07:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Regression Line and R-Squared value</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-display-Regression-Line-and-R-Squared-value/m-p/294760#M10379</link>
      <description>&lt;P&gt;Most statisticians do not use the old PLOTS statement anymore. Instead, most use ODS statistical graphics, which are produced automatically by most SAS/STAT procedures. See the following two examples:&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=FitPlot(stats=DEFAULT);
model weight = height;
quit;

proc glm data =sashelp.class plots=FitPlot;
class sex;
model weight = height | sex;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For an overview, see Rodriguez (2009)&lt;A href="http://support.sas.com/resources/papers/76824_intodsgraph.pdf" target="_self"&gt; "Getting Started with ODS Statistical Graphics in SAS 9.2."&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 11:36:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-display-Regression-Line-and-R-Squared-value/m-p/294760#M10379</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-08-29T11:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Regression Line and R-Squared value</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-display-Regression-Line-and-R-Squared-value/m-p/294842#M10387</link>
      <description>&lt;P&gt;If you want to continue with GPLOT your solution would involve setting a Symbol statement to show the desired regression for each level of your cohort_no.&lt;/P&gt;
&lt;P&gt;Something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;symbol1 i=RL color=red;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;i or Interpol option R is for regression options are availble for showing confidence limits of individual responses or the mean and the interval for the confidence limits as well.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 14:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-display-Regression-Line-and-R-Squared-value/m-p/294842#M10387</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-29T14:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Regression Line and R-Squared value</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-display-Regression-Line-and-R-Squared-value/m-p/294993#M10391</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I amting two get different regression line plots, when I use PROC REG&amp;nbsp;and when I use proc gplot see below, could you help me why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;For R squared value using proc reg&lt;/P&gt;
&lt;P&gt;proc reg data = plot_data outest=reg_val outsscp=sscp1 rsquare;&lt;BR /&gt;model yaxis = xaxis ;&lt;BR /&gt;plot yaxis*xaxis;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for scatter plot using gplot&lt;/P&gt;
&lt;P&gt;symbol1 i=none v=dot w=2 l=3 h=4 color=blue;&lt;BR /&gt;symbol2 i=none v=C w=2 l=4 h=2.5 f=marker color=red;&lt;BR /&gt;symbol3 i=none v=U w=2 l=4 h=2.5 f=marker color=green;&lt;BR /&gt;symbol4 i=none w=2 l=3 h=3 i=rl color=black;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc gplot data = plot_data anno= anno1 ;&lt;BR /&gt;plot yaxis*xaxis=cohort_no /vaxis=axis1 haxis=axis2 nolegend noframe;&lt;BR /&gt;plot2 yaxis*xaxis/ noaxis;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12900i4870FE6BF1AA3E21/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Proc gplot.png" title="Proc gplot.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12901i33D0271A176CC2D9/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Proc Reg.png" title="Proc Reg.png" /&gt;</description>
      <pubDate>Mon, 29 Aug 2016 22:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-display-Regression-Line-and-R-Squared-value/m-p/294993#M10391</guid>
      <dc:creator>sfo</dc:creator>
      <dc:date>2016-08-29T22:45:23Z</dc:date>
    </item>
  </channel>
</rss>

