<?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: Matrices in Proc IML in All Things Community</title>
    <link>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557252#M3879</link>
    <description>&lt;P&gt;At line 1645, column 72, you are doing a matrix multiplication, but the matrices do not conform to the operation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For matrix multiplication to work, if you have matrix A which is n rows and m columns and matrix B has m rows and p columns, then the result of A*B is n x p.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error message indicates that you have m1 columns in A and m2 rows in B, and m1 not equal to m2.&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2019 19:10:36 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-05-08T19:10:36Z</dc:date>
    <item>
      <title>Matrices in Proc IML</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557242#M3878</link>
      <description>&lt;P&gt;Dear Friends&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running the following code on for my thesis. But i donot know how to fix the error or adjust the matrix operation...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let m=1; * Number of replicates at each concentration level;&lt;BR /&gt;proc iml;&lt;BR /&gt;* Import the data sets;&lt;BR /&gt;use b; read all into b;&lt;BR /&gt;use covb; read all into covb;&lt;BR /&gt;* Initialize matrices;&lt;BR /&gt;y=j(101,1,0);&lt;BR /&gt;h=j(101,1,0);&lt;BR /&gt;hy=j(101,1,0);&lt;BR /&gt;hb=j(101,4,0);&lt;BR /&gt;varx0=j(101,1,0);&lt;BR /&gt;pp=j(101,1,0);&lt;BR /&gt;top=b[1];&lt;BR /&gt;bottom=b[2];&lt;BR /&gt;c50=b[3];&lt;BR /&gt;slope=b[4];&lt;BR /&gt;* Calculate the precision profile;&lt;BR /&gt;do i=1 to 101;&lt;BR /&gt;h[i,1]=10**(log10(&amp;amp;minconc)+(i-1)*(log10(&amp;amp;maxconc)-log10(&amp;amp;minconc))/100);&lt;BR /&gt;y[i,1]=top+(bottom-top)/(1+(h[i,1]/c50)**slope);&lt;BR /&gt;hy[i,1]=h[i,1]*(top-bottom)/(slope*(bottom-y[i,1])*(y[i,1]-top));&lt;BR /&gt;hb[i,1]=h[i,1]/(slope*(y[i,1]-top));&lt;BR /&gt;hb[i,2]=h[i,1]/(slope*(bottom-y[i,1]));&lt;BR /&gt;hb[i,3]=h[i,1]/c50;&lt;BR /&gt;hb[i,4]=-h[i,1]*log((bottom-y[i,1])/(y[i,1]-top))/(slope**2);&lt;BR /&gt;varx0[i,1]=((hy[i,1]**2)*&amp;amp;sigma_sq*(y[i,1]**(2*&amp;amp;theta))/&amp;amp;m)+hb[i,]*covb*hb[i,];&lt;BR /&gt;pp[i,1]=100*sqrt(varx0[i,1])/h[i,1];&lt;BR /&gt;end;&lt;BR /&gt;create plot var{h hy y pp};&lt;BR /&gt;append;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1621 proc iml;&lt;BR /&gt;NOTE: IML Ready&lt;BR /&gt;1622 * Import the data sets;&lt;BR /&gt;1623 use b;&lt;BR /&gt;1623! read all into b;&lt;BR /&gt;1624 use covb;&lt;BR /&gt;1624! read all into covb;&lt;BR /&gt;1625 * Initialize matrices;&lt;BR /&gt;1626 y=j(101,1,0);&lt;BR /&gt;1627 h=j(101,1,0);&lt;BR /&gt;1628 hy=j(101,1,0);&lt;BR /&gt;1629 hb=j(101,4,0);&lt;BR /&gt;1630 varx0=j(101,1,0);&lt;BR /&gt;1631 pp=j(101,1,0);&lt;BR /&gt;1632 top=b[1];&lt;BR /&gt;1633 bottom=b[2];&lt;BR /&gt;1634 c50=b[3];&lt;BR /&gt;1635 slope=b[4];&lt;BR /&gt;1636 * Calculate the precision profile;&lt;BR /&gt;1637 do i=1 to 101;&lt;BR /&gt;1638 h[i,1]=10**(log10(&amp;amp;minconc)+(i-1)*(log10(&amp;amp;maxconc)-log10(&amp;amp;minconc))/100);&lt;BR /&gt;1639 y[i,1]=top+(bottom-top)/(1+(h[i,1]/c50)**slope);&lt;BR /&gt;1640 hy[i,1]=h[i,1]*(top-bottom)/(slope*(bottom-y[i,1])*(y[i,1]-top));&lt;BR /&gt;1641 hb[i,1]=h[i,1]/(slope*(y[i,1]-top));&lt;BR /&gt;1642 hb[i,2]=h[i,1]/(slope*(bottom-y[i,1]));&lt;BR /&gt;1643 hb[i,3]=h[i,1]/c50;&lt;BR /&gt;1644 hb[i,4]=-h[i,1]*log((bottom-y[i,1])/(y[i,1]-top))/(slope**2);&lt;BR /&gt;1645 varx0[i,1]=((hy[i,1]**2)*&amp;amp;sigma_sq*(y[i,1]**(2*&amp;amp;theta))/&amp;amp;m)+hb[i,]*covb*hb[i,];&lt;BR /&gt;1646 pp[i,1]=100*sqrt(varx0[i,1])/h[i,1];&lt;BR /&gt;1647 end;&lt;BR /&gt;ERROR: (execution) Matrices do not conform to the operation.&lt;/P&gt;&lt;P&gt;operation : * at line 1645 column 72&lt;BR /&gt;operands : _TEM1011, _TEM1012&lt;/P&gt;&lt;P&gt;_TEM1011 1 row 4 cols (numeric)&lt;/P&gt;&lt;P&gt;-0.000769 1.4782E-8 -0.000619 -0.000557&lt;/P&gt;&lt;P&gt;_TEM1012 1 row 4 cols (numeric)&lt;/P&gt;&lt;P&gt;-1.157735 -0.053985 0.2209224 -0.249582&lt;/P&gt;&lt;P&gt;statement : ASSIGN at line 1645 column 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did understand the problem at hand but how to rectify the problem is the headache....please anyone help me....I got a thesis deadline&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 18:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557242#M3878</guid>
      <dc:creator>fatso33</dc:creator>
      <dc:date>2019-05-08T18:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Matrices in Proc IML</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557252#M3879</link>
      <description>&lt;P&gt;At line 1645, column 72, you are doing a matrix multiplication, but the matrices do not conform to the operation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For matrix multiplication to work, if you have matrix A which is n rows and m columns and matrix B has m rows and p columns, then the result of A*B is n x p.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error message indicates that you have m1 columns in A and m2 rows in B, and m1 not equal to m2.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 19:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557252#M3879</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-08T19:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Matrices in Proc IML</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557260#M3880</link>
      <description>&lt;P&gt;thank you very much paige....I had sort of picked up that but I was struggling to modify the matrices. This is a code from a text book im using for my project&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 19:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557260#M3880</guid>
      <dc:creator>fatso33</dc:creator>
      <dc:date>2019-05-08T19:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Matrices in Proc IML</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557264#M3881</link>
      <description>&lt;P&gt;That specific line of code is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;varx0[i,1]=((hy[i,1]**2)*&amp;amp;sigma_sq*(y[i,1]**(2*&amp;amp;theta))/&amp;amp;m)+hb[i,]*covb*hb[i,];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and somehow you are trying to multiply a 1x4 matrix with a 1x4 matrix, that should give you some idea about what needs to be fixed.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 19:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557264#M3881</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-08T19:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Matrices in Proc IML</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557280#M3882</link>
      <description>&lt;P&gt;wow thank you so much paige.....that is really helpful&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 20:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Matrices-in-Proc-IML/m-p/557280#M3882</guid>
      <dc:creator>fatso33</dc:creator>
      <dc:date>2019-05-08T20:21:54Z</dc:date>
    </item>
  </channel>
</rss>

