<?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 How to plot regression line using just some part of points in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310663#M10936</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have data with two variables: month and total. &amp;nbsp;Data containes of 70 observations. I want to plot a graph similar to the graph shown below:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://ije.oxfordjournals.org/content/early/2016/06/13/ije.dyw098/F1.large.jpg" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2016 13:57:27 GMT</pubDate>
    <dc:creator>viollete</dc:creator>
    <dc:date>2016-11-10T13:57:27Z</dc:date>
    <item>
      <title>How to plot regression line using just some part of points</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310663#M10936</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have data with two variables: month and total. &amp;nbsp;Data containes of 70 observations. I want to plot a graph similar to the graph shown below:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://ije.oxfordjournals.org/content/early/2016/06/13/ije.dyw098/F1.large.jpg" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 13:57:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310663#M10936</guid>
      <dc:creator>viollete</dc:creator>
      <dc:date>2016-11-10T13:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot regression line using just some part of points</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310669#M10937</link>
      <description>&lt;P&gt;So what precisely is your question?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have have no idea where to strait I suggest robslink.com and/or SGPLOT documentation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think a BLOCK statement or POLYGON along with series or Reg line will work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 14:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310669#M10937</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-10T14:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot regression line using just some part of points</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310674#M10938</link>
      <description>&lt;P&gt;If I &amp;nbsp;used this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc sgplot data=example;&lt;/P&gt;
&lt;P&gt;scatter x=month y=total;&lt;/P&gt;
&lt;P&gt;reg x=month y=total;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the reg statement would use all data point to plot regression line, but I want that it would use just first 59 point, but the line would plot for all datapoints. I want to see, if graphically it is visible that there is any change after point 60&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 14:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310674#M10938</guid>
      <dc:creator>viollete</dc:creator>
      <dc:date>2016-11-10T14:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot regression line using just some part of points</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310676#M10939</link>
      <description>&lt;P&gt;To me, this graph&amp;nbsp;looks like a TimeSeries forecast plot, with the fit computed from the data on the left, and projected into future. If you need the fit line computed this way, I suggest posting on the "SAS Forecasting and Econometrics" community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have already computed the regression line as shown,&amp;nbsp;then it is easy to plot it like you want using SGPLOT procedure. &amp;nbsp;First, break up the Y data into two columns (Y1, Y2), one for the left dates (with missing values for the rest), one for the right. &amp;nbsp;Then, use two series plot statements to draw each line, Y1 x date and Y2 x date using two different line patterns. &amp;nbsp;With SAS9.40M3, you can use a block plot to draw the shaded regions and also draw the axis lines like in the graph by using the AxisExtent=Data option on the STYLEATTRS statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 14:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310676#M10939</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-11-10T14:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot regression line using just some part of points</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310680#M10940</link>
      <description>&lt;P&gt;Use the BLOCK statement in PROC SGPLOT for the background. You can use style attributes and the GROUP= option in the SERIES statement to change the line style from solid to dashed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A;
BlockID="History   ";
do x = 0 to 10 by 0.1;
   y = sin(x);
   output;
end;
BlockID="Prediction";
do x = 10 to 15 by 0.1;
   y = sin(x);
   output;
end;

run;

ods graphics / attrpriority=none;
proc sgplot data=A;
styleattrs DATALINEPATTERNS=(solid dash);
block x=x block=BlockID / transparency=0.5; 
series x=x y=y / group=BlockID lineattrs=(color=black thickness=3);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5750i10435B91A9A4FFFD/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="capture.png" title="capture.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 14:44:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-regression-line-using-just-some-part-of-points/m-p/310680#M10940</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-11-10T14:44:03Z</dc:date>
    </item>
  </channel>
</rss>

