tsDummy: Generates a ts object for a dummy variable.

Description Usage Arguments Details Value See Also Examples

Description

Generates a ts object filled with 0's, with 1's in a period or specific dates.

Usage

1
tsDummy(start, end, frequency = 12, period = NULL, dates = NULL)

Arguments

start

Same as the start option in a ts object.

end

Same as the end option in a ts object.

frequency

Same as the frequency option in a ts object.

period

(optional) List with two elements: the starting and ending dates for the 1's formated as for ex. c(2008,12).

dates

(optional) List of discontinuous dates formated as for ex. c(2008,12).

Details

Note that more than one period can be specified.

Value

ts object with 1's and 0's.

See Also

tsComplete

Examples

1
2
3
4
lehman <- tsDummy( start=c(2000,1), end=c(2015,12), freq=12, period=list( c(2008,9), c(2008,12) ))

oilshocks <- tsDummy( start=c(1970,1), end=c(2015,12), freq=12,
                                         dates=list( c(1973,10), c(1979,12), c(1990,10), c(2008,6) )  )

fcbarbi/macroR documentation built on May 16, 2019, 12:05 p.m.