<?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: How to create a quarterly loop for rolling regressions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604935#M175443</link>
    <description>&lt;P&gt;I provided the data sample below as suggested.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Nov 2019 11:56:14 GMT</pubDate>
    <dc:creator>windy</dc:creator>
    <dc:date>2019-11-18T11:56:14Z</dc:date>
    <item>
      <title>How to create a quarterly loop for rolling regressions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604877#M175418</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing rolling regressions with quarterly window for each ID group. I have been looking for many solutions and found out that I need to create a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;quarterly loop&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and then use&lt;EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;proc reg&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;with a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;by statement&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to solve my problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My dataset ranges from 1999:1 to 2017:3. The date variable showing the quarters is formatted in YYQC6. There are 75 quarters in total. I want to run 30-quarter rolling window regressions. Please help me to set up the macro for the quarterly loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for any help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Windy.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 05:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604877#M175418</guid>
      <dc:creator>windy</dc:creator>
      <dc:date>2019-11-18T05:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a quarterly loop for rolling regressions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604893#M175428</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/297250"&gt;@windy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please provide some sample data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank a lot&amp;nbsp;&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;</description>
      <pubDate>Mon, 18 Nov 2019 08:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604893#M175428</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-11-18T08:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a quarterly loop for rolling regressions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604935#M175443</link>
      <description>&lt;P&gt;I provided the data sample below as suggested.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 11:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604935#M175443</guid>
      <dc:creator>windy</dc:creator>
      <dc:date>2019-11-18T11:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a quarterly loop for rolling regressions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604941#M175449</link>
      <description>&lt;P&gt;If you do an internet search for rolling regressions in SAS, there are a number of papers that provide actual code to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, screen captures of data are never helpful. The proper way to provide data for use in the SAS communities is given here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 11:37:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604941#M175449</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-18T11:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a quarterly loop for rolling regressions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604951#M175457</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; I edited it. I am also looking for the solutions in the internet. But I am too new to SAS, so I am still struggling with understanding the codes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292097"&gt;@ed_sas_member&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how the data sample looks like. I made the ID and date in bold.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data WORK.INCORDATA;&lt;BR /&gt;infile datalines dsd truncover;&lt;/P&gt;&lt;P&gt;input &lt;STRONG&gt;cd_msa:BEST.&lt;/STRONG&gt; cd_msa_gdp:BEST. cd_msa_hpi:BEST. cd_msa_uer:BEST. year:32. quarter:32. _TYPE_:32. _FREQ_:32. delq_reo:32. delq_90d:32. delq_60d:32. delq_ss:32. delq_repch:32. fico:32. cltv:32. dti:32. &lt;STRONG&gt;datenew:YYQC.&lt;/STRONG&gt; gdp:32. gdp_growth:32. hpi:32. uer:32&lt;BR /&gt;. realgdp:32. realgdp_growth:32. FEDFUNDS:32. MORTGAGE30US:32. State:$12. jury:BEST12. SRR:BEST12. PD:BEST12.;&lt;BR /&gt;format cd_msa BEST. cd_msa_gdp BEST. cd_msa_hpi BEST. cd_msa_uer BEST. datenew YYQC. jury BEST12. SRR BEST12. PD BEST12.;&lt;BR /&gt;label cd_msa="cd_msa" cd_msa_gdp="cd_msa_gdp" cd_msa_hpi="cd_msa_hpi" cd_msa_uer="cd_msa_uer" State="State" jury="JP" SRR="SRR" PD="PD";&lt;BR /&gt;datalines;&lt;BR /&gt;. . 29460 . . . . . . . . . . . . . . . . . . . . . . . . .&lt;BR /&gt;. . 37460 . . . . . . . . . . . . . . . . . . . . . . . . .&lt;BR /&gt;. . 42100 . . . . . . . . . . . . . . . . . . . . . . . . .&lt;BR /&gt;&lt;STRONG&gt;10380&lt;/STRONG&gt; . . . 1999 1 7 1 0 0 0 0 0 753 80 31 &lt;STRONG&gt;1999:1&lt;/STRONG&gt; . . . . . . 4.7324444444 6.8779885492 . . .&lt;BR /&gt;13644 . . . 1999 1 7 998 0 0 0 0 0 766.92685371 73.71242485 34.651302605 1999:1 . . . . . . 4.7324444444 6.8779885492 . . .&lt;BR /&gt;;;;;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 11:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-quarterly-loop-for-rolling-regressions/m-p/604951#M175457</guid>
      <dc:creator>windy</dc:creator>
      <dc:date>2019-11-18T11:54:42Z</dc:date>
    </item>
  </channel>
</rss>

