node10 Lab 4 - Smoothing and Removing Trends STAT 510 - Applied Time Series Analysis

Node10 Lab 4 - Smoothing and Removing Trends STAT 510 - Applied Time Series Analysis

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
This is Google's cache of http://onlinecourses.science.psu.edu/stat510/node/11 . It is a snapshot of the page as it appeared on 19 Jul 2010 04:58:34 GMT. The current page could have changed in the meantime. Learn more Text-only version STAT 510 - Applied Time Series Analysis ANGEL Department of Statistics Eberly College of Science Home Lab 4 - Smoothing and Removing Trends In this lab, we will learn how to use several R commands to smooth a time series and remove trends. 1. Start by creating a new folder 'lab4' and download the file " gas.dat " (right-click > Save Link As. ..). This data file contains monthly heating oil prices from July 1973 to December 1987. Don't forget to change the working directory in R so that it refers to this new folder. Load the data into R using the command: gas=scan("gas.dat") Plot the data. 2. We can take a moving average of the data by using the filter() command in R. Take the moving average over twelve observations using the command: magas=filter(gas,rep(1,12)/12)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Node10 Lab 4 - Smoothing and Removing Trends STAT 510 - Applied Time Series Analysis

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online