seasonal.dummies | R Documentation |
Generate variables of seasonal dummies and seasonal cycles.
seasonal.dummies(x)
seasonal.cycles(x)
x |
a univariate seasonal time series. |
A multivariate time series containing the dummies or cycles by columns.
# In terms of model fitting
# both sets of variables are equivalent
x <- diff(log(AirPassengers))
sd <- seasonal.dummies(x)
fit1 <- lm(x ~ sd[,-1])
summary(fit1)
sc <- seasonal.cycles(x)
fit2 <- lm(x ~ sc)
summary(fit1)
all.equal(fitted(fit1), fitted(fit2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.