RATS 10.1
RATS 10.1

DUMMY( options )   series start end

DUMMY generates dummy variables and related series.

Parameters

series

series to define

start, end

range to set. By default, the standard workspace range.

Options

FROM=starting period for dummy treatment

TO=ending period for dummy treatment

FROM sets the starting period for the dummy treatment, while TO sets the ending period. Used alone or together, these define a shift dummy which is 0 outside the FROM, TO range, and 1 inside it.

 

FROM and TO are also used with the RAMP option and may be used with the LS option.

 

AO=period for additive outlier [not used]

AO=\({t_0}\) defines a dummy which is zero except for 1 at \({t_0}\).

 

LS=period for level shift dummy [not used]

LS=\({t_0}\) defines a dummy with a level shift at \({t_0}\). This will be -1 on [start,\({t_0}\)) and 0 on [\({t_0}\),end]. This form is chosen so the shift dummy is zero at the end of the sample. If you also use the FROM option, the dummy will be 0 on [start,FROM), -1 on [FROM,\({t_0}\)), and 0 on [\({t_0}\),end].

 

TC=period for temporary change dummy [not used]

RATE=rate of exponential decline [.7 per year]

TC=\({t_0}\) defines a dummy which is zero for t<\({t_0}\), 1 for t= \({t_0}\) and declines exponentially from \({t_0}\) until end at the rate defined by RATE.

 

RAMP/[NORAMP]

Defines a “ramp”, which is a temporary change in a linear trend (increasing at a rate of 1 per entry). The FROM and TO option define the limits of the trend shift. The dummy is (FROM-TO) from start until FROM, (T – TO) from FROM until TO and 0 after that. Again, this is designed to make the dummy zero at the end of the sample.

 

DTO=||month,day|| or ||month,day of week,count||

WFROM=number of days before DFROM at which effect starts

WTO=number of days before DTO at which effect ends

These can be used to define a dummy whose effect is split across two (or more periods) depending upon how many days fall into each period. The dummy sums to one across those periods, but the value for each month is the share of the covered days which lies within that.

DFROM and DTO provide the base date for the effect.

The ||month,day|| form is for a specific day of the month, for instance, ||12,25|| for Christmas. Use ||month,day of week,count|| for “floating” dates, given as the n’th occurrence in a given month of the specified day of the week. Days of the week is coded as 1=Monday,…,7=Sunday. So the second Sunday in May is ||5,7,2|| (5th month is May, 7th day is Sunday, 2 gives the 2nd occurrence in the month).

Use a negative value for count to count back from the end of the month, with -1 giving the last occurrence, -2 the next to last occurrence, etc.

Examples

dummy(ao=1987:10) temp

dummy(ls=1987:10) perm

 

defines TEMP as a single period dummy for 1987:10, and PERM as a level shift which is -1 through 1987:10 and 0 afterwards. This is used in the example INTERVENTION.RPF.


 

set trend = t

dummy(ramp,to=1981:1) tbreak

linreg y

# constant trend tbreak
 

estimates a regression with a broken trend, where the rate (but not the level) changes at 1981:1.


 

dummy(dfrom=||9,1,1||,wfrom=10,dto=||9,1,1||,wto=0) statefair

 

defines a split dummy in which the months of August and September in each year get the fraction of the 11 days up to and including U.S. Labor Day (first Monday in September) that fall in that month.

Checking Your Work

You can use PRINT or GRAPH to display your dummy variable as a way to verify that you’ve created it properly.


Copyright © 2025 Thomas A. Doan