CARIMA Procedure

Getting Started: CARIMA Procedure

This section outlines the use of the CARIMA procedure and gives a cursory description of the ARIMA modeling process for readers who are less familiar with these methods.

Given an input data table that contains numerous time series variables recorded at a specific frequency, the CARIMA procedure can fit an ARIMA model to the series and produce forecasts.

For example, suppose that the input data table mylib.Sales contains sales data that were recorded monthly, the variable that represents time is Date, and the forecasts are to be recorded in the output data table mylib.NextYear. If you believe that sales in the current month are affected only by sales in the previous month, then you can use the CARIMA procedure to fit an AR(1) model and forecasts sales for the next four months as follows:

data mylib.sales;
   format date date9.;
   input date : date9. shoes socks laces dresses
                       coats shirts ties belts hats blouses;
   datalines;
01JAN1994 3557 3718 6368.80 575  987 10.8200 15.0000 102.600 12410 15013
01FEB1994 5128 4174 8123.20 565 1000 12.1200 15.1000  99.900 13556 12413
01MAR1994 5222 4482 7807.20 406 1005 11.7800 15.3000 102.000 11063 12752

   ... more lines ...   

01DEC1998 5399 4795 6075.30 614 1239 21.2000  1.9000  79.700 23004 22044
01JAN1999 6405 4981 6812.10 607 1196 20.7000 14.9000  99.900 20583 26093
;

proc carima data=mylib.sales outfor=mylib.nextyear;
   id date interval=month;
   identify _numeric_;
   estimate p =1;
   forecast lead=4;
run;

These statements assume that the SAS library is named mylib, but you can substitute any appropriately named SAS library. These statements generate forecasts for every numeric variable in the input data table mylib.Sales for the next four months and store these forecasts in the output data table mylib.NextYear. Other output data tables can be specified to store the parameter estimates and summary data.

The CARIMA procedure can forecast time series data, whose observations are equally spaced by a specific time interval (for example, monthly or weekly), or transactional data, whose observations are not spaced with respect to any particular time interval.

Given an input data table that contains transactional variables that are not recorded at any specific frequency, the CARIMA procedure accumulates the data to a specific time interval and forecasts the accumulated series. For an example, see Example 5.1: Seasonal Model for the Airline Series.

Last updated: July 09, 2026