<?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 Using  IML or macro language for normal distribution function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564428#M158319</link>
    <description>&lt;P&gt;I will like to write a code for&amp;nbsp;values of x = (-0.1, 0.0, 0.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;write code to calculate L (x ; mu = 0, sigma = 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In R code (L &amp;lt;-function(x, u=0, s2=1)(sqrt(2*pi*s2))^-1*exp(-(x-u)^2/(2*s2))&lt;BR /&gt;x&amp;lt;-c(-0.1,0.0, 0.1)&lt;BR /&gt;L(-0.1)&lt;/P&gt;&lt;P&gt;L(0.0)&lt;/P&gt;&lt;P&gt;L(0.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2019 10:55:12 GMT</pubDate>
    <dc:creator>Lawongd</dc:creator>
    <dc:date>2019-06-07T10:55:12Z</dc:date>
    <item>
      <title>Using  IML or macro language for normal distribution function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564428#M158319</link>
      <description>&lt;P&gt;I will like to write a code for&amp;nbsp;values of x = (-0.1, 0.0, 0.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;write code to calculate L (x ; mu = 0, sigma = 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In R code (L &amp;lt;-function(x, u=0, s2=1)(sqrt(2*pi*s2))^-1*exp(-(x-u)^2/(2*s2))&lt;BR /&gt;x&amp;lt;-c(-0.1,0.0, 0.1)&lt;BR /&gt;L(-0.1)&lt;/P&gt;&lt;P&gt;L(0.0)&lt;/P&gt;&lt;P&gt;L(0.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 10:55:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564428#M158319</guid>
      <dc:creator>Lawongd</dc:creator>
      <dc:date>2019-06-07T10:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using  IML or macro language for normal distribution function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564452#M158332</link>
      <description>&lt;P&gt;what have you tried,&amp;nbsp; please post more than just your assignment. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to create a data-step version of your data&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/help/faqpage/faq-category-id/posting#posting" target="_blank"&gt;https://communities.sas.com/t5/help/faqpage/faq-category-id/posting#posting&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;How to Add attachments&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/Community-Memo/Adding-attachments-to-your-communities-posts/ba-p/464767" target="_blank"&gt;https://communities.sas.com/t5/Community-Memo/Adding-attachments-to-your-communities-posts/ba-p/464767&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 12:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564452#M158332</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-06-07T12:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using  IML or macro language for normal distribution function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564509#M158364</link>
      <description>&lt;P&gt;Thanks to everyone who helped me have a better understanding of how this works.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 16:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564509#M158364</guid>
      <dc:creator>Lawongd</dc:creator>
      <dc:date>2019-06-07T16:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using  IML or macro language for normal distribution function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564661#M158408</link>
      <description>&lt;P&gt;Try PDF() function. And post it at IML forum , calling &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 14:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564661#M158408</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-06-08T14:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using  IML or macro language for normal distribution function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564742#M158437</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As KSharp points out, your function is the PDF of the normal distribution. The PDF function is &lt;A href="https://blogs.sas.com/content/iml/2011/10/19/four-essential-functions-for-statistical-programmers.html" target="_self"&gt;one of several built-in functions for working with probability distributions&lt;/A&gt;, so you can just call the PDF function directly. You can call it from the DATA step or from PROC IML:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Want;
do x = -0.1 to 0.1 by 0.1;
   y = pdf("Normal", x); /* default is u=0, s=1 */
   output;
end;
run;
proc print; run;

proc iml;
x = {-0.1, 0, 0.1};
y = pdf("Normal", x); /* default is u=0, s=1 */
print x y;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the goal of the exercise is to define a SAS/IML function module. see the article &lt;A href="https://blogs.sas.com/content/iml/2015/06/17/everything-about-modules.html" target="_self"&gt;"Everything you wanted to know about writing SAS/IML modules."&lt;/A&gt;&amp;nbsp;which discusses how to define functions and how to define default arguments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2019 10:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-IML-or-macro-language-for-normal-distribution-function/m-p/564742#M158437</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-06-09T10:29:52Z</dc:date>
    </item>
  </channel>
</rss>

