The HPFEVENTS Procedure

EVENTDEF Statement

  • EVENTDEF SAS-variable-name=timing-value-list < / qualifier-options>;

The EVENTDEF statement defines an event that can be included in forecasting models.

You must specify a variable name and a timing value list as follows:

SAS-variable-name

specifies a valid SAS variable name.

timing-value-list

specifies one or more timing values. Each value can be a SAS date keyword, an integer, a SAS date, a SAS datetime, or a do-list. For more information, see the section Event Definitions.

You can specify the following qualifier-options:

AFTER=( <DURATION=number> <SLOPE=DECAY | GROWTH> )

specifies options that control the event definition after the timing value. You can specify the following suboptions within the parentheses:

DURATION=number

specifies the event duration after the timing value.

SLOPE=DECAY | GROWTH

controls the slope after the timing value. You can specify either of the following values:

DECAY

creates a slope away from the peak value.

GROWTH

creates a slope toward the peak value.

This suboption is ignored unless TYPE=RAMP, TYPE=TR, TYPE=TEMPRAMP, or TYPE=TC; it is also ignored if DURATION=0. For more information, see the section Details of Event Specifications.

By default, SLOPE=GROWTH in all cases except TYPE=TC. When TYPE=TC, the default is AFTER=(SLOPE=DECAY).

BEFORE=( <DURATION=number> <SLOPE=DECAY | GROWTH> )

specifies options that control the event definition before the timing value. You can specify the following suboptions within the parentheses:

DURATION=number

specifies the event duration before the timing value.

SLOPE=DECAY | GROWTH

controls the slope before the timing value.

You can specify either of the following values:

DECAY

creates a slope away from the peak value.

GROWTH

creates a slope toward the peak value.

This suboption is ignored unless TYPE=RAMP, TYPE=TR, TYPE=TEMPRAMP, or TYPE=TC; it is also ignored if DURATION=0. For more information, see the section Details of Event Specifications.

By default, SLOPE=GROWTH in all cases except TYPE=TC. When TYPE=TC, the default is BEFORE=(SLOPE=GROWTH).

LABEL='SAS-label'

specifies a label for the dummy variable for this event definition, where SAS-label is a quoted text string of up to 256 characters. The label is also stored as a description in the data set that is specified in the OUT= option in the EVENTDATA statement. If you do not specify this option, then "." is displayed in the data set that is specified in the OUT=option in the EVENTDATA statement, but the default label ('Dummy Variable for Event variable-name,' where variable-name is the name specified in the EVENT statement) is still used for the dummy variable.

LOCALE='POSIX-locale'

specifies a locale that is associated with the event. The locale should be a POSIX locale value. By default, no locale is associated with the event.

PERIOD=interval

specifies the interval for the frequency of the event. For example, PERIOD=YEAR should produce a dummy value that is periodic in a yearly pattern. If you do not specify this option, the event is not periodic. The PERIOD= option also does not apply to observation numbers (which are not periodic) or to date keywords (which have their own periodicity). For information about which intervals you can specify, see Chapter 4, Date Intervals, Formats, and Functions (SAS/ETS User's Guide).

PULSE=interval

specifies the interval to be used, which along with the DURATION= suboption in either the AFTER= option or in the BEFORE= option determines the width of the event. The default pulse is one observation. If you specify this option but you do not specify any DURATION= values, the DURATION= values are set to 0. For information about which intervals you can specify, see Chapter 4, Date Intervals, Formats, and Functions (SAS/ETS User's Guide).

RULE=ADD | MAX | MIN | MINMAG | MINNZ | MULT

specifies the action to take when the defined event has multiple timing values that overlap. When the timing values do not overlap, this option has no impact because only the one defined value for an observation is always used. You can specify the following values:

ADD

adds the values.

MAX

uses the maximum value.

MIN

uses the minimum value.

MINMAG

uses the value whose magnitude is the lowest.

MINNZ

uses the minimum nonzero value.

MULT

multiplies the values.

By default, RULE=ADD.

Because the range of the event that is associated with a timing value might not include all the observations in the series, this option can be interpreted differently when you use multiple timing values in one EVENTDEF statement than when you define a combination event by using the EVENTCOMB statement. Thus, the dummy variables TWOTIMING and TWOEVENTS that are defined in the following statements are different:

   eventdef xmasrp= christmas / before=(slope=growth duration=3)
                                type=ramp rule=min ;
   eventdef easterrp= easter  / before=(slope=growth duration=3)
                                type=ramp rule=min ;
   eventdef twotiming= easter christmas /
                                before=(slope=growth duration=3)
                                type=ramp rule=min ;
   eventcomb twoevents= easterrp xmasrp / rule=min ;

Example 7.1 shows how PROC HPFEVENTS interprets each of these statements.

SHIFT=delta

specifies the number of pulses (delta) by which to shift the timing value. When you specify this option, all timing values in the list (including those generated by date keywords) are shifted. Thus, you can use this option with EASTER to specify ecclesiastical holidays that are based on Easter. Definitions for some moveable Christian holidays based on Easter are given in Reingold and Dershowitz (2001, p. 122). For example, the following statement specifies Good Friday, which is defined as two days before Easter:

EVENTDEF GoodFriday= EASTER / SHIFT=-2 PULSE=DAY;

By default, SHIFT=0, which does not shift the timing value.

TCPARM=number

specifies a number, 0 less-than-or-equal-to sans-serif-italic number less-than-or-equal-to 1, that represents the rate of growth or decay. This number is used as phi in the growth/decay equation for TYPE=TC, as shown in Table 7. A larger number causes faster growth or decay. This option is ignored unless TYPE=TC. By default, TCPARM=0.5.

TYPE=type

specifies the type of the event variable. Each type uses a different formula to create the dummy variables. The formula for each TYPE= option is dependent on other qualifier-options that are specified in this statement. The formula is applied to each timing value that is specified in the timing-value list. You can specify the following values for type: POINT | LS | RAMP | TR | TEMPRAMP | TC | LIN | LINEAR | QUAD | CUBIC | INV | INVERSE | LOG | LOGARITHMIC. Table 8 and Table 9 illustrate the basic shape for each TYPE= value. By default, TYPE=POINT.

VALUE=nu

specifies the event indicator value. Table 7 provides details about the effect of nu on the dummy variables. However, for event definitions that have TYPE=POINT | LS | RAMP | TR | TC events and consist of a single timing value that has finite duration, you can think of the event indicator value as the maximum amplitude: the values of the dummy variable should be bounded below by 0 and above by nu. For trend events (TYPE = LINEAR | QUAD | CUBIC | INV | LOG ), nu is the coefficient of the term.

By default, VALUE=1.

Last updated: March 05, 2026