<?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 matrix creation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14656#M1884</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;:smileygrin: &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Dec 2011 19:38:06 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2011-12-14T19:38:06Z</dc:date>
    <item>
      <title>matrix creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14652#M1880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;I do not have SAS IML. I am trying to figure out how to create a matrix with base SAS. Does someone have a smart code for this. I was thinking about a double loop..&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 19:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14652#M1880</guid>
      <dc:creator>sasuser1000</dc:creator>
      <dc:date>2011-12-14T19:15:52Z</dc:date>
    </item>
    <item>
      <title>matrix creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14653#M1881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create it using the ARRAY statement in the DATA step:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 14pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt; m(drop=i j);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 14pt;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt; x[&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background-color: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 14pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt; i = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 14pt;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 14pt; background-color: white; font-family: 'Courier New';"&gt;5&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 14pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt; j = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 14pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt; dim(x);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&lt;J&gt; = ranuni(&lt;/J&gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 14pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 14pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 14pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 14pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 14pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 14pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;; &lt;STRONG style="color: navy; font-size: 14pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it's not clear what you're going to be able to do with it.&lt;/P&gt;&lt;P&gt;To find out some of the things that you can do with SAS/IML see the &lt;A href="http://blogs.sas.com/content/iml/tag/getting-started/"&gt;Getting Started articles&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Also see the book &lt;A href="http://support.sas.com/publishing/authors/wicklin.html"&gt;Statistical Programming with SAS/IML Software&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 19:28:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14653#M1881</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-12-14T19:28:55Z</dc:date>
    </item>
    <item>
      <title>matrix creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14654#M1882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending upon what you want to do with the matrix, you can always create a multi-dimensional array in SAS and fill it either with nested do loops are simply by initializing the cells with specific data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 19:30:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14654#M1882</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-14T19:30:48Z</dc:date>
    </item>
    <item>
      <title>matrix creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14655#M1883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick: Do I happen to all of the sudden see colored code in your posts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 19:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14655#M1883</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-14T19:32:16Z</dc:date>
    </item>
    <item>
      <title>matrix creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14656#M1884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;:smileygrin: &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 19:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14656#M1884</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-12-14T19:38:06Z</dc:date>
    </item>
    <item>
      <title>matrix creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14657#M1885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the code. In term of memory , does working with an array is more efficient than with a nested loop as Art suggested?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 19:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14657#M1885</guid>
      <dc:creator>sasuser1000</dc:creator>
      <dc:date>2011-12-14T19:41:11Z</dc:date>
    </item>
    <item>
      <title>matrix creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14658#M1886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art notes that the ARRAY statement can have multiple dimension (for example, two instead of the one-dimensional array that I used).&lt;/P&gt;&lt;P&gt;If you are going to try to use the DATA step to manipulate an array, a 2D array probably makes more sense. If your goal is to write a matrix to a data set, then my code is adequate and uses less memory because only one row of the matrix is ever in RAM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 19:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14658#M1886</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-12-14T19:58:30Z</dc:date>
    </item>
    <item>
      <title>matrix creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14659#M1887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I do need a 2d array, I would like to manipulate the array and I am kind of new to array in SAS. One more question if you don't mind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say i want to fill the array,&amp;nbsp; the cell of row 2 and column 2 should be equal 0.8. How do I write this in SAS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 20:03:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14659#M1887</guid>
      <dc:creator>sasuser1000</dc:creator>
      <dc:date>2011-12-14T20:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: matrix creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14660#M1888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; foobar;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; x[&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;] (&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;*&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;5&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; j=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; dim(x);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; x&lt;J&gt;=ifn(i=&lt;/J&gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; and j=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;.8&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;,ranuni(&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; i j;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;=foobar; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;P&gt;Obs x1 x2 x3&lt;/P&gt;&lt;P&gt;1 0.18496 0.97009 0.39982&lt;/P&gt;&lt;P&gt;2 0.25940 0.80000 0.96928&lt;/P&gt;&lt;P&gt;3 0.54298 0.53169 0.04979&lt;/P&gt;&lt;P&gt;4 0.06657 0.81932 0.52387&lt;/P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&lt;P&gt;5 0.85339 0.06718 0.95702&lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 20:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14660#M1888</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-12-14T20:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: matrix creation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14661#M1889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 20:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matrix-creation/m-p/14661#M1889</guid>
      <dc:creator>sasuser1000</dc:creator>
      <dc:date>2011-12-14T20:38:10Z</dc:date>
    </item>
  </channel>
</rss>

