<?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: R-squared on proc sgplot graph in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/R-squared-on-proc-sgplot-graph/m-p/700591#M214414</link>
    <description>&lt;P&gt;Here is an example using proc reg:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=sashelp.cars plots=none;
where cylinders=4;
model horsepower = engineSize / rsquare;
output out=preds predicted=p_horsePower;
/* Use ods to output the r-square value into a dataset */
ods output fitStatistics=fs;
run;
quit;

/* Transfer the r-square value to a macro variable named RSQ */
data _null_;
set fs;
where label2="Adj R-Sq";
call symputx("RSQ", put(nvalue2, percentn7.1));
run;

proc sort data=preds; by engineSize; run;

proc sgplot data=preds noautolegend;
title "Horse Power for 4-cylinder engines";
scatter y=horsePower x=engineSize;
series y=p_horsePower x=engineSize;
inset ("Adj. R-Square:" = "&amp;amp;RSQ") / position=bottomright;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 647px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51892iE5E3824AC09F6354/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Nov 2020 18:58:52 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2020-11-20T18:58:52Z</dc:date>
    <item>
      <title>R-squared on proc sgplot graph</title>
      <link>https://communities.sas.com/t5/SAS-Programming/R-squared-on-proc-sgplot-graph/m-p/700567#M214407</link>
      <description>&lt;P&gt;Using SAS 9.4&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to take the r-squared from&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc reg data= pt.eligible;&lt;BR /&gt;model impingment_point = ptp_translation /selection=rsquare;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and add it to the graph I have using proc sgplot?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data = pt.eligible;&lt;BR /&gt;scatter x=ptp_translation y=impingment_point;&lt;BR /&gt;yaxis min=0 max=140 label = 'Distance to Impingement of 12 mm Stem Against Endosteal Surface';&lt;BR /&gt;xaxis min=0 max=40 label = 'Percentage Translation Between Sagittal Anatomic Axis and Joint Line Center';&lt;BR /&gt;title 'Proximal Tibial Translation and Distance to Impingement of a 12 mm Tibial Stem'; &lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 17:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/R-squared-on-proc-sgplot-graph/m-p/700567#M214407</guid>
      <dc:creator>GS2</dc:creator>
      <dc:date>2020-11-20T17:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: R-squared on proc sgplot graph</title>
      <link>https://communities.sas.com/t5/SAS-Programming/R-squared-on-proc-sgplot-graph/m-p/700570#M214408</link>
      <description>&lt;P&gt;How do you want it to appear?&lt;/P&gt;
&lt;P&gt;Since you are not using an output dataset from Proc Reg you might try adding a footnote or title with the text and value.&lt;/P&gt;
&lt;P&gt;Or create an annotate data set with the value and appearance options you want.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 17:45:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/R-squared-on-proc-sgplot-graph/m-p/700570#M214408</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-20T17:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: R-squared on proc sgplot graph</title>
      <link>https://communities.sas.com/t5/SAS-Programming/R-squared-on-proc-sgplot-graph/m-p/700591#M214414</link>
      <description>&lt;P&gt;Here is an example using proc reg:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=sashelp.cars plots=none;
where cylinders=4;
model horsepower = engineSize / rsquare;
output out=preds predicted=p_horsePower;
/* Use ods to output the r-square value into a dataset */
ods output fitStatistics=fs;
run;
quit;

/* Transfer the r-square value to a macro variable named RSQ */
data _null_;
set fs;
where label2="Adj R-Sq";
call symputx("RSQ", put(nvalue2, percentn7.1));
run;

proc sort data=preds; by engineSize; run;

proc sgplot data=preds noautolegend;
title "Horse Power for 4-cylinder engines";
scatter y=horsePower x=engineSize;
series y=p_horsePower x=engineSize;
inset ("Adj. R-Square:" = "&amp;amp;RSQ") / position=bottomright;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 647px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51892iE5E3824AC09F6354/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 18:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/R-squared-on-proc-sgplot-graph/m-p/700591#M214414</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-11-20T18:58:52Z</dc:date>
    </item>
  </channel>
</rss>

