<?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: Shape Function in IML in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/706526#M5364</link>
    <description>&lt;P&gt;Are you able to post your entire IML code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, see if the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=imlug&amp;amp;docsetTarget=imlug_langref_sect441.htm&amp;amp;locale=en" target="_self"&gt;SHAPE Function Doc&lt;/A&gt; helps you.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2020 05:22:12 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-12-17T05:22:12Z</dc:date>
    <item>
      <title>Shape Function in IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/706480#M5363</link>
      <description>&lt;P&gt;Can anyone tell me what the following line of code does:&lt;/P&gt;
&lt;P&gt;X1=X;&lt;/P&gt;
&lt;P&gt;do i=1 to 24;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;do k=1 to 4;&lt;/P&gt;
&lt;P&gt;X[,indices[i,k]+1]=shape(0,nrow(X1),1);&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;X is a 200 row by 5 column matrix of 1's and 0's.&lt;/P&gt;
&lt;P&gt;indices is a 24 row by 4 column matrix with the numbers 1 to 4 in different order for each row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 23:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/706480#M5363</guid>
      <dc:creator>Sanscrit_2prov</dc:creator>
      <dc:date>2020-12-16T23:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Shape Function in IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/706526#M5364</link>
      <description>&lt;P&gt;Are you able to post your entire IML code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, see if the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=imlug&amp;amp;docsetTarget=imlug_langref_sect441.htm&amp;amp;locale=en" target="_self"&gt;SHAPE Function Doc&lt;/A&gt; helps you.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 05:22:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/706526#M5364</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-12-17T05:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Shape Function in IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/706575#M5365</link>
      <description>&lt;P&gt;The code does not make much sense to me.&amp;nbsp; The SHAPE function is being used to generate a vector of zeros and then that vector is being copied repeateadly into columns 2 to 5 of X.&amp;nbsp; I believe the one line&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;X [ , 2:5] = 0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;would have the same effect as the double loop.&amp;nbsp;&amp;nbsp; But you need to test this out - try printing the matrix X before and after.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 09:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/706575#M5365</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2020-12-17T09:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Shape Function in IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/706635#M5366</link>
      <description>&lt;P&gt;This is the entire code that someone wrote. It's just the shape function that doesn't make sense to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro averageAF (out, riskfactors, data);&lt;/P&gt;
&lt;P&gt;proc logistic data=&amp;amp;data descending outdesign=_design_ outest=_model_ noprint;&lt;BR /&gt;model &amp;amp;out = &amp;amp;riskfactors;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%let vars=1; &lt;BR /&gt;%let names=;&lt;BR /&gt;%do %while (%Qscan(&amp;amp;riskfactors,&amp;amp;vars) ne ); &lt;BR /&gt;%let names=&amp;amp;&amp;amp;names %Qscan(&amp;amp;riskfactors,&amp;amp;vars); &lt;BR /&gt;%let vars=%eval(&amp;amp;vars+1);&lt;BR /&gt;%end;&lt;BR /&gt;%let vars=%eval(&amp;amp;vars-1);&lt;/P&gt;
&lt;P&gt;%put &amp;amp;names;&lt;/P&gt;
&lt;P&gt;data _design_;&lt;BR /&gt;set _design_;&lt;BR /&gt;if nmiss(of &amp;amp;riskfactors)=0 and nmiss(of &amp;amp;out)=0;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data _indices_;&lt;BR /&gt;drop i perms;&lt;BR /&gt;array x (&amp;amp;vars) (1:&amp;amp;vars); &lt;BR /&gt;&lt;BR /&gt;perms=fact(&amp;amp;vars); &lt;BR /&gt;/*vars=4 and perms=24*/&lt;BR /&gt;do i=1 to perms; &lt;BR /&gt;call allperm(i, of x(*));&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc iml;&lt;BR /&gt;use _design_;&lt;BR /&gt;read all var {intercept &amp;amp;riskfactors} into X;&lt;BR /&gt;close _design_;&lt;BR /&gt;use _model_;&lt;BR /&gt;read var {intercept &amp;amp;riskfactors} into beta;&lt;BR /&gt;close _model_;&lt;BR /&gt;use _indices_;&lt;BR /&gt;read all var _num_ into indices;&lt;BR /&gt;close _indices_;&lt;/P&gt;
&lt;P&gt;start pp(pcases,X,beta);&lt;BR /&gt;pcases=sum(1/(1+exp(-X*beta`)));&lt;BR /&gt;finish;&lt;/P&gt;
&lt;P&gt;run pp(pcases,X,beta);&lt;/P&gt;
&lt;P&gt;print (pcases);&lt;/P&gt;
&lt;P&gt;pred_cases_m=shape(.,nrow(indices),&amp;amp;vars); /*24 rows , 4 columns*/&lt;BR /&gt;prev_cases_m=shape(.,nrow(indices),&amp;amp;vars); /*24 rows , 4 columns*/&lt;/P&gt;
&lt;P&gt;X1=X;&lt;BR /&gt;do i=1 to nrow(indices); /*24*/&lt;BR /&gt;do k=1 to &amp;amp;vars; /*4*/&lt;BR /&gt;print (indices[i,k]);&lt;BR /&gt;X[,indices[i,k]+1]=shape(0,nrow(X1),1);&lt;BR /&gt;pred_cases_m[i,k]=sum(1/(1+exp(-X*beta`)));&lt;BR /&gt;print (pred_cases_m[i,k]);&lt;BR /&gt;end;&lt;BR /&gt;X=X1;&lt;BR /&gt;end;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 13:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/706635#M5366</guid>
      <dc:creator>Sanscrit_2prov</dc:creator>
      <dc:date>2020-12-17T13:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Shape Function in IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/707470#M5367</link>
      <description>&lt;P&gt;Has your question been resolved? If so, please mark an answer as correct and close this thread. If not, what questions remain and how can we help?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 14:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/707470#M5367</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-12-21T14:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Shape Function in IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/707500#M5368</link>
      <description>&lt;P&gt;I notice that the line "X = X1" is missing from the first code example that you posted. With this line the code makes more sense as X is reset after each iteration of the outermost loop.&amp;nbsp; The result is that the columns of X are set to zero in every possible order.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 15:15:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Shape-Function-in-IML/m-p/707500#M5368</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2020-12-21T15:15:55Z</dc:date>
    </item>
  </channel>
</rss>

