Learn R Programming

jumps (version 1.0)

dummyseas: Seasonal dummy variables

Description

It produces a matrix with seasonal dummies summing to zero to be used as regressors. If \(s\) is the seasonal period, then the \(j\)-th dummy equals 1 in season \(j\) and \(-1/(s-1)\) in the other seasons, so that the variable sums to 0 over one year period.

Usage

dummyseas(n, s, remove = s)

Value

It returns a matrix with \(n\) rows and \(s-1\)

column unless remove = NULL.

Arguments

n

length of time series;

s

seasonal period;

remove

to avoid collinearity with the constant remove a column, by default it is column s; if NULL no column is removed.

Examples

Run this code
y <- log(AirPassengers)
X <- dummyseas(length(y), 12)
X <- cbind(X, t = 1:length(y))
reg <- lm(y~X)

Run the code above in your browser using DataLab