# seasonaldummy

From forecast v2.13
by Rob Hyndman

##### Seasonal dummy variables

Returns matrix of dummy variables suitable for use in `arima`

or
`lm`

. The last season is omitted and used as the control.

- Keywords
- ts

##### Usage

```
seasonaldummy(x)
seasonaldummyf(x,h)
```

##### Arguments

- x
- Seasonal time series
- h
- Number of periods ahead to forecast

##### Value

- Numerical matrix with number of rows equal to the
`length(x)`

and number of columns equal to`frequency(x)-1`

.

##### Examples

```
plot(ldeaths)
plot(ldeaths)
month <- seasonaldummy(ldeaths)
deaths.lm <- lm(ldeaths ~ month)
tsdisplay(residuals(deaths.lm))
ldeaths.fcast <- predict(deaths.lm,
data.frame(month=I(seasonaldummyf(ldeaths,36))),
se.fit=TRUE)
```

*Documentation reproduced from package forecast, version 2.13, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.