The TSMODEL Procedure

Accumulation

If you specify the ACCUMULATE= option in the ID or VAR statement, observations in the table that is specified in the DATA= option in the PROC TSMODEL statement are accumulated within each time period. The frequency (width of each time interval) is specified by the INTERVAL= option in the ID statement. The ID variable contains the time ID values. Each time ID value is a SAS date or datetime that identifies the time period that contains the date or datetime. Accumulation is useful when the input table contains transactional data, whose observations are not spaced with respect to any particular time interval. The accumulated values form the time series, which is used in subsequent analyses.

For example, suppose an input table contains the following observations:

   19MAR1999    10
   19MAR1999    30
   11MAY1999    50
   12MAY1999    20
   23MAY1999    20

If INTERVAL=MONTH is specified in the ID statement, then all the preceding observations fall within a three-month period of time between March 1999 and May 1999. The observations are accumulated within each time period as follows:

  • If the ACCUMULATE=TOTAL option is specified, the resulting time series is

       01MAR1999    40
       01APR1999    .
       01MAY1999    90
    
  • If the ACCUMULATE=AVERAGE option is specified, the resulting time series is

       01MAR1999    20
       01APR1999    .
       01MAY1999    30
    
  • If the ACCUMULATE=MINIMUM option is specified, the resulting time series is

       01MAR1999    10
       01APR1999    .
       01MAY1999    20
    
  • If the ACCUMULATE=MAXIMUM option is specified, the resulting time series is

       01MAR1999    30
       01APR1999    .
       01MAY1999    50
    
  • If the ACCUMULATE=STDDEV option is specified, the resulting time series is

       01MAR1999    14.14
       01APR1999    .
       01MAY1999    17.32
    

As you can see from the preceding examples, the accumulated time series can have missing values even though the input table observations contain no missing values.

Last updated: September 15, 2022