Top Banner
Chapter 10 – Basic Regression Analysis with Time Series Data
64

Chapter 10 – Basic Regression Analysis with Time Series Data

Feb 08, 2016

Download

Documents

Amora

Chapter 10 – Basic Regression Analysis with Time Series Data. What is Time Series Data and why is it Different?. There is a time ordering of the data The past can affect the future, but the future cannot affect the past. Example: National population from 1900 to 2006 (data set NATPOP). - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 10 – Basic Regression Analysis with Time Series Data

Chapter 10 – Basic Regression Analysis with Time Series Data

Page 2: Chapter 10 – Basic Regression Analysis with Time Series Data

What is Time Series Data and why is it Different?

• There is a time ordering of the data• The past can affect the future, but the future

cannot affect the past.

Example: National population from 1900 to 2006 (data set NATPOP)

Page 3: Chapter 10 – Basic Regression Analysis with Time Series Data

What is Time Series Data and why is it Different?

• Random nature of times series data• Formally, the process that generates time

series data is called a stochastic or time series process

Page 4: Chapter 10 – Basic Regression Analysis with Time Series Data

What is Time Series Data and why is it Different?

• Random nature of times series data• Random sample from a population vs.

random sample of time series data

Page 5: Chapter 10 – Basic Regression Analysis with Time Series Data

Examples of Time Series Data: Uncorrelated data, constant process model

Page 6: Chapter 10 – Basic Regression Analysis with Time Series Data

Examples of Time Series Data: Autocorrelated data

Page 7: Chapter 10 – Basic Regression Analysis with Time Series Data

Examples of Time Series Data: Trend

Page 8: Chapter 10 – Basic Regression Analysis with Time Series Data

Examples of Time Series Data: Cyclic or seasonal data

Page 9: Chapter 10 – Basic Regression Analysis with Time Series Data

Examples of Time Series Data: Nonstationary data

Page 10: Chapter 10 – Basic Regression Analysis with Time Series Data

Examples of Time Series Data: A mixture of patterns

Page 11: Chapter 10 – Basic Regression Analysis with Time Series Data

Cyclic patterns of different magnitudes

Page 12: Chapter 10 – Basic Regression Analysis with Time Series Data

Atypical events

Page 13: Chapter 10 – Basic Regression Analysis with Time Series Data

13

Atypical events

Page 14: Chapter 10 – Basic Regression Analysis with Time Series Data

Famous Time Series Expert –Yogi Berra

The future ain’t what it used to be.

Page 15: Chapter 10 – Basic Regression Analysis with Time Series Data

Famous Time Series Expert –Yogi Berra

You can observe a lot just by watching.

The basic graphical display for time series data is the time series plot which is just a graph of the observations vs. time periods.

Page 16: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Plot Example

Open TRAFFIC2 data set and make time series plot of year vs. statewide total accidents (totacc)

In Minitab need to choose series and time stamp

Page 17: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Plot Example

Page 18: Chapter 10 – Basic Regression Analysis with Time Series Data

Time series plots

Notice that the histograms look very similar even though the time series behavior is very different

Page 19: Chapter 10 – Basic Regression Analysis with Time Series Data

Histogram of totacc

Page 20: Chapter 10 – Basic Regression Analysis with Time Series Data

When there are two or more variables of interest, scatter plots can be useful

Page 21: Chapter 10 – Basic Regression Analysis with Time Series Data

Forecasting

It is difficult to make predictions, especially about the future. – Neils Bohr

Page 22: Chapter 10 – Basic Regression Analysis with Time Series Data

Forecasting

Page 23: Chapter 10 – Basic Regression Analysis with Time Series Data

Forecasting is useful in many fields:

Business and industryEconomicsFinanceEnvironmental sciencesSocial sciencesPolitical sciences

Page 24: Chapter 10 – Basic Regression Analysis with Time Series Data

Data Analysis Process:

1. Problem definition2. Data collection3. Data analysis4. Model selection and fitting5. Model validation6. Model deployment7. Monitoring forecasting model

performance

Page 25: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

gfr – number of children born to every 1,000 women of childbearing age from 1913 to 1984.

Make a time series plot of gfr

Page 26: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Page 27: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

pe – average real dollar value of the personal tax exemption from 1913 to 1984.

Make a time series plot of pe

Page 28: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Page 29: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

We want to predict gfr.

Lets try this model:

Page 30: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

We want to predict gfr.

Notation for time series model slightly different:

Page 31: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

The regression equation isgfr = 96.3 - 0.0071 pe

Predictor Coef SE Coef T PConstant 96.344 4.305 22.38 0.000pe -0.00710 0.03592 -0.20 0.844

S = 19.9400 R-Sq = 0.1% R-Sq(adj) = 0.0%

Page 32: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

residual plots

Page 33: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

residual plots

Page 34: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

residual plots

Page 35: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

residual plots

Page 36: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

This model suffers from misspecification.

Page 37: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3Scatter plot of gfr vs. pe

Page 38: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3What could affect general fertility rate in the U.S.? Many things!How about these two:• World War II• Availability of the birth control pill

Page 39: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3ww2 is a dummy variable• 1 if year is 1941 through 1945• 0 otherwisepill is a dummy variable • 1 if year is 1963 or greater• 0 otherwise

Page 40: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Fit this model with two dummy variables.

Page 41: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

gfr = 98.7 + 0.0825 pe - 24.2 ww2 - 31.6 pill

Predictor Coef SE Coef T PConstant 98.682 3.208 30.76 0.000pe 0.08254 0.02965 2.78 0.007ww2 -24.238 7.458 -3.25 0.002pill -31.594 4.081 -7.74 0.000

S = 14.6851 R-Sq = 47.3% R-Sq(adj) = 45.0%

Page 42: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 43: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 44: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 45: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 46: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 47: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 48: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 49: Chapter 10 – Basic Regression Analysis with Time Series Data

gfr = 98.7 + 0.0825 pe - 24.2 ww2 - 31.6 pillww2 is a dummy variable• 1 if year is 1941 through 1945• 0 otherwise

Page 50: Chapter 10 – Basic Regression Analysis with Time Series Data

gfr = 98.7 + 0.0825 pe - 24.2 ww2 - 31.6 pillpill is a dummy variable • 1 if year is 1963 or greater• 0 otherwise

Page 51: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

gfr = 98.7 + 0.0825 pe - 24.2 ww2 - 31.6 pill

Summary:• Adding pe and ww2 improves model significantly• Model gives insight into historical variables that

affect gfr• Model may not be very useful for future predictions

Page 52: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Modeling with lags

Economic theory implies that there might be a lag effect on gfr (general fertility rate) from pe (tax value of having a child)

Page 53: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Modeling with lags

Examine variables pe_1, pe_2, pe_3, and pe_4

Page 54: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Making lags in Minitab is easy. Go to Stat > Time Series > Lag.

Page 55: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 56: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 57: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 58: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 59: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 60: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 61: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 62: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Residual plots:

Page 63: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

gfr = 95.9 + 0.073 pe - 0.006 pe_1 + 0.034 pe_2 - 22.1 ww2 - 31.3 pill

Predictor Coef SE Coef T PConstant 95.870 3.282 29.21 0.000pe 0.0727 0.1255 0.58 0.565pe_1 -0.0058 0.1557 -0.04 0.970pe_2 0.0338 0.1263 0.27 0.790ww2 -22.13 10.73 -2.06 0.043pill -31.305 3.982 -7.86 0.000

S = 14.2701 R-Sq = 49.9% R-Sq(adj) = 45.9%

Page 64: Chapter 10 – Basic Regression Analysis with Time Series Data

Time Series Example – Data Set FERTIL3

Personally, I think adding the two lags to this model over complicates the model for little gain. I recommend against inclusion of the two lags.