<?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 multiple GARCH Regressions in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Macro-for-multiple-GARCH-Regressions/m-p/184279#M46872</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Courier New;"&gt;Hello everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Courier New;"&gt;I have 50 time-series, for which I need to run a GARCH model for volatility forecasting. What I want to do is to avoid running each model seperately (&lt;STRONG style="color: #ff0000;"&gt;red&lt;/STRONG&gt; highlighted). Any ideas on how I could do that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Courier New;"&gt;Many thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;"C:\Users\kg25\Desktop\Test Data.txt"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;dsd&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;'09'x&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;firstobs&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;lrecl&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;32767&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;stopover&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; date:&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;ddmmyy.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; (a1-a50)(:&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;numx.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;??);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; date &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;ddmmyy10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Courier New;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 10pt; font-family: Courier New;"&gt;*Create Returns and Squared Returns;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data2;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;vars(*) a1--a50;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; r(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;50&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; dim(vars);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;var(*) r1--r50;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; rsq(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;50&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; dim(var);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Courier New;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;*create time variable;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; data2;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; data2(firstobs=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;);time + &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;by date; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 10pt; font-family: Courier New;"&gt;*Choose in-sample;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; data3;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; data2(obs=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1303&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;*Create observations for 1 year;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data4;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;do&lt;/SPAN&gt; time = &lt;STRONG style="color: #339966;"&gt;1304&lt;/STRONG&gt; to &lt;STRONG style="color: #339966;"&gt;1564&lt;/STRONG&gt;;&lt;SPAN style="color: #0000ff;"&gt;output&lt;/SPAN&gt;;&lt;SPAN style="color: #0000ff;"&gt;end&lt;/SPAN&gt;;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;*merge data;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data5;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;merge&lt;/SPAN&gt; data3 data4;&lt;SPAN style="color: #0000ff;"&gt;by&lt;/SPAN&gt; time;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;*Estimate AR(1)-Garch (1,1) model;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080;"&gt;proc autoreg&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;data&lt;/SPAN&gt;=data5;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;model&lt;/SPAN&gt; &lt;STRONG style="color: #ff0000;"&gt;r1&lt;/STRONG&gt;= / &lt;SPAN style="color: #0000ff;"&gt;nlag&lt;/SPAN&gt;=&lt;STRONG style="color: #339966;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;garch&lt;/SPAN&gt;=(&lt;SPAN style="color: #0000ff;"&gt;q&lt;/SPAN&gt;=&lt;STRONG style="color: #339966;"&gt;1&lt;/STRONG&gt;, &lt;SPAN style="color: #0000ff;"&gt;p&lt;/SPAN&gt;=&lt;STRONG style="color: #339966;"&gt;1&lt;/STRONG&gt;) maxit=&lt;STRONG style="color: #339966;"&gt;50&lt;/STRONG&gt; noprint;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;output out&lt;/SPAN&gt;=data6 &lt;SPAN style="color: #0000ff;"&gt;cev&lt;/SPAN&gt;=&lt;STRONG style="color: #ff0000;"&gt;vhat1&lt;/STRONG&gt;;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;*merge data&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data7;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;merge&lt;/SPAN&gt; data6 data2;&lt;SPAN style="color: #0000ff;"&gt;by&lt;/SPAN&gt; time;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;*Compute Mean Absolute Error and Root Mean Square Error;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data8;&lt;SPAN style="color: #0000ff;"&gt;set&lt;/SPAN&gt; data7(firstobs=&lt;STRONG style="color: #339966;"&gt;1304&lt;/STRONG&gt;);&lt;BR /&gt;MAE=abs(&lt;STRONG style="color: #ff0000;"&gt;rsq1&lt;/STRONG&gt;-&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;vhat1&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;BR /&gt;RMSE=sqrt(&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;rsq1&lt;/STRONG&gt;&lt;/SPAN&gt;-&lt;STRONG style="color: #ff0000;"&gt;vhat1&lt;/STRONG&gt;);&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;proc means&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;data&lt;/SPAN&gt;=data8 &lt;SPAN style="color: #0000ff;"&gt;mean stderr prt&lt;/SPAN&gt;;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;var&lt;/SPAN&gt; mae rmse;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Feb 2015 19:15:58 GMT</pubDate>
    <dc:creator>Costasg</dc:creator>
    <dc:date>2015-02-26T19:15:58Z</dc:date>
    <item>
      <title>Macro for multiple GARCH Regressions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-for-multiple-GARCH-Regressions/m-p/184279#M46872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Courier New;"&gt;Hello everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Courier New;"&gt;I have 50 time-series, for which I need to run a GARCH model for volatility forecasting. What I want to do is to avoid running each model seperately (&lt;STRONG style="color: #ff0000;"&gt;red&lt;/STRONG&gt; highlighted). Any ideas on how I could do that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Courier New;"&gt;Many thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;"C:\Users\kg25\Desktop\Test Data.txt"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;dsd&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;'09'x&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;firstobs&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;lrecl&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;32767&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;stopover&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; date:&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;ddmmyy.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; (a1-a50)(:&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;numx.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;??);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; date &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;ddmmyy10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Courier New;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 10pt; font-family: Courier New;"&gt;*Create Returns and Squared Returns;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data2;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;vars(*) a1--a50;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; r(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;50&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; dim(vars);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;var(*) r1--r50;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; rsq(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;50&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; dim(var);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Courier New;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;*create time variable;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; data2;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; data2(firstobs=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;);time + &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;by date; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 10pt; font-family: Courier New;"&gt;*Choose in-sample;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; data3;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; data2(obs=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1303&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;*Create observations for 1 year;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data4;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;do&lt;/SPAN&gt; time = &lt;STRONG style="color: #339966;"&gt;1304&lt;/STRONG&gt; to &lt;STRONG style="color: #339966;"&gt;1564&lt;/STRONG&gt;;&lt;SPAN style="color: #0000ff;"&gt;output&lt;/SPAN&gt;;&lt;SPAN style="color: #0000ff;"&gt;end&lt;/SPAN&gt;;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;*merge data;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data5;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;merge&lt;/SPAN&gt; data3 data4;&lt;SPAN style="color: #0000ff;"&gt;by&lt;/SPAN&gt; time;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;*Estimate AR(1)-Garch (1,1) model;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080;"&gt;proc autoreg&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;data&lt;/SPAN&gt;=data5;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;model&lt;/SPAN&gt; &lt;STRONG style="color: #ff0000;"&gt;r1&lt;/STRONG&gt;= / &lt;SPAN style="color: #0000ff;"&gt;nlag&lt;/SPAN&gt;=&lt;STRONG style="color: #339966;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;garch&lt;/SPAN&gt;=(&lt;SPAN style="color: #0000ff;"&gt;q&lt;/SPAN&gt;=&lt;STRONG style="color: #339966;"&gt;1&lt;/STRONG&gt;, &lt;SPAN style="color: #0000ff;"&gt;p&lt;/SPAN&gt;=&lt;STRONG style="color: #339966;"&gt;1&lt;/STRONG&gt;) maxit=&lt;STRONG style="color: #339966;"&gt;50&lt;/STRONG&gt; noprint;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;output out&lt;/SPAN&gt;=data6 &lt;SPAN style="color: #0000ff;"&gt;cev&lt;/SPAN&gt;=&lt;STRONG style="color: #ff0000;"&gt;vhat1&lt;/STRONG&gt;;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;*merge data&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data7;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;merge&lt;/SPAN&gt; data6 data2;&lt;SPAN style="color: #0000ff;"&gt;by&lt;/SPAN&gt; time;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;*Compute Mean Absolute Error and Root Mean Square Error;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080;"&gt;data&lt;/STRONG&gt; data8;&lt;SPAN style="color: #0000ff;"&gt;set&lt;/SPAN&gt; data7(firstobs=&lt;STRONG style="color: #339966;"&gt;1304&lt;/STRONG&gt;);&lt;BR /&gt;MAE=abs(&lt;STRONG style="color: #ff0000;"&gt;rsq1&lt;/STRONG&gt;-&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;vhat1&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;BR /&gt;RMSE=sqrt(&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;rsq1&lt;/STRONG&gt;&lt;/SPAN&gt;-&lt;STRONG style="color: #ff0000;"&gt;vhat1&lt;/STRONG&gt;);&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;proc means&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;data&lt;/SPAN&gt;=data8 &lt;SPAN style="color: #0000ff;"&gt;mean stderr prt&lt;/SPAN&gt;;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;var&lt;/SPAN&gt; mae rmse;&lt;BR /&gt;&lt;STRONG style="color: #000080;"&gt;run&lt;/STRONG&gt;; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 19:15:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-for-multiple-GARCH-Regressions/m-p/184279#M46872</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2015-02-26T19:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for multiple GARCH Regressions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-for-multiple-GARCH-Regressions/m-p/184280#M46873</link>
      <description>&lt;P&gt;Transpose your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have for example r1-r50&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data transpose_reg;
set data5;
array r(50) r1-r50;
do i=1 to 50;
reg_var=r(i);
output;
end;
&amp;nbsp;
drop r1-r50;
run;
&amp;nbsp;
Proc sort data=transpose_reg;
by i;
run;
&amp;nbsp;
proc autoreg data=transpose_reg;
BY i;
model reg_var= / nlag=1 garch=(q=1, p=1) maxit=50 noprint;
output out=data6 cev=vhat;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 21:52:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-for-multiple-GARCH-Regressions/m-p/184280#M46873</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-09T21:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for multiple GARCH Regressions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-for-multiple-GARCH-Regressions/m-p/184281#M46874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks Reeza! It worked in this way as well!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 10:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-for-multiple-GARCH-Regressions/m-p/184281#M46874</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2015-02-28T10:36:43Z</dc:date>
    </item>
  </channel>
</rss>

