periodic.dummies: Periodic dummies and contrasts

View source: R/variables.R

periodic.dummiesR Documentation

Periodic dummies and contrasts

Description

Periodic dummies and contrasts

Usage

periodic.dummies(frequency, start, length, s)

periodic.contrasts(frequency, start, length, s)

Arguments

frequency

Frequency of the series, number of periods per year (12,4,3,2..)

start, length

First date (array with the first year and the first period) (for instance c(1980, 1)) and number of periods of the output variables. Can also be provided with the s argument

s

time series used to get the dates for the trading days variables. If supplied the parameters frequency, start and length are ignored.

Details

The function periodic.dummies creates as many time series as types of periods in a year (4 or 12) with the value one only for one given type of period (ex Q1) The periodic.contrasts function is based on periodic.dummies but adds -1 to the period preceding a 1.

Examples

# periodic dummies for a quarterly series
p <- periodic.dummies(4, c(2000, 1), 60)
# periodic contrasts for a quarterly series
q <- periodic.contrasts(4, c(2000, 1), 60)
q[1:9, ]

palatej/rjd3toolkit documentation built on Oct. 30, 2024, 10:46 p.m.