# R-comments - Indicator Variables for Seasonal Time Series A...

This preview shows pages 1–4. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Indicator Variables for Seasonal Time Series A simple way to estimate seasonal effects in a time series; e.g., for quarterly data: Set up four indicator (dummy) variables, one for each quarter; Use them as inputs in a regression model. Similarly for monthly data: twelve monthly indicators. 1 In R, you can create the indicators manually. E.g., for a series x , Shumway and Stoffer suggest essen- tially: Q1 = rep(c(1, 0, 0, 0), length(x) / 4) etc. You can then use lm() to fit the regression; E.g., for the Johnson & Johnson quarterly earnings, fitting a linear trend and the quarterly indicators: summary(lm(log(jj) time(jj) + Q1 + Q2 + Q3 + Q4)) For a monthly series, this would be tedious. 2 R has some tools that can help: If x is a seasonal time series (i.e., frequency(x) > 1 ), cycle(x) creates a companion time series whose value is the corre- sponding season....
View Full Document

## This note was uploaded on 05/26/2010 for the course STAT 443 taught by Professor Yuliagel during the Winter '09 term at Waterloo.

### Page1 / 10

R-comments - Indicator Variables for Seasonal Time Series A...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online