<?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: Plot 3D surface. in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/539192#M17855</link>
    <description>&lt;P&gt;Hi Rick&lt;/P&gt;&lt;P&gt;Many thanks for your help, I used the code you apply, it makes a small difference, but still start from below the 0.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 488px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27566iC8151AF7DB8897A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27567iC9D35B32D14108EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.PNG" alt="2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Feb 2019 00:03:39 GMT</pubDate>
    <dc:creator>samer_badri75</dc:creator>
    <dc:date>2019-02-28T00:03:39Z</dc:date>
    <item>
      <title>Plot 3D surface.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/538543#M17849</link>
      <description>&lt;P&gt;Greeting All&lt;/P&gt;&lt;P&gt;I used the code I attached and I got the 3D surface, the problem&amp;nbsp;is it starts from -40 t0 40, while in the real data the minimum day was 5,&lt;/P&gt;&lt;P&gt;Who can I make the plot start from 5 and Up&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data d;
   input Day Temp RH ;
   label Day = "Reaction Day (Hours)"
         Temp = "Temperature (Degrees Centigrade)"
         RH  = "Percent of humidity";
   datalines;
26	10	90
26	10	90
26	10	90
26	10	90
24	10	90
22	10	90
22	10	90
27	10	90
13	22	76
7	22	75
12	22	75
13	22	75
17	22	75
17	22	75
8	22	75
8	22	75
14	24	78
14	24	78
12	24	78
15	24	78
15	24	78
12	24	77
10	24	76
10	24	76
5	25	63
11	26	62
11	26	62
11	26	62
10	26	62
10	26	62
15	26	94
26	26	94
20	26	94
22	26	94
15	26	63
8	26	62
20	26	94
20	26	94
16	27	94
14	27	95
7	29	66
8	30	69
7	30	74
10	30	74
10	30	74
10	30	74
10	30	74
10	30	74

;
ods graphics on;
proc print data=d;
proc rsreg data=d plots=(ridge surface);
   model Day=RH Temp / lackfit;
   ridge max;
run;
proc rsreg data=d 
              plots =surface(3d);
      model Day = Temp RH;
      ods select 'Temp * RH = Pred';
   run;
   ods graphics off;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27474i0CCDEA5B0DC0FE44/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 02:31:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/538543#M17849</guid>
      <dc:creator>samer_badri75</dc:creator>
      <dc:date>2019-02-26T02:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Plot 3D surface.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/538629#M17850</link>
      <description>&lt;P&gt;You are plotting the PREDICTED surface, which is not constrained by the range of the data. The predicted surface is evaluated on a rectangular regions&amp;nbsp;[min(RH), max(RH)] x [min(Temp), max[Temp)], and this model has a minimum predicted value when (RH, Temp) are both small.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default, PROC RSREG&amp;nbsp;extends the rectangular domain by 10% beyond the range of the data. You can use the EXTEND=0 option to tell it not to extrapolate beyond the data range. The code would look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc rsreg data=d plots=(ridge surface(EXTEND=0));
   model Day=RH Temp / lackfit;
   ridge max;
run;

proc rsreg data=d plots =surface(3d EXTEND=0);
   model Day = Temp RH;
   ods select 'Temp * RH = Pred';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You have another option, which you might prefer. The steps are:&lt;/P&gt;
&lt;P&gt;1. &lt;A href="https://blogs.sas.com/content/iml/2014/02/17/the-missing-value-trick-for-scoring-a-regression-model.html" target="_self"&gt;Score the model on a regular grid&amp;nbsp;&lt;/A&gt;and use the OUT= option to write the predicted values to a data set.&lt;/P&gt;
&lt;P&gt;2. Use a DATA step to set the predicted values to missing when the predicted values are less than zero (or 5, if you prefer)&lt;/P&gt;
&lt;P&gt;3. &lt;A href="https://blogs.sas.com/content/iml/2015/10/12/create-surface-plot-sas.html" target="_self"&gt;Use PROC SGRENDER to generate the surface plot.&lt;/A&gt;&amp;nbsp;Only the nonmissing&amp;nbsp;predicted values will be displayed as part of the surface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 13:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/538629#M17850</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-02-26T13:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Plot 3D surface.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/539192#M17855</link>
      <description>&lt;P&gt;Hi Rick&lt;/P&gt;&lt;P&gt;Many thanks for your help, I used the code you apply, it makes a small difference, but still start from below the 0.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 488px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27566iC8151AF7DB8897A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27567iC9D35B32D14108EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.PNG" alt="2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 00:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/539192#M17855</guid>
      <dc:creator>samer_badri75</dc:creator>
      <dc:date>2019-02-28T00:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Plot 3D surface.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/544555#M17933</link>
      <description>&lt;P&gt;Here are a few of my thoughts about this topic:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Why it happens: &lt;A href="https://blogs.sas.com/content/iml/2019/03/18/interpolation-extrapolation-convex-hull.html" target="_self"&gt;Extrapolation versus interpolation in multivariate data&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2019/03/20/truncate-response-surfaces.html" target="_self"&gt;How to truncate a response surface&lt;/A&gt; so that it does not show negative values&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;By using these ideas and the associated SAS code, you can truncate the surface or contour plot, as you requested.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rsreg2.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28061i59104FF5F794768B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rsreg2.png" alt="rsreg2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 13:27:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/544555#M17933</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-03-20T13:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Plot 3D surface.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/695854#M20658</link>
      <description>&lt;P&gt;Greeting Rick&lt;/P&gt;&lt;P&gt;Is there a chance to optimize three variables by adding a code for that?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 08:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-3D-surface/m-p/695854#M20658</guid>
      <dc:creator>samer_badri75</dc:creator>
      <dc:date>2020-11-02T08:30:29Z</dc:date>
    </item>
  </channel>
</rss>

