<< diff_date Time series extrap >>

Grocer >> Time series > dummy

dummy

create a dummy variable

CALLING SEQUENCE

dum=dummy(boun,subperiod)

PARAMETERS

Input

* boun = a (2x1) string vector of dates

* subperiod =

   - either a string scalar if the dummy is relative to the lone date subperiod

   - or a (2 x1) string vector if the dummy is relative to the period subperiod(1) to subperiod(2)

 

Output

* dum = a ts equal to 1 for the period subperiod, O otherwise

DESCRIPTION

Creates a dummy variable equal to 1 over a sub-period, 0 over the rest of the period.

EXAMPLE

d79m4=dummy(['1970m1';'2007m12'],'1979m4')
// creates a dummy variable on the period going from the 1st month of 1970 until the the last month of 2007, equal to 1 in the 4th month of 1979 and 0 elsewhere.
d=dummy(['1970q1';'2007q4'],['1980q1';'1989q2'])
//creates a dummy variable on the period going from the 1st quarter of 1970 until the the last quarter of 2007, equal to 1 from the first quarter of 1980 until the second quarter of 1989.

AUTHOR

Eric Dubois 2007

Report an issue
<< diff_date Time series extrap >>