STAT 451, Day 18

Visualizing Patterns over Time

Hot Dog Eating, stacked bargraphs with R

The Hot Dog Eating example gives a good idea how to work with R to make bargraphs.

Try the author's program stackedbars.R

FlowingData subscribers, time plot with R

The FlowingData Subscribers example give a good idea of how to work with R to make time plots.

Try the author's program scatter.R or see

Activity Two: scatter.Rmd

What does type=“h” do in a plot() command?

What does the points() command do?

US Postage, step chart with R

The US Postage example gives a good idea how to work with R to make step charts.

A step chart is for data in time that changes at a spcific time. US Postage rates change on specific dates.

Try the author's program step.R or try

Activity Three: step.Rmd

US Postage, step chart with R

Reproduce the plots on page 126.

What does type=“s” do in a plot() command?

What does the points() command do?

Smoothing Data with R

When looking at time series data it is common to examine time series plots for an underlying trend. The trend may linear or nonliear or may be periodic.

The use of linear regression is common to see linear and nonlinear (quadratic, cubic, etc.) trends.

The use of LOESS is commonly used when the data is not periodic. LOESS is locally weighted scatterplot smoothing.

LOESS gives an easy way to smooth the data. Small slices are fitted with a low-degree polynomial, then the small curves a put together.

Unemployment Data, step chart with R

The Unemployment example gives a good idea how to work with R to smooth time series data using LOESS.

Try the author's program loess.R or try

Activity Five: loess.Rmd