<?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 turning a matrix into row vector in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/turning-a-matrix-into-row-vector/m-p/516305#M73263</link>
    <description>&lt;P&gt;I have an arrays like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; prob_matrix;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; B_estimates;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;array&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; theta theta1-theta9;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;end;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;Where theta1 to theta9&amp;nbsp;are 9 columns from a 9by9 matrix. Now I want to convert the Array theta into a long row. The resulting row vector is then 9*9=81 cells wide, since row 1,2 3&amp;nbsp;etc &lt;FONT face="Courier New"&gt;from theta&lt;/FONT&gt;&amp;nbsp;are put next to eachother&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Nov 2018 13:55:37 GMT</pubDate>
    <dc:creator>rhapsody</dc:creator>
    <dc:date>2018-11-27T13:55:37Z</dc:date>
    <item>
      <title>turning a matrix into row vector</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/turning-a-matrix-into-row-vector/m-p/516305#M73263</link>
      <description>&lt;P&gt;I have an arrays like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; prob_matrix;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; B_estimates;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;array&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; theta theta1-theta9;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;end;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;Where theta1 to theta9&amp;nbsp;are 9 columns from a 9by9 matrix. Now I want to convert the Array theta into a long row. The resulting row vector is then 9*9=81 cells wide, since row 1,2 3&amp;nbsp;etc &lt;FONT face="Courier New"&gt;from theta&lt;/FONT&gt;&amp;nbsp;are put next to eachother&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 13:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/turning-a-matrix-into-row-vector/m-p/516305#M73263</guid>
      <dc:creator>rhapsody</dc:creator>
      <dc:date>2018-11-27T13:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: turning a matrix into row vector</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/turning-a-matrix-into-row-vector/m-p/516309#M73264</link>
      <description>&lt;P&gt;Well, I would advise that that is not the best layout, going the other way would be more beneficial, i.e. having 81 records and 2 columns.&amp;nbsp; Far easier to work with.&amp;nbsp; Anyways something like - and note that this is not tested as you have not provided test data in the form of a datastep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want (drop=i);
  set have end=last;
  array final{81} 8;
  retain final:;
  array theta{9};
  if _n_=1 then mult=0;
  do i=1 to 9;
    final{(mult*9)+i}=theta{i};
  end;
  if last then output;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 14:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/turning-a-matrix-into-row-vector/m-p/516309#M73264</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-27T14:08:41Z</dc:date>
    </item>
  </channel>
</rss>

