<?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 plot nonlinear regression/equation onto a scatter plot in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/plot-nonlinear-regression-equation-onto-a-scatter-plot/m-p/237477#M1475</link>
    <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a bit embarrassed to ask this, but I'm really not understanding how to plot a nonlinear regression onto a scatter plot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I've learned how to use the PROC NLIN procedure in SAS and have been able to generate the same output from an online tutorial:&amp;nbsp;&lt;A href="http://www.ats.ucla.edu/stat/sas/faq/doseresponse.htm" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/faq/doseresponse.htm&lt;/A&gt; (yay!). &amp;nbsp;However, I'm running into a wall when I'm trying to figure out how well the data fits the parameters predicted by SAS. &amp;nbsp;I want to visually check the predicted variables just in case I need to adjust my starting parameters as indicated in my PARMS procedure. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the following syntax for plotting my data&amp;amp;colon;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;PROC IMPORT DATAFILE="C:/Users/jessica/Desktop/SAS/SASUniversityEdition/myfolders/Practice test data.xlsx"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;OUT= Work.DoseResp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;DBMS=XLSX&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;REPLACE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;SHEET="DoseResp";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;PROC NLIN Data=DoseResp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;PARMS top = 68.875 bottom = 20.575 EC50 = 1 hill = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;MODEL response = top + (bottom - top) / (1 + (concentration / EC50)**hill);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;data TestNLIN;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;x=1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;do i=0 to 1000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;Response = 59.1022 + ( 27.0807 - 59.1022)/(1 + (x/0.8171)**12.4058);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;output;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;x=x+10;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;PROC SGPLOT data = TestNLIN;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;scatter x = x y = Response;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;yaxis values = (20 to 70 by 10);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;xaxis values = (0 to 1000);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;&lt;SPAN&gt;PROC SGPLOT&amp;nbsp;&lt;/SPAN&gt;data=DoseResp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;Scatter x=Concentration y=response;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;yaxis values = (20 to 70 by 10);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;xaxis values = (0 to 1000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a better way of plotting a nonlinear regression/plot onto a scatter plot? &amp;nbsp;Or any other means to visually check how well the data fits to the parameters estimated by SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jess&lt;/P&gt;</description>
    <pubDate>Wed, 02 Dec 2015 21:56:00 GMT</pubDate>
    <dc:creator>j10leung</dc:creator>
    <dc:date>2015-12-02T21:56:00Z</dc:date>
    <item>
      <title>plot nonlinear regression/equation onto a scatter plot</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/plot-nonlinear-regression-equation-onto-a-scatter-plot/m-p/237477#M1475</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a bit embarrassed to ask this, but I'm really not understanding how to plot a nonlinear regression onto a scatter plot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I've learned how to use the PROC NLIN procedure in SAS and have been able to generate the same output from an online tutorial:&amp;nbsp;&lt;A href="http://www.ats.ucla.edu/stat/sas/faq/doseresponse.htm" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/faq/doseresponse.htm&lt;/A&gt; (yay!). &amp;nbsp;However, I'm running into a wall when I'm trying to figure out how well the data fits the parameters predicted by SAS. &amp;nbsp;I want to visually check the predicted variables just in case I need to adjust my starting parameters as indicated in my PARMS procedure. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the following syntax for plotting my data&amp;amp;colon;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;PROC IMPORT DATAFILE="C:/Users/jessica/Desktop/SAS/SASUniversityEdition/myfolders/Practice test data.xlsx"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;OUT= Work.DoseResp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;DBMS=XLSX&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;REPLACE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;SHEET="DoseResp";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;PROC NLIN Data=DoseResp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;PARMS top = 68.875 bottom = 20.575 EC50 = 1 hill = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;MODEL response = top + (bottom - top) / (1 + (concentration / EC50)**hill);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;data TestNLIN;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;x=1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;do i=0 to 1000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;Response = 59.1022 + ( 27.0807 - 59.1022)/(1 + (x/0.8171)**12.4058);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;output;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;x=x+10;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;PROC SGPLOT data = TestNLIN;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;scatter x = x y = Response;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;yaxis values = (20 to 70 by 10);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;xaxis values = (0 to 1000);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;&lt;SPAN&gt;PROC SGPLOT&amp;nbsp;&lt;/SPAN&gt;data=DoseResp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;Scatter x=Concentration y=response;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;yaxis values = (20 to 70 by 10);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;xaxis values = (0 to 1000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a better way of plotting a nonlinear regression/plot onto a scatter plot? &amp;nbsp;Or any other means to visually check how well the data fits to the parameters estimated by SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jess&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 21:56:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/plot-nonlinear-regression-equation-onto-a-scatter-plot/m-p/237477#M1475</guid>
      <dc:creator>j10leung</dc:creator>
      <dc:date>2015-12-02T21:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: plot nonlinear regression/equation onto a scatter plot</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/plot-nonlinear-regression-equation-onto-a-scatter-plot/m-p/237486#M1476</link>
      <description>&lt;P&gt;Add some data with missing response values before NLIN so that you get predicted values which you can than plot. Here is an outline:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pred;
do concentration = 0 to 1000 by 10;
	output;
	end;
run;

data DR;
set DoseResp pred;
run;
 
PROC NLIN Data=DR;
PARMS top = 68.875 bottom = 20.575 EC50 = 1 hill = 1;
MODEL response = top + (bottom - top) / (1 + (concentration / EC50)**hill);
output out=DRgraph predicted=responsePred;
run;

proc sort data=DRgraph; by concentration; run;

proc sgplot data=DRgraph;
scatter x=concentration y=response;
series x=concentration y=responsePred;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(untested)&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2015 16:18:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/plot-nonlinear-regression-equation-onto-a-scatter-plot/m-p/237486#M1476</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-12-03T16:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: plot nonlinear regression/equation onto a scatter plot</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/plot-nonlinear-regression-equation-onto-a-scatter-plot/m-p/237611#M1477</link>
      <description>&lt;P&gt;&amp;nbsp;Thank you PG Stats! &amp;nbsp;That worked perfect!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just in case someone else runs into the same problem as I did, I thought I would post my syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Import Excel file*&lt;/P&gt;&lt;P&gt;PROC IMPORT DATAFILE="C:/Users/jessica/Desktop/SAS/SASUniversityEdition/myfolders/Practice test data.xlsx"&lt;BR /&gt;OUT= Work.DoseResp&lt;BR /&gt;DBMS=XLSX&lt;BR /&gt;REPLACE;&lt;BR /&gt;SHEET="DoseResp";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Set Data Set*&lt;/P&gt;&lt;P&gt;DATA pred;&lt;BR /&gt;DO concentration = 0 to 1000 by 10;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;SET DoseResp;&lt;BR /&gt;SET DoseResp pred;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Use Nonlinear Regression to predict unknow parameters*&lt;BR /&gt;PROC NLIN Data=DoseResp;&lt;BR /&gt;PARMS top = 68.875 bottom = 20.575 EC50 = 1 hill = 1;&lt;BR /&gt;MODEL response = top + (bottom - top) / (1 + (concentration / EC50)**hill);&lt;BR /&gt;output out=DRgraph predicted=responsePred;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Plot data*&lt;/P&gt;&lt;P&gt;proc sort data=DRgraph; by concentration; run;&lt;/P&gt;&lt;P&gt;proc sgplot data=DRgraph;&lt;BR /&gt;scatter x=concentration y=response;&lt;BR /&gt;series x=concentration y=responsePred;&lt;BR /&gt;run;&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/12113i0450EC5336775986/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Dose Response Image.png" title="Dose Response Image.png" /&gt;</description>
      <pubDate>Thu, 03 Dec 2015 16:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/plot-nonlinear-regression-equation-onto-a-scatter-plot/m-p/237611#M1477</guid>
      <dc:creator>j10leung</dc:creator>
      <dc:date>2015-12-03T16:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: plot nonlinear regression/equation onto a scatter plot</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/plot-nonlinear-regression-equation-onto-a-scatter-plot/m-p/246198#M1557</link>
      <description>&lt;P&gt;PGStats's solution is a particular case of the general problem of scoring a model on a grid of regularly spaced points. For other options, see&amp;nbsp; &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>Tue, 26 Jan 2016 19:25:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/plot-nonlinear-regression-equation-onto-a-scatter-plot/m-p/246198#M1557</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-01-26T19:25:01Z</dc:date>
    </item>
  </channel>
</rss>

