<?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: Basics of proc iml in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894773#M6080</link>
    <description>&lt;P&gt;Why not post it at IML forum, since it is about IML question. and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; is there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x y;
cards;
1  0.83
2 7.48
3 14.45
4 12.70
5 20.46
6 25.73
;

proc iml;
use have;
read all var {x y};
close;

x=j(nrow(x),1,1)||x;
xt=t(x);
xtx=xt*x;
xtx_inv=inv(xtx);
xty=xt*y;
b=solve(xtx,xty);
bb=inv(t(x)*x)*t(x)*y; /*another way to get BETA*/
e=y-x*b;

print x,xt,xtx,xtx_inv,xty,b ,bb ,e;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Sep 2023 12:22:04 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2023-09-18T12:22:04Z</dc:date>
    <item>
      <title>Basics of proc iml</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894728#M6077</link>
      <description>&lt;P&gt;Does anyone know what is wrong with this code:&lt;/P&gt;&lt;P&gt;proc iml;&lt;BR /&gt;x={1,&lt;BR /&gt;2,&lt;BR /&gt;3,&lt;BR /&gt;4,&lt;BR /&gt;5,&lt;BR /&gt;6};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;xt=t(x);&lt;BR /&gt;print transpose;&lt;/P&gt;&lt;P&gt;Using this data, I am expected to find x', x'x, x'x inverse,&amp;nbsp;&lt;STRONG&gt;X’Y,&amp;nbsp;b = (X’X)-1X’Y,&amp;nbsp;e = Y-Xb, etc. Does anyone know how to best do this?&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;X&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Y&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp; 0.83&lt;/P&gt;&lt;P&gt;&amp;nbsp; 7.48&lt;/P&gt;&lt;P&gt;14.45&lt;/P&gt;&lt;P&gt;12.70&lt;/P&gt;&lt;P&gt;20.46&lt;/P&gt;&lt;P&gt;25.73&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 02:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894728#M6077</guid>
      <dc:creator>EricB40</dc:creator>
      <dc:date>2023-09-18T02:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Basics of proc iml</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894753#M6078</link>
      <description>&lt;P&gt;Have a look at the results when you run this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
   /* transpose a matrix */
   s = {1 2 3, 4 5 6, 7 8 9, 10 11 12}; /* 4 x 3 matrix */
   transpose = t(s); /* 3 x 4 matrix */
   print transpose;
run;

proc iml;
   x = {1, 2, 3, 4, 5, 6};
   xt = t(x);
   print xt;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Sep 2023 08:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894753#M6078</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2023-09-18T08:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Basics of proc iml</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894759#M6079</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/450712"&gt;@EricB40&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using this data, I am expected to find x', x'x, x'x inverse,&amp;nbsp;&lt;STRONG&gt;X’Y,&amp;nbsp;b = (X’X)-1X’Y,&amp;nbsp;e = Y-Xb, etc. Does anyone know how to best do this?&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You turn these formulas into the appropriate PROC IML code. It should be very straighforward, the actual math formulas have a very simple and easy-to-understand representation in code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x'x in IML code is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;t(x)*x&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to do this for the rest of the functions you need. Show us what you have tried.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 11:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894759#M6079</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-09-18T11:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Basics of proc iml</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894773#M6080</link>
      <description>&lt;P&gt;Why not post it at IML forum, since it is about IML question. and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; is there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x y;
cards;
1  0.83
2 7.48
3 14.45
4 12.70
5 20.46
6 25.73
;

proc iml;
use have;
read all var {x y};
close;

x=j(nrow(x),1,1)||x;
xt=t(x);
xtx=xt*x;
xtx_inv=inv(xtx);
xty=xt*y;
b=solve(xtx,xty);
bb=inv(t(x)*x)*t(x)*y; /*another way to get BETA*/
e=y-x*b;

print x,xt,xtx,xtx_inv,xty,b ,bb ,e;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 12:22:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894773#M6080</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-09-18T12:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Basics of proc iml</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894774#M6081</link>
      <description>&lt;A href="https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/bd-p/sas_iml" target="_blank"&gt;https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/bd-p/sas_iml&lt;/A&gt;</description>
      <pubDate>Mon, 18 Sep 2023 12:23:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Basics-of-proc-iml/m-p/894774#M6081</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-09-18T12:23:16Z</dc:date>
    </item>
  </channel>
</rss>

