<?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 Testing for Constant Variance in Residuals Using PROC ARIMA in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955094#M4916</link>
    <description>&lt;P&gt;Dear SAS Community,&lt;/P&gt;
&lt;P&gt;I would like to ask for your advice on how to perform a formal test for constant variance (homoscedasticity) in the innovation series when using the proc arima procedure.&lt;/P&gt;
&lt;P&gt;For example, the code below runs SARIMA (0,1,1)x(0,1,1)_12 model and generates a residual plot, which can visually help in identifying variance changes:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc arima data=a
plots(only)=(residual(smooth));
identify var=Zt(1,12);
estimate p=(0)(0) q=(1)(12) method=ml noconstant;
run; &lt;/LI-CODE&gt;
&lt;P&gt;However, I was wondering if it is possible to conduct a formal test to determine whether the residuals of a fitted model are homoscedastic.&lt;/P&gt;
&lt;P&gt;I’ve heard about a series of tests developed by McLeod and his co-authors, but I’m not sure how to implement such (or any relevant) tests in SAS.&lt;/P&gt;
&lt;P&gt;I would greatly appreciate your guidance on this topic.&lt;/P&gt;</description>
    <pubDate>Sat, 04 Jan 2025 04:38:56 GMT</pubDate>
    <dc:creator>sasalex2024</dc:creator>
    <dc:date>2025-01-04T04:38:56Z</dc:date>
    <item>
      <title>Testing for Constant Variance in Residuals Using PROC ARIMA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955094#M4916</link>
      <description>&lt;P&gt;Dear SAS Community,&lt;/P&gt;
&lt;P&gt;I would like to ask for your advice on how to perform a formal test for constant variance (homoscedasticity) in the innovation series when using the proc arima procedure.&lt;/P&gt;
&lt;P&gt;For example, the code below runs SARIMA (0,1,1)x(0,1,1)_12 model and generates a residual plot, which can visually help in identifying variance changes:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc arima data=a
plots(only)=(residual(smooth));
identify var=Zt(1,12);
estimate p=(0)(0) q=(1)(12) method=ml noconstant;
run; &lt;/LI-CODE&gt;
&lt;P&gt;However, I was wondering if it is possible to conduct a formal test to determine whether the residuals of a fitted model are homoscedastic.&lt;/P&gt;
&lt;P&gt;I’ve heard about a series of tests developed by McLeod and his co-authors, but I’m not sure how to implement such (or any relevant) tests in SAS.&lt;/P&gt;
&lt;P&gt;I would greatly appreciate your guidance on this topic.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 04:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955094#M4916</guid>
      <dc:creator>sasalex2024</dc:creator>
      <dc:date>2025-01-04T04:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for Constant Variance in Residuals Using PROC ARIMA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955107#M4917</link>
      <description>&lt;UL class="lia-list-style-type-square"&gt;
&lt;LI&gt;SAS/ETS User's Guide -- AUTOREG Procedure&lt;BR /&gt;Testing for Heteroscedasticity&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_057/etsug/etsug_autoreg_gettingstarted11.htm" target="_blank"&gt;SAS Help Center: Testing for Heteroscedasticity&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;SAS/ETS User's Guide -- MODEL Procedure&lt;BR /&gt;Heteroscedasticity&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_057/etsug/etsug_model_sect121.htm" target="_blank"&gt;SAS Help Center: Heteroscedasticity&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 10:42:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955107#M4917</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2025-01-04T10:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for Constant Variance in Residuals Using PROC ARIMA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955109#M4918</link>
      <description>&lt;PRE&gt;proc arima data=a
identify var=Zt(1,12);
estimate p=(0)(0) q=(1)(12) method=ml noconstant;
forecast lead=0 interval=month id=Date out=results;
run; 

data residuals_only;
set results;
if not missing(residual) then do; 
        Time + 1; 
        output; 
    end;
keep residual Time;
run;

/* Test for heteroscedastic residuals */
proc autoreg data=residuals_only;
   model residual = Time / archtest;
   output out=r r=yresid;
run;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Jan 2025 13:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955109#M4918</guid>
      <dc:creator>sasalex2024</dc:creator>
      <dc:date>2025-01-04T13:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for Constant Variance in Residuals Using PROC ARIMA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955110#M4919</link>
      <description>&lt;P&gt;Thank you very much&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="lia-link-navigation lia-page-link lia-user-name-link" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547" target="_blank"&gt;&lt;SPAN class="login-bold"&gt;sbxkoenk&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;for the quick and detailed reply. Based on this, I've replied to my own question with a code, do you think it is acceptable as a solution? Thank you very much again.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 13:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955110#M4919</guid>
      <dc:creator>sasalex2024</dc:creator>
      <dc:date>2025-01-04T13:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for Constant Variance in Residuals Using PROC ARIMA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955142#M4920</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt; ...&amp;nbsp;&lt;SPAN&gt;, I've replied to my own question with a code, do you think it is acceptable as a solution? Thank you very much again.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It's oké.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But you need to terminate PROC ARIMA with a QUIT; statement. PROC ARIMA is an interactive procedure.&lt;BR /&gt;Because the PROC ARIMA is followed by a data step (in your code) , there's an implicit QUIT ... but still I prefer to put it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you only submit the PROC ARIMA part , you will notice the last statement (the forecast statement) is not executed. The output dataset with residuals is not created.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://blogs.sas.com/content/iml/2024/10/09/interactive-procedures-sas.html" target="_blank"&gt;Interactive procedures in SAS - The DO Loop&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/12/14/sas-studio-interactive-iml.html" target="_blank"&gt;Running interactive procedures in SAS Studio and SAS University Edition - The DO Loop&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://blogs.sas.com/content/iml/2016/07/20/unnecessary-sas-statements.html" target="_blank"&gt;Do you write unnecessary SAS statements? - The DO Loop&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ciao,&lt;BR /&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jan 2025 14:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955142#M4920</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2025-01-05T14:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for Constant Variance in Residuals Using PROC ARIMA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955144#M4921</link>
      <description>&lt;P&gt;This page contains all the info to interpret the output of ARCHTEST option in PROC AUTOREG!&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_057/etsug/etsug_autoreg_gettingstarted11.htm" target="_blank"&gt;SAS Help Center: Testing for Heteroscedasticity&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note that you can ask for different flavours of this ARCHTEST option.&lt;/P&gt;
&lt;UL class="lia-list-style-type-square"&gt;
&lt;LI&gt;model y &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; time &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; archtest&amp;nbsp;&lt;FONT color="#a67f59"&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;model y &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; time &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; archtest&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;qlm&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;model y &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; time &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN&gt; archtest&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;lk&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;wl&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tested ARCHTEST option myself with seriesg (series-G).&lt;/P&gt;
&lt;P&gt;Here's more info on&amp;nbsp;Box and Jenkins Series-G (International Airline Passengers)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_arima_examples02.htm" target="_blank"&gt;SAS Help Center: Seasonal Model for the Airline Series&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*-- Seasonal Model for the Airline Series --*/
data seriesg;
 set sashelp.air;
 xlog = log( air );
run;

proc arima data=seriesg;
   identify var=xlog(1,12);
   estimate q=(1)(12) noint method=ml;
   forecast id=date lead=0 interval=month printall out=b;
run;
QUIT;

data c;
 set b;
 where residual is not missing;
 Time + 1;
run;

/* Test for heteroscedastic residuals */
proc autoreg data=c;
   model residual = Time / archtest;
  *output out=r r=yresid;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jan 2025 14:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Testing-for-Constant-Variance-in-Residuals-Using-PROC-ARIMA/m-p/955144#M4921</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2025-01-05T14:22:06Z</dc:date>
    </item>
  </channel>
</rss>

