periodic.dummies | R Documentation |
Periodic dummies and contrasts
periodic.dummies(frequency, start, length, s)
periodic.contrasts(frequency, start, length, s)
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 |
s |
time series used to get the dates for the trading days variables. If supplied the
parameters |
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.
# 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, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.