<?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: proc iml and by variable in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-and-by-variable/m-p/132358#M1065</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is not a BY statement because the SAS/IML statement operates on matrices, not just vectors.&amp;nbsp; (It also has a DO loop and other features for processing multiple groups.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your example, let Y be the matrix whose i_th column is the vector for the i_th value of the BY variable.&amp;nbsp; Then&lt;/P&gt;&lt;P&gt;M = t(Y)*A*Y&lt;/P&gt;&lt;P&gt;computes all products that appear in the output data set.&amp;nbsp; There is no need to filer the data prior to calling PROC IML, nor to create/append multiple data sets.&amp;nbsp; One IML operation is all it takes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 May 2013 13:04:04 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2013-05-08T13:04:04Z</dc:date>
    <item>
      <title>proc iml and by variable</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-and-by-variable/m-p/132357#M1064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;I would like to know if in proc iml there is a command similar to the “By” command of many SAS procedures. I have to create a matrix product t(x)*A*x&amp;nbsp; using the same matrix A but different x vectors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;All x vectors are stored in the same dataset (INPUT) &lt;/SPAN&gt;which has a varaible used to filter the different vectors.&lt;/P&gt;&lt;OL style="list-style-type: upper-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;E.g.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="padding-right: 5.4pt; padding-left: 5.4pt; background: #fabf8f; border: windowtext 1pt solid;" valign="top" width="95"&gt;&lt;P style="margin-bottom: 12pt;"&gt;&lt;STRONG style="color: black; background: #fabf8f; font-size: 10pt; font-family: 'Segoe UI','sans-serif';"&gt;BY_VARIABLE&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; background: #fabf8f; border-left: medium none; border-bottom: windowtext 1pt solid;" valign="top" width="54"&gt;&lt;P&gt;&lt;STRONG style="color: black; background: #fabf8f; font-size: 10pt; font-family: 'Segoe UI','sans-serif';"&gt;X&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: windowtext 1pt solid; border-bottom: windowtext 1pt solid;" valign="top" width="95"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;AT&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: medium none; border-bottom: windowtext 1pt solid;" valign="top" width="54"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;X1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: windowtext 1pt solid; border-bottom: windowtext 1pt solid;" valign="top" width="95"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;AT&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: medium none; border-bottom: windowtext 1pt solid;" valign="top" width="54"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;X2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: windowtext 1pt solid; border-bottom: windowtext 1pt solid;" valign="top" width="95"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;DE&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: medium none; border-bottom: windowtext 1pt solid;" valign="top" width="54"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;X1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: windowtext 1pt solid; border-bottom: windowtext 1pt solid;" valign="top" width="95"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;DE&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: medium none; border-bottom: windowtext 1pt solid;" valign="top" width="54"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;X2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: windowtext 1pt solid; border-bottom: windowtext 1pt solid;" valign="top" width="95"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;FR&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: medium none; border-bottom: windowtext 1pt solid;" valign="top" width="54"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;X1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: windowtext 1pt solid; border-bottom: windowtext 1pt solid;" valign="top" width="95"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Segoe UI','sans-serif';"&gt;….&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; border-left: medium none; border-bottom: windowtext 1pt solid;" valign="top" width="54"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;Currently I make a cycle on the different values of BY_VARIABLE, filter the dataset based on that value, make the proc iml and store the output in a dataset. I would like to know if it’s possible to use the entire INPUT dataset in the proc iml, specify which is the BY variable and output a dataset with the BY_VARIABLE and the results of the matrix product for each value.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 12pt; color: black;"&gt;Federica&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2013 12:18:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-and-by-variable/m-p/132357#M1064</guid>
      <dc:creator>e3flator</dc:creator>
      <dc:date>2013-05-08T12:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc iml and by variable</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-and-by-variable/m-p/132358#M1065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is not a BY statement because the SAS/IML statement operates on matrices, not just vectors.&amp;nbsp; (It also has a DO loop and other features for processing multiple groups.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your example, let Y be the matrix whose i_th column is the vector for the i_th value of the BY variable.&amp;nbsp; Then&lt;/P&gt;&lt;P&gt;M = t(Y)*A*Y&lt;/P&gt;&lt;P&gt;computes all products that appear in the output data set.&amp;nbsp; There is no need to filer the data prior to calling PROC IML, nor to create/append multiple data sets.&amp;nbsp; One IML operation is all it takes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2013 13:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-and-by-variable/m-p/132358#M1065</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-05-08T13:04:04Z</dc:date>
    </item>
  </channel>
</rss>

