<?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 IML code problem in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-code-problem/m-p/307152#M3064</link>
    <description>&lt;P&gt;When I try to rewrite the orginal code to fit my data, it always appears that "ERROR: (execution) Matrix has not been set to a value.".&lt;BR /&gt;But I don't know where can I correct them. By the way, I want to know how to store het_y into a column form.&lt;/P&gt;&lt;P&gt;Thanks a million.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc IML;
use work.jb_test_data;
read point (1:252) var{BIDLO ASKHI PRC VOL RET} into m;

n=nrow(m); r=ncol(m);
y=m[,5]; x=shape(1,n,1)||m[ ,1:2:3:4];

beta=inv(t(x)*x)*t(x)*y;
sigma=sqrt(t(y-x*beta)*(y-x*beta)/(n-r));
se=sigma*sqrt(vecdiag(inv(t(x)*x)));
het_y=x*beta;
print het_y;



&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 25 Oct 2016 15:06:24 GMT</pubDate>
    <dc:creator>karen8169</dc:creator>
    <dc:date>2016-10-25T15:06:24Z</dc:date>
    <item>
      <title>IML code problem</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-code-problem/m-p/307152#M3064</link>
      <description>&lt;P&gt;When I try to rewrite the orginal code to fit my data, it always appears that "ERROR: (execution) Matrix has not been set to a value.".&lt;BR /&gt;But I don't know where can I correct them. By the way, I want to know how to store het_y into a column form.&lt;/P&gt;&lt;P&gt;Thanks a million.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc IML;
use work.jb_test_data;
read point (1:252) var{BIDLO ASKHI PRC VOL RET} into m;

n=nrow(m); r=ncol(m);
y=m[,5]; x=shape(1,n,1)||m[ ,1:2:3:4];

beta=inv(t(x)*x)*t(x)*y;
sigma=sqrt(t(y-x*beta)*(y-x*beta)/(n-r));
se=sigma*sqrt(vecdiag(inv(t(x)*x)));
het_y=x*beta;
print het_y;



&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Oct 2016 15:06:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-code-problem/m-p/307152#M3064</guid>
      <dc:creator>karen8169</dc:creator>
      <dc:date>2016-10-25T15:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: IML code problem</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-code-problem/m-p/307156#M3065</link>
      <description>&lt;P&gt;It often helps to post the entire log of the code and any error /warning messages to diagnose things.&lt;/P&gt;
&lt;P&gt;Also, since you use&amp;nbsp;the phrase "try to rewrite the orginal code to fit my data" it appears that you are following another code file.&lt;/P&gt;
&lt;P&gt;It may help to post that original code as well.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 15:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-code-problem/m-p/307156#M3065</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-25T15:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: IML code problem</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-code-problem/m-p/307226#M3066</link>
      <description>&lt;P&gt;The &lt;A href="http://blogs.sas.com/content/iml/2011/01/10/creating-vectors-that-contain-evenly-spaced-values.html" target="_self"&gt;index creation operator (:) &lt;/A&gt;&amp;nbsp;has the syntax &lt;EM&gt;initial&lt;/EM&gt;:&lt;EM&gt;final. &amp;nbsp;&lt;/EM&gt;In your case, the correct syntax is&lt;/P&gt;
&lt;P&gt;x=shape(1,n,1) || m[ ,1:4];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/68150/HTML/default/viewer.htm#imlug_tutorial_sect003.htm" target="_self"&gt;the "Tutorial" section of the SAS/IML documentation&lt;/A&gt; for other tips for using SAS/IML for linear regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To write vectors to a SAS data set, see &lt;A href="http://blogs.sas.com/content/iml/2011/04/18/writing-data-from-a-matrix-to-a-sas-data-set.html" target="_self"&gt;"Writing data from a matrix to a SAS data set."&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 19:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-code-problem/m-p/307226#M3066</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-10-25T19:29:51Z</dc:date>
    </item>
  </channel>
</rss>

