<?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 Graph a mathematical function in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Graph-a-mathematical-function/m-p/248929#M56488</link>
    <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Aside from simulating data in a data step and then use a procedure such as PLOT, GPLOT, SGPLOT, etc. is there any way to graph a mathematical function (say y = x**2) by simply inputting the function and requesting a graph?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For me, the go-to method was the above, i.e. simulate the data first and then plot it, but I thought there might be some function out there (or something in either EG or IML Studio perhaps) that would do the trick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your input&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Feb 2016 16:34:43 GMT</pubDate>
    <dc:creator>Daniel</dc:creator>
    <dc:date>2016-02-09T16:34:43Z</dc:date>
    <item>
      <title>Graph a mathematical function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Graph-a-mathematical-function/m-p/248929#M56488</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Aside from simulating data in a data step and then use a procedure such as PLOT, GPLOT, SGPLOT, etc. is there any way to graph a mathematical function (say y = x**2) by simply inputting the function and requesting a graph?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For me, the go-to method was the above, i.e. simulate the data first and then plot it, but I thought there might be some function out there (or something in either EG or IML Studio perhaps) that would do the trick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your input&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 16:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Graph-a-mathematical-function/m-p/248929#M56488</guid>
      <dc:creator>Daniel</dc:creator>
      <dc:date>2016-02-09T16:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Graph a mathematical function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Graph-a-mathematical-function/m-p/249008#M56490</link>
      <description>&lt;P&gt;Took me about 30 seconds to write&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data function;
do x = -1 to 4 by 0.05;
    y = x**2;
    output;
    end;
run;

proc sgplot data=function;
series x=x y=y;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and get a decent basic graph. SAS software (GTL, SG, SAS/GRAPH, even JMP) doesn't graph user-specified functions, only data.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 18:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Graph-a-mathematical-function/m-p/249008#M56490</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-02-09T18:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Graph a mathematical function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Graph-a-mathematical-function/m-p/249183#M56505</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;&amp;nbsp;shows the usual method.&amp;nbsp; Since you mentioned IML, I'm thinking that perhaps your function is defined by a function module? If so, you can use a similar approach from inside SAS/IML:&lt;/P&gt;
&lt;PRE&gt;proc iml;
start MyFunc(x);
   return( x##2 );
finish;

t = do(-2, 2, 0.1);
call series(t, MyFunc(t));&lt;/PRE&gt;
&lt;P&gt;From inside&amp;nbsp;SAS/IML Studio you can get an interactive plot by using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LinePlot.Create("function plot", t, MyFunc(t));&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 13:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Graph-a-mathematical-function/m-p/249183#M56505</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-02-10T13:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Graph a mathematical function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Graph-a-mathematical-function/m-p/249824#M56559</link>
      <description>&lt;P&gt;Just to clear up a misconception, &lt;A href="http://jmp.com" target="_blank"&gt;JMP&lt;/A&gt; will plot functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the &lt;A href="http://www.jmp.com/support/help/Example_Using_Graph_Builder.shtml" target="_blank"&gt;Formula Element&lt;/A&gt; in Graph Builder or for more flexibility the &lt;A href="http://www.jmp.com/support/help/Graphing_Elements.shtml" target="_self"&gt;Y Function()&lt;/A&gt;&amp;nbsp;in graphic scripting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For functions in more than two dimensions the various &lt;A href="http://www.jmp.com/support/help/Profilers.shtml" target="_blank"&gt;Profilers&lt;/A&gt; in JMP offer the ultimate flexibility.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Jeff&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 21:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Graph-a-mathematical-function/m-p/249824#M56559</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2016-02-12T21:35:47Z</dc:date>
    </item>
  </channel>
</rss>

