<?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: The CUSUM Procedure for a simple time-series data in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/The-CUSUM-Procedure-for-a-simple-time-series-data/m-p/959184#M4939</link>
    <description>&lt;P&gt;I think this is a reasonable approach, but to detect a downward shift you probably want a one-sided scheme instead and a negative delta. You can add SCHEME=ONESIDED in the XCHART options. For a one-sided scheme, you need to specify the height of the decision interval with the H= option and omit the ALPHA= option. There is some discussion &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/qcug/qcug_cusum_sect031.htm" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;and see also "&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/qcug/qcug_cusum_sect035.htm" target="_self"&gt;Designing a CUSUM scheme&lt;/A&gt;"&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2025 14:59:56 GMT</pubDate>
    <dc:creator>Zard</dc:creator>
    <dc:date>2025-02-13T14:59:56Z</dc:date>
    <item>
      <title>The CUSUM Procedure for a simple time-series data</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/The-CUSUM-Procedure-for-a-simple-time-series-data/m-p/958527#M4938</link>
      <description>&lt;P&gt;Dear SAS Community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working with an annual univariate time series consisting of 75 observations. I suspect that at observation 33, an intervention caused a &lt;STRONG&gt;downward&lt;/STRONG&gt; shift in the mean of the series. My dataset contains a time variable labeled &lt;STRONG&gt;"Date"&lt;/STRONG&gt; and a response variable &lt;STRONG&gt;"Yt"&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;In the code below, I define the target mean as the average of the first 32 observations, along with the corresponding estimate of the standard deviation. I then apply the &lt;STRONG&gt;CUSUM&lt;/STRONG&gt; test to detect a potential mean shift.&lt;/P&gt;
&lt;P&gt;Could you please review my approach and let me know if this is the correct way to detect a mean shift in the series using &lt;STRONG&gt;PROC CUSUM&lt;/STRONG&gt;?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your insights!&lt;/P&gt;
&lt;PRE&gt;proc means data=a(obs=32);
    var Yt;
    output out=stats mean=mu0 std=sigma0;
run;

/* Store computed values as macro variables */
data _null_;
    set stats;
    call symputx("mu0", mu0);
    call symputx("sigma0", sigma0);
run;

ods graphics on;
title 'Two-sided CUSUM Chart';

proc cusum data=a;
    xchart Yt*Date / 
        mu0 = &amp;amp;mu0 
        sigma0 = &amp;amp;sigma0 
        delta = 2.6 
        alpha = 0.10; 
    label Yt = 'Cumulative Sum';
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Feb 2025 12:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/The-CUSUM-Procedure-for-a-simple-time-series-data/m-p/958527#M4938</guid>
      <dc:creator>sasalex2024</dc:creator>
      <dc:date>2025-02-06T12:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: The CUSUM Procedure for a simple time-series data</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/The-CUSUM-Procedure-for-a-simple-time-series-data/m-p/959184#M4939</link>
      <description>&lt;P&gt;I think this is a reasonable approach, but to detect a downward shift you probably want a one-sided scheme instead and a negative delta. You can add SCHEME=ONESIDED in the XCHART options. For a one-sided scheme, you need to specify the height of the decision interval with the H= option and omit the ALPHA= option. There is some discussion &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/qcug/qcug_cusum_sect031.htm" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;and see also "&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/qcug/qcug_cusum_sect035.htm" target="_self"&gt;Designing a CUSUM scheme&lt;/A&gt;"&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 14:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/The-CUSUM-Procedure-for-a-simple-time-series-data/m-p/959184#M4939</guid>
      <dc:creator>Zard</dc:creator>
      <dc:date>2025-02-13T14:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: The CUSUM Procedure for a simple time-series data</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/The-CUSUM-Procedure-for-a-simple-time-series-data/m-p/959246#M4941</link>
      <description>&lt;P&gt;Thank you Zard for your valuable advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you think the code below is correct for the problem I have? I mostly copied it from&amp;nbsp;&lt;I&gt;Chapter 7: The CUSUM Procedure &lt;/I&gt;(p. 562)&lt;I&gt;.&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc means data=a(obs=33);
    var Yt;
    output out=stats mean=mu0 std=sigma0;
run;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;set stats;&lt;BR /&gt;call symputx("mu0", mu0);&lt;BR /&gt;call symputx("sigma0", sigma0);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;options nogstyle;&lt;BR /&gt;goptions ftext='albany amt';&lt;BR /&gt;symbol v=dot color=salmon h=1.8 pct; &lt;BR /&gt;title "One-Sided Cusum Analysis"; &lt;BR /&gt;&lt;BR /&gt;proc cusum data=a; &lt;BR /&gt;xchart Yt*Date/ &lt;BR /&gt;mu0=&amp;amp;mu0 &lt;BR /&gt;sigma0=&amp;amp;sigma0 &lt;BR /&gt;delta=-1 &lt;BR /&gt;h=4 &lt;BR /&gt;k=0.5 &lt;BR /&gt;scheme=onesided &lt;BR /&gt;tableall &lt;BR /&gt;cinfill = ywh &lt;BR /&gt;cframe = bigb &lt;BR /&gt;cout = salmon &lt;BR /&gt;cconnect = salmon &lt;BR /&gt;climits = black &lt;BR /&gt;coutfill = bilg; &lt;BR /&gt;label Yt = 'Cusum of Yt'; &lt;BR /&gt;run; &lt;BR /&gt;options gstyle;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 13:42:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/The-CUSUM-Procedure-for-a-simple-time-series-data/m-p/959246#M4941</guid>
      <dc:creator>sasalex2024</dc:creator>
      <dc:date>2025-02-14T13:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: The CUSUM Procedure for a simple time-series data</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/The-CUSUM-Procedure-for-a-simple-time-series-data/m-p/959249#M4942</link>
      <description>&lt;P&gt;Yes, that's probably what you want. (As an aside, you can remove the traditional-graphics code options that are in there. The default now is for ODS Graphics to be enabled, which means older options for traditional graphics are ignored. You can omit all of the color options like CINFILL, and the SYMBOL statement is not applicable either.)&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 14:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/The-CUSUM-Procedure-for-a-simple-time-series-data/m-p/959249#M4942</guid>
      <dc:creator>Zard</dc:creator>
      <dc:date>2025-02-14T14:50:41Z</dc:date>
    </item>
  </channel>
</rss>

