<?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 Multiple NLP....New to SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-NLP-New-to-SAS/m-p/33204#M8043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; You might want to try call execute and the vname function so you get the variable name as an argument. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Jul 2011 19:44:25 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2011-07-18T19:44:25Z</dc:date>
    <item>
      <title>Multiple NLP....New to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-NLP-New-to-SAS/m-p/33203#M8042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset with 96 variables and 28 observations per variable. &lt;/P&gt;&lt;P&gt;I would like to run the nlp procedure for each variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having difficulty doing so. (I am very new to SAS)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The equation and data are the same for each run of nlp procedure. I just need to change one variable (called certain) each run through. &lt;/P&gt;&lt;P&gt;In the end I would like to have 96 different estimates for alpha and gamma. &lt;/P&gt;&lt;P&gt;I have set up the nlp proc in a macro with an input variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure how to get the variables that I need from the data set one at a time and pass them into the macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;I have included what I am trying, unsuccessfully, to do below....&lt;/P&gt;&lt;P&gt;THanks, Jen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* This is the macro called nlp test&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the variable 'certain' needs to change 96 times &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THe equation works if I run it using one variable, the issue is when i try to loop through multiple variables...*/ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro nlptest(certain);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc nlp data=Work.Prospect;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; lsq z;&lt;/P&gt;&lt;P&gt; parms alpha=1, gamma=1;&lt;/P&gt;&lt;P&gt; bounds 0.0001 &amp;lt; gamma &amp;lt; 2, 0.0001 &amp;lt; alpha &amp;lt; 2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; weight = (nn_p1 ** gamma) /( ( (nn_p1 ** gamma) + (1-nn_p1) ** gamma) ** (1/gamma) );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value1 = nn_z1 ** alpha;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value2 = nn_z2 ** alpha;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z&amp;nbsp; = (((weight * value1 + (1-weight) * value2) ** (1/alpha)) - &amp;amp;certain)&amp;nbsp; / &amp;amp;certain;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend nlptest;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*HERE IS WHERE I START TO RUN INTO TROUBLE..... */ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data array1;&lt;/P&gt;&lt;P&gt; set work.suregain; /* This data set contains the 96 variables I would like to loop through and pass into the macro for the nlp proc. */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array sure{*} _numeric_;&amp;nbsp; /*I amk trying to create an array of the variables I need to pass to the macro */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input sure{*};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 96; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %nlptest(sure{i});&amp;nbsp; /*Macro will not accept this as a value*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2011 19:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-NLP-New-to-SAS/m-p/33203#M8042</guid>
      <dc:creator>jennie</dc:creator>
      <dc:date>2011-07-18T19:18:46Z</dc:date>
    </item>
    <item>
      <title>Multiple NLP....New to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-NLP-New-to-SAS/m-p/33204#M8043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; You might want to try call execute and the vname function so you get the variable name as an argument. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2011 19:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-NLP-New-to-SAS/m-p/33204#M8043</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2011-07-18T19:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple NLP....New to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-NLP-New-to-SAS/m-p/33205#M8044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;You might want to try call execute and the dictionary table, so you get the variable name as an argument.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data _null_;
 set sashelp.vcolumn(where=(libname='WORK' memname='SUREGAIN' xtype='num'));
 call execute('%nlptes('||strip(name)||')');
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2011 08:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-NLP-New-to-SAS/m-p/33205#M8044</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-07-19T08:51:19Z</dc:date>
    </item>
    <item>
      <title>Multiple NLP....New to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-NLP-New-to-SAS/m-p/33206#M8045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;I really I appreciated it, I am feeling so lost trying to learn this stuff!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2011 12:15:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-NLP-New-to-SAS/m-p/33206#M8045</guid>
      <dc:creator>jennie</dc:creator>
      <dc:date>2011-07-19T12:15:08Z</dc:date>
    </item>
  </channel>
</rss>

