<?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 macro for a rolling window regression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-for-a-rolling-window-regression/m-p/177774#M34006</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I am working on a research project and have trouble come up with a way to &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;conduct a rolling window regression. In my proc model I include this macro to do my rolling window.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%do fen = %eval(&amp;amp;dfen) %to 100;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where %eval(&amp;amp;fen) le obs le %eval(36+&amp;amp;fen-1);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;However, my proc model is done by id and as you can see in this macro I suppose that the number of observations is 100 for each id but this is not true I have a different number of observation for each id. In my database I add a column which indicates the number of total number of observation for each id (nb).&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;How can I change the fixed number 100 to a changing variables called nb?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I try to do it like this :&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%do fen = %eval(&amp;amp;dfen) %to %eval(&amp;amp;nb);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where %eval(&amp;amp;fen) le obs le %eval(36+&amp;amp;fen-1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;but I have this error&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ARNING: Apparent symbolic reference NB not resolved.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ERROR: The text expression &amp;amp;NB contains a recursive reference to the macro variable NB.&amp;nbsp; The&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; macro variable will be assigned the null value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Nov 2014 15:09:07 GMT</pubDate>
    <dc:creator>sasphd</dc:creator>
    <dc:date>2014-11-19T15:09:07Z</dc:date>
    <item>
      <title>macro for a rolling window regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-for-a-rolling-window-regression/m-p/177774#M34006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I am working on a research project and have trouble come up with a way to &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;conduct a rolling window regression. In my proc model I include this macro to do my rolling window.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%do fen = %eval(&amp;amp;dfen) %to 100;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where %eval(&amp;amp;fen) le obs le %eval(36+&amp;amp;fen-1);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;However, my proc model is done by id and as you can see in this macro I suppose that the number of observations is 100 for each id but this is not true I have a different number of observation for each id. In my database I add a column which indicates the number of total number of observation for each id (nb).&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;How can I change the fixed number 100 to a changing variables called nb?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I try to do it like this :&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%do fen = %eval(&amp;amp;dfen) %to %eval(&amp;amp;nb);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where %eval(&amp;amp;fen) le obs le %eval(36+&amp;amp;fen-1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;but I have this error&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ARNING: Apparent symbolic reference NB not resolved.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ERROR: The text expression &amp;amp;NB contains a recursive reference to the macro variable NB.&amp;nbsp; The&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; macro variable will be assigned the null value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 15:09:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-for-a-rolling-window-regression/m-p/177774#M34006</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2014-11-19T15:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: macro for a rolling window regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-for-a-rolling-window-regression/m-p/177775#M34007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see my response at: &lt;A __default_attr="238451" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 15:21:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-for-a-rolling-window-regression/m-p/177775#M34007</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-11-19T15:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: macro for a rolling window regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-for-a-rolling-window-regression/m-p/345521#M79491</link>
      <description>&lt;P&gt;I was also looking for the solution to the similar error but I did not find your solution when I clicked your link&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 19:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-for-a-rolling-window-regression/m-p/345521#M79491</guid>
      <dc:creator>UPRETIGOPI</dc:creator>
      <dc:date>2017-03-29T19:55:38Z</dc:date>
    </item>
  </channel>
</rss>

