<?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: gplot and sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372585#M12871</link>
    <description>You were right in trying to fit the curve using the SPLINE, I used the PBSPLINE since the SPLINE statement doesn't have the smooth option. I got the result that I wanted using the gplot sm70.</description>
    <pubDate>Sun, 02 Jul 2017 17:10:13 GMT</pubDate>
    <dc:creator>syk</dc:creator>
    <dc:date>2017-07-02T17:10:13Z</dc:date>
    <item>
      <title>gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372470#M12863</link>
      <description>&lt;P&gt;What is the sgplot equivalent of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;symbol1 i=sm70;
proc gplot data=somefile;
&amp;nbsp; &amp;nbsp; &amp;nbsp;plot resid*x / vref = 0;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got a similar graph from doing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=somefile;
&amp;nbsp; &amp;nbsp; loess x=x y=resid;
&amp;nbsp; &amp;nbsp; refline 0;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it seems like the sm70 smoothing function contributes to creating a slightly different graph from the sgplot. What am I missing from the sgplot?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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/14017iEFD0F6D7DB5433A0/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="gplot.GIF" title="gplot.GIF" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/14018i6956BCB85E161F8C/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="sgplot.GIF" title="sgplot.GIF" /&gt;</description>
      <pubDate>Sun, 02 Jul 2017 05:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372470#M12863</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-07-02T05:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372500#M12864</link>
      <description>&lt;P&gt;Does it make sense to expect a SPLINE to fit a LOESS curve?&lt;/P&gt;
&lt;P&gt;Why not use the SPLINE statement if you want a spline interpolation, which is what sm70 creates?&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/graphref/69717/HTML/default/viewer.htm#n0c0j84n1e2jz9n1bhkn41o3v0d6.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/graphref/69717/HTML/default/viewer.htm#n0c0j84n1e2jz9n1bhkn41o3v0d6.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 04:33:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372500#M12864</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-02T04:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372502#M12865</link>
      <description>&lt;P&gt;To clarify my question, I need to use sgplot instead of gplot beacuse I'm using SAS University Edition. How do I produce the same result using sgplot from the original gplot with symbol1 i=sm70?&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 05:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372502#M12865</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-07-02T05:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372504#M12866</link>
      <description>&lt;P&gt;Can you post some data so we can replicate it to test?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trying to read those images isn't going to cut it for testing.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 06:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372504#M12866</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-02T06:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372508#M12868</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data orig; input age plasma @@;
cards;
0 13.44 0 12.84 0 11.91 0 20.09 0 15.60
1 10.11 1 11.38 1 10.28 1 8.96 1 8.59
2 9.83 2 9.00 2 8.65 2 7.85 2 8.88
3 7.94 3 6.01 3 5.14 3 6.90 3 6.77
4 4.86 4 5.10 4 5.67 4 5.75 4 6.23
;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=orig;
 model plasma=age;
 output out = notrans r = resid;
run;

/*
symbol1 i=sm70;
proc gplot data = notrans;
 plot resid*age / vref = 0; 
*/

proc sgplot data=notrans;
 loess x=age y=resid;
 refline 0;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 07:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372508#M12868</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-07-02T07:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372511#M12869</link>
      <description>&lt;P&gt;Please try the&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;goptions interpol=sm70;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 07:40:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372511#M12869</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-07-02T07:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372576#M12870</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where in the code does the statement have to be inserted?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10078i33E64D39D9D361CF/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="sgplot.GIF" title="sgplot.GIF" width="713" height="85" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10077i4CB024D0FEA2D73E/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="error.GIF" title="error.GIF" width="685" height="213" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 16:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372576#M12870</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-07-02T16:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372585#M12871</link>
      <description>You were right in trying to fit the curve using the SPLINE, I used the PBSPLINE since the SPLINE statement doesn't have the smooth option. I got the result that I wanted using the gplot sm70.</description>
      <pubDate>Sun, 02 Jul 2017 17:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372585#M12871</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-07-02T17:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372591#M12872</link>
      <description>&lt;PRE&gt;proc sgplot data=sashelp.enso;&lt;BR /&gt; pbspline y=pressure x=month;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc gplot data=sashelp.enso;&lt;BR /&gt; symbol1 color=blue i=sm70;&lt;BR /&gt; symbol2 color=red i=none v=circle;&lt;BR /&gt; plot pressure*month&lt;BR /&gt; pressure*month / overlay;&lt;BR /&gt;run; quit;&lt;BR /&gt;&lt;BR /&gt;proc transreg data=sashelp.enso design;&lt;BR /&gt; model ide(pressure) = smooth(month / sm=70);&lt;BR /&gt; output out=b p;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sgplot data=b;&lt;BR /&gt; scatter y=pressure x=month;&lt;BR /&gt; series y=ppressure x=month;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc gplot data=b;&lt;BR /&gt; symbol1 color=blue i=sm70 v=none;&lt;BR /&gt; symbol2 color=red i=none v=circle;&lt;BR /&gt; symbol3 color=green i=none v=square;&lt;BR /&gt; plot pressure*month pressure*month ppressure*month / overlay;&lt;BR /&gt;run; quit;&lt;/PRE&gt;
&lt;P&gt;Personally, I would prefer the penalized b-spline, but I am biased since I wrote it. &amp;nbsp;Decades ago, before ODS, users requested GPLOT smooth functions in an output data set. It was at or near the top of the sasware ballot. I knew GPLOT would never provide it, so I put it in transreg, which fits a lot of other smooth functions. &amp;nbsp;You can then output the smooth function from transreg and put that smooth function into SGPLOT or GPLOT (just to reassure yourself that they are doing the same thing).&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 18:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372591#M12872</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-07-02T18:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372593#M12873</link>
      <description>&lt;P&gt;Your method of creating a data 'b' also works. But for the sake of succinctness sgplot pbspline produced the same result as gplot. Thank you for providing me with a detailed alternative.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 18:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372593#M12873</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-07-02T18:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372599#M12874</link>
      <description>&lt;P&gt;Are you saying you can get &lt;STRONG&gt;precisely&lt;/STRONG&gt; the same results from pbspline in sgplot with a smoothing parameter as you get from gplot and sm70? &amp;nbsp;The two methods are quite different. &amp;nbsp;Or are you saying you can get similar smooths? &amp;nbsp;Thanks in advance for clarifying.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 18:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372599#M12874</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-07-02T18:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372609#M12875</link>
      <description>&lt;P&gt;Not precise but very close. SPLINE statement doesn't provide the smooth option, so I had no other choice other than to use the PBSPLINE.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10079i5C9074BB95C91884/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="sgplot.GIF" title="sgplot.GIF" width="777" height="596" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10080i65FF331796CB6397/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="gplot.GIF" title="gplot.GIF" width="763" height="563" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 18:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372609#M12875</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-07-02T18:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372682#M12878</link>
      <description>&lt;P&gt;You can exactly reproduce the result from PROC GPLOT by using either PROC TRANSREG or PROC IML, as shown in the article &lt;A href="http://blogs.sas.com/content/iml/2014/02/24/add-a-spline-to-a-scatter-plot.html" target="_self"&gt;"Three ways to add a smoothing spline to a scatter plot in SAS."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I recommend&amp;nbsp;one of the statistical fits because then SAS can automatically choose the smoothing parameter based on statistical criteria. See &lt;A href="http://blogs.sas.com/content/iml/2014/02/26/how-to-automatically-select-a-smooth-curve-for-a-scatter-plot-in-sas.html" target="_self"&gt;"How to automatically select a smooth curve for a scatter plot in SAS."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 09:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372682#M12878</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-07-03T09:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372760#M12882</link>
      <description>But for residual plot, the transreg doesn't seem to give me the option to plot a refline.</description>
      <pubDate>Mon, 03 Jul 2017 15:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372760#M12882</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-07-03T15:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372763#M12884</link>
      <description>&lt;P&gt;I'm not sure what you are saying. &amp;nbsp;Transreg makes graphs, but it is not a graphing procedure per se. &amp;nbsp;I just used it to add a variable to the data set that I then showed how to plot with sgplot and how to verify that it matched gplot. &amp;nbsp;You can add reference lines in the usual way to sgplot.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 15:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372763#M12884</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-07-03T15:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372770#M12885</link>
      <description>&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10082iED99E7632E697621/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Capture.GIF" title="Capture.GIF" width="683" height="513" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10083iF1E13E7E781ECF07/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Capture1.GIF" title="Capture1.GIF" width="716" height="273" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 15:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372770#M12885</guid>
      <dc:creator>syk</dc:creator>
      <dc:date>2017-07-03T15:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: gplot and sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372773#M12886</link>
      <description>&lt;P&gt;Transreg is not a plotting procedure. &amp;nbsp;You can't add statements like that to any of the statistical procedures. &amp;nbsp;You can add this statement to sgplot though:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;refline 0 / axis=y;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 15:47:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-and-sgplot/m-p/372773#M12886</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-07-03T15:47:15Z</dc:date>
    </item>
  </channel>
</rss>

