<?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: Need help to understand macro! If possible please kindly explain me. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264053#M51741</link>
    <description>Thank you so much too.</description>
    <pubDate>Fri, 15 Apr 2016 01:38:48 GMT</pubDate>
    <dc:creator>Cathy</dc:creator>
    <dc:date>2016-04-15T01:38:48Z</dc:date>
    <item>
      <title>Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263779#M51640</link>
      <description>&lt;P&gt;I need to create a macro. I have dataset having variables from v1 to v7 (independent variables) and y for response. the number of predictors using "varnum"&amp;nbsp;for execution.&lt;/P&gt;&lt;P&gt;Create the macro for each predictors, with simple linear regression and gplot.&amp;nbsp;Please help how I can start with coding. Thanks.&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;</description>
      <pubDate>Thu, 14 Apr 2016 07:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263779#M51640</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-14T07:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263785#M51641</link>
      <description>&lt;P&gt;Very simple, but may lead you in the right direction:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro regressions (varnum);
%do i = 1 %to &amp;amp;varnum;
proc reg;
  model y=v&amp;amp;i;
run;
%end;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 07:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263785#M51641</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-14T07:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263787#M51642</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well, your problem seems to lie in the way you have set your data up - i.e. wide rather than long. &amp;nbsp;I am not familiar with proc reg, so am guessing a bit on syntaxt here, but all procedures are built to allow by group processing - which is both faster, and more efficient, plus easier to maintain. &amp;nbsp;To use this however your data needs to be long data rather than wide. &amp;nbsp;Don't confuse what data you may use in an output review file (which is likely to need transposing) with data you use for your programming, the two can be totally different. &amp;nbsp;An example below shows how to normalise your data, and then use a by grou - see how much simpler the code is, easier to maintain, no macro at all just plain base SAS - note that you have not provided any test data (in the form of a datastep) so this is just an example:&lt;/P&gt;
&lt;PRE&gt;proc transpose data=have out=t_have;
  by &amp;lt;id variables&amp;gt;;  /* Replace with your id variables */
  var v:;
run;
proc reg data=t_have;
  by _name_;
  model y=col1;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 08:17:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263787#M51642</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-14T08:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263824#M51653</link>
      <description>&lt;P&gt;If you are looking for predictors contributing more in the model then you can try selection criteria based on rsquare to flag predictors for the final model:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;proc reg data=have;&lt;BR /&gt;model y=v:/selection=rsquare;&lt;BR /&gt;plot r.*(p. v: ); &lt;BR /&gt;plot student.*obs. / vref=3 2 -2 -3; &lt;BR /&gt;run;&lt;BR /&gt;quit; &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 12:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263824#M51653</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2016-04-14T12:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263982#M51714</link>
      <description>&lt;P&gt;%macro regressions (varnum);&lt;BR /&gt;%do i = 1 %to &amp;amp;varnum;&lt;BR /&gt;proc reg data=new;&lt;BR /&gt;model y=v&amp;amp;i;&lt;BR /&gt;run;&lt;BR /&gt;proc gplot data=new;&lt;BR /&gt;plot y*i/vaxis= 0 to 1 by 0.1;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%regressions(5)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got it for regression. But how can I use proc gplot ? It does not work with macro. It shows that at least one plot or bubble statement must be given. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 22:38:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263982#M51714</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-14T22:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263984#M51716</link>
      <description>&lt;P&gt;thank you, but I need to use macro for this.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/263984#M51716</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-14T19:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264023#M51725</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/80016"&gt;@Cathy﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The plot&amp;nbsp;request should read &lt;FONT face="courier new,courier"&gt;y*v&amp;amp;i&lt;/FONT&gt; rather than &lt;FONT face="courier new,courier"&gt;y*i&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 21:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264023#M51725</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-14T21:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264040#M51734</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 23:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264040#M51734</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-14T23:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264048#M51736</link>
      <description>&lt;P&gt;I have a question regarding using this code;&lt;/P&gt;&lt;P&gt;for example if I want to create start &amp;nbsp;at 3 and stop at 5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro questions(start=3,stop=5);&lt;BR /&gt;%do i = &amp;amp;start %to &amp;amp;stop;&lt;BR /&gt;proc reg data=new;&lt;BR /&gt;model y=v&amp;amp;i;&lt;BR /&gt;run;&lt;BR /&gt;%do j=&amp;amp;i+1 %to &amp;amp;stop+1;&lt;BR /&gt;proc gplot data=new;&lt;BR /&gt;plot v&amp;amp;i*v&amp;amp;j;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%questions(3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me this too. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 01:36:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264048#M51736</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-15T01:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264050#M51738</link>
      <description>I got this...%questions((start=3,stop=5)&lt;BR /&gt;&lt;BR /&gt;it print out...finally</description>
      <pubDate>Fri, 15 Apr 2016 01:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264050#M51738</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-15T01:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264051#M51739</link>
      <description>Thanks a lot, I got it finally and giving me a good direction.</description>
      <pubDate>Fri, 15 Apr 2016 01:38:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264051#M51739</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-15T01:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264052#M51740</link>
      <description>Thanks a lot again. This helps me a lot too</description>
      <pubDate>Fri, 15 Apr 2016 01:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264052#M51740</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-15T01:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264053#M51741</link>
      <description>Thank you so much too.</description>
      <pubDate>Fri, 15 Apr 2016 01:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264053#M51741</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-15T01:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264054#M51742</link>
      <description>Thank you so much.</description>
      <pubDate>Fri, 15 Apr 2016 01:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264054#M51742</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-15T01:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264114#M51765</link>
      <description>&lt;P&gt;Why? &amp;nbsp;There is never a "need" to use any tool, use the one thats fits the job best? &amp;nbsp;Macro language is designed as a code generation toolkit, nothing more, Base SAS is the programming language.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 08:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264114#M51765</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-15T08:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand macro! If possible please kindly explain me.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264334#M51837</link>
      <description>&lt;P&gt;I am studying little SAS book and preparing to get certificate too. That's why I need to know macro too. Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Apr 2016 04:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-to-understand-macro-If-possible-please-kindly-explain/m-p/264334#M51837</guid>
      <dc:creator>Cathy</dc:creator>
      <dc:date>2016-04-16T04:16:54Z</dc:date>
    </item>
  </channel>
</rss>

