<?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: Adjusting variables in a timeseries project in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984211#M5025</link>
    <description>&lt;P&gt;Strictly speaking PROC TIMESERIES is not for changing frequencies,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but it can be used for accumulating Transactional Data into Time Series Data (like quarterly data).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your source data is not transactional -- it is already a time series with a fixed-width interval (equally spaced) being weekly -- , but PROC TIMESERIES&amp;nbsp;couldn't care less.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[EDIT]&lt;BR /&gt;Adding an example from the documentation.&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/etsug/15.3/etsug_timeseries_examples01.htm" target="_blank"&gt;SAS Help Center: Accumulating Transactional Data into Time Series Data&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ciao,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Fri, 27 Feb 2026 13:06:27 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2026-02-27T13:06:27Z</dc:date>
    <item>
      <title>Adjusting variables in a timeseries project</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984165#M5021</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have in a timeseries project two variables: one with a weekly frequency that the data are reported in the beginning of the month and another that is quarterly and is being reported in the end of the month.&lt;/P&gt;
&lt;P&gt;What I want to do is that I want to adjust the weekly variable to the quarter variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using SAS Econometrics and Forecasting module on Viya.&lt;/P&gt;
&lt;P&gt;I have read through the documentation (ETS User's Guide) in the section "Specifying Observation Characteristics" and I saw this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc expand data=annual out=monthly
from=year to=month;
id date;
convert x y z;
convert a b c / observed=total;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However I have noticed the observed options and it provides the "end" keyword, on how to construct the interpolation of the series.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what I try to do is the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc expand data=wkl out=wkl_t from=week to=quarter;
&amp;nbsp;id pDate;
convert claims = claims_q / transformout=(sum) observed=end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Am I heading in the right direction?&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Vasileios&lt;/P&gt;</description>
      <pubDate>Thu, 26 Feb 2026 16:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984165#M5021</guid>
      <dc:creator>vfarmak</dc:creator>
      <dc:date>2026-02-26T16:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting variables in a timeseries project</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984195#M5022</link>
      <description>&lt;P&gt;You are not (entirely) heading in the right direction.&lt;/P&gt;
&lt;P&gt;You do &lt;U&gt;not&lt;/U&gt; need transformout=(sum) which is needed if you want a cumulative sum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this PROC EXPAND documentation page where they provide&amp;nbsp;&lt;SPAN&gt;two ways to convert from a higher frequency to a lower frequency.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmmvacdc/9.4/etsug/etsug_expand_gettingstarted02.htm" target="_blank"&gt;SAS Help Center: Aggregating to Lower Frequency Series&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note you can only use the first way discussed because the second one&amp;nbsp;&lt;SPAN&gt;does not allow conversion from non-nested intervals, such as converting from weekly to monthly or to quarterly values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The FROM=WEEK and TO=QUARTER (QTR) option values specify non-nested intervals. Remark that an ID variable must be used in PROC EXPAND for conversion between irregular intervals.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I have to admit my PROC EXPAND example that I was preparing for you does not work as expected (and I don't have time to explore this further).&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":frowning_face:"&gt;☹️&lt;/span&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":crying_face:"&gt;😢&lt;/span&gt;&lt;BR /&gt;I will send you a PROC TIMESERIES solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ciao,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 27 Feb 2026 09:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984195#M5022</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2026-02-27T09:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting variables in a timeseries project</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984198#M5023</link>
      <description>&lt;P&gt;I believe this is what you want. Correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data weekly;
 date='03AUG2025'd; claims =7;   output;
 date='10AUG2025'd; claims =20;  output;
 date='07DEC2025'd; claims =7;   output;
 date='21DEC2025'd; claims =20;  output;
 format date date7.;
run;

proc timeseries data=weekly out=quarterly;
   id date interval=quarter
           accumulate=total
           setmiss=0;
   var claims;
run;

data quarterly;
 set quarterly(rename=(claims=claims_q));
 date_end_quarter = INTNX('QTR',date,1) - 1;
 format date_end_quarter date7.;
 drop date;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Ciao,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 27 Feb 2026 09:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984198#M5023</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2026-02-27T09:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting variables in a timeseries project</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984208#M5024</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;&amp;nbsp;very much for the solution provided.&lt;/P&gt;
&lt;P&gt;I didn't know that proc timeseries was used also used for changing frequencies.&lt;/P&gt;
&lt;P&gt;I had the impression that only visualizes the timeseries.&lt;/P&gt;
&lt;P&gt;I will test it and I will let you know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Feb 2026 12:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984208#M5024</guid>
      <dc:creator>vfarmak</dc:creator>
      <dc:date>2026-02-27T12:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting variables in a timeseries project</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984211#M5025</link>
      <description>&lt;P&gt;Strictly speaking PROC TIMESERIES is not for changing frequencies,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but it can be used for accumulating Transactional Data into Time Series Data (like quarterly data).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your source data is not transactional -- it is already a time series with a fixed-width interval (equally spaced) being weekly -- , but PROC TIMESERIES&amp;nbsp;couldn't care less.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[EDIT]&lt;BR /&gt;Adding an example from the documentation.&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/etsug/15.3/etsug_timeseries_examples01.htm" target="_blank"&gt;SAS Help Center: Accumulating Transactional Data into Time Series Data&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ciao,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 27 Feb 2026 13:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984211#M5025</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2026-02-27T13:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting variables in a timeseries project</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984232#M5026</link>
      <description>&lt;P&gt;This also works :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data weekly;
 date='03AUG2025'd; claims =7;   output;
 date='10AUG2025'd; claims =20;  output;
 date='07DEC2025'd; claims =7;   output;
 date='21DEC2025'd; claims =20;  output;
 format date date7.;
run;

proc means data=weekly SUM nway noprint;
  CLASS date;
  VAR claims;
  output out=quarterly sum=claims_q;
  format date YYQ.;
run;

data quarterly;
 set quarterly;
 date_end_quarter = INTNX('QTR',date,1) - 1;
 format date_end_quarter date7.;
 drop date;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But be careful, because just like PROC TIMESERIES, PROC MEANS does not realize that the original data has a weekly interval. The above PROC MEANS only looks at the date (day!) and which quarter it belongs to (in the year).&lt;BR /&gt;So if you take the last day of the week to contain your weekly total instead of the first day, you will probably get a different result. This is because the first day of the week may fall in one quarter and the last day of the week in the following quarter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ciao,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 27 Feb 2026 18:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984232#M5026</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2026-02-27T18:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting variables in a timeseries project</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984316#M5027</link>
      <description>&lt;P&gt;Yes I think this is the one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically the first date of the month contains the data from the previous month (as it is reported in the beginning of the period).&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2026 13:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Adjusting-variables-in-a-timeseries-project/m-p/984316#M5027</guid>
      <dc:creator>vfarmak</dc:creator>
      <dc:date>2026-03-03T13:34:33Z</dc:date>
    </item>
  </channel>
</rss>

