1 1 slide slides by spiros velianitis csus relationships between series, crosstabulations, and...

37
1 Slides by Spiros Velianit is CSUS Relationships Relationships Between Series, Between Series, Crosstabulations, Crosstabulations, and and Intervention Intervention Analysis Analysis

Upload: scott-fox

Post on 28-Dec-2015

217 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

1 1 Slide

Slide

Slides by

SpirosVelianiti

sCSUS

Relationships Relationships Between Series,Between Series,Crosstabulations,Crosstabulations,

andandIntervention Intervention

Analysis Analysis

Page 2: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

2 2 Slide

Slide

Relationships between series ObjectiveRelationships between series Objective

In this section we discuss In this section we discuss correlationcorrelation as it pertains as it pertains to cross sectional data, to cross sectional data, autocorrelationautocorrelation for a for a single time series (demonstrated in the single time series (demonstrated in the previous chapter), and previous chapter), and cross correlationcross correlation, which , which deals with correlations of two series.deals with correlations of two series.

Page 3: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

3 3 Slide

Slide

AutocorrelationAutocorrelation As indicated by its name, the As indicated by its name, the autocorrelationautocorrelation function function

will calculate the correlationwill calculate the correlation coefficient for a series and coefficient for a series and itself in previous time periods. Hence, we analyze one itself in previous time periods. Hence, we analyze one series and determine how (linear) information is carried series and determine how (linear) information is carried over from one time period to another.over from one time period to another.

Page 4: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

4 4 Slide

Slide

Methods to Display AutocorrelationMethods to Display Autocorrelation

Time Series PlotTime Series Plot Autocorrelations TableAutocorrelations Table Autocorrelation Function ChartAutocorrelation Function Chart

Page 5: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

5 5 Slide

Slide

Autocorrelation - Time Series PlotAutocorrelation - Time Series Plot

To illustrate the value of the autocorrelation function, To illustrate the value of the autocorrelation function, consider the series consider the series TSDATA.BUBBLY TSDATA.BUBBLY (StatGraphics data (StatGraphics data sample), which represents the monthly champagne sales sample), which represents the monthly champagne sales volume for a firm. The plot of this series shows a strong volume for a firm. The plot of this series shows a strong seasonality component as shown below.seasonality component as shown below.

Page 6: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

6 6 Slide

Slide

Autocorrelation -Autocorrelation TableAutocorrelation -Autocorrelation Table This table shows the estimated autocorrelations between values of bubbly This table shows the estimated autocorrelations between values of bubbly

at various lags. The lag k autocorrelation coefficient measures the at various lags. The lag k autocorrelation coefficient measures the correlation between values of bubbly at time t and time t-k. Also shown are correlation between values of bubbly at time t and time t-k. Also shown are 95.0% probability limits around 0.0. If the probability limits at a particular 95.0% probability limits around 0.0. If the probability limits at a particular lag do not contain the estimated coefficient, there is a statistically lag do not contain the estimated coefficient, there is a statistically significant correlation at that lag at the 95.0% confidence level. significant correlation at that lag at the 95.0% confidence level.

Lag 1, shown below, shows the autocorrelation coefficient is statistically Lag 1, shown below, shows the autocorrelation coefficient is statistically significant at the 95.0% confidence level, implying that the time series may significant at the 95.0% confidence level, implying that the time series may not be completely random (white noise). not be completely random (white noise).

Page 7: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

7 7 Slide

Slide

Autocorrelation -Autocorrelation Function ChartAutocorrelation -Autocorrelation Function Chart This chart shows the estimated autocorrelations between values of This chart shows the estimated autocorrelations between values of

bubbly at various lags. By analyzing the display, the bubbly at various lags. By analyzing the display, the autocorrelation at lags 1, 11, 12, 13, and 24 are all significant (α = autocorrelation at lags 1, 11, 12, 13, and 24 are all significant (α = 0.05). Hence, one can conclude that there is a linear relationship 0.05). Hence, one can conclude that there is a linear relationship between sales in the current time period and itself and 1, 11, 12, between sales in the current time period and itself and 1, 11, 12, 13, and 24 time periods ago. The values at 1, 11, 12, 13, and 24 13, and 24 time periods ago. The values at 1, 11, 12, 13, and 24 are connected with a yearly cycle (every 12 months).are connected with a yearly cycle (every 12 months).

Page 8: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

8 8 Slide

Slide

Autocorrelation - Hands-On ExampleAutocorrelation - Hands-On Example Open the TSDATA.SF data file.Open the TSDATA.SF data file. Create a Time Series Plot and Estimated Autocorrelations (table Create a Time Series Plot and Estimated Autocorrelations (table

and chart) for bubbly data by selecting Describe/Time and chart) for bubbly data by selecting Describe/Time Series/Descriptive Methods from the main menu. Interpret the Series/Descriptive Methods from the main menu. Interpret the results.results.

Page 9: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

9 9 Slide

Slide

Cross CorrelationCross Correlation With the knowledge discussed in the autocorrelation section and the With the knowledge discussed in the autocorrelation section and the

stationarity section, we are now prepared to discuss the cross correlation stationarity section, we are now prepared to discuss the cross correlation function, which as we said before is designed to measure the linear function, which as we said before is designed to measure the linear relationship between two series when they are displaced by k time periods.relationship between two series when they are displaced by k time periods.

To interpret what is being measured in the cross correlation function one To interpret what is being measured in the cross correlation function one needs to combine what we discussed about the correlation function and the needs to combine what we discussed about the correlation function and the autocorrelation function. autocorrelation function.

For instance, let Y represent SALES and X represent ADVERTISING for a firm. For instance, let Y represent SALES and X represent ADVERTISING for a firm. If k = 1, then we are measuring the correlation between SALES in time If k = 1, then we are measuring the correlation between SALES in time period t and ADVERTISING in time period t-1. i.e. we are looking at the period t and ADVERTISING in time period t-1. i.e. we are looking at the correlation between SALES in a time period and ADVERTISING in the correlation between SALES in a time period and ADVERTISING in the previous time period. If k = 2, we would be measuring the correlation in previous time period. If k = 2, we would be measuring the correlation in SALES in time period t and ADVERTISING two time periods prior.SALES in time period t and ADVERTISING two time periods prior.

Note that k can take on positiveNote that k can take on positive ( (leading indicatorleading indicator)) values and values and negative negative ((lagginglagging indicator) values indicator) values..

Page 10: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

10 10 Slide

Slide

Cross Correlation - Hands-On ExampleCross Correlation - Hands-On Example Open the TSDATA.SF data file.Open the TSDATA.SF data file. Create a Simple Linear Regression between units (y) and leadind Create a Simple Linear Regression between units (y) and leadind

(x).(x). Examine the partial results in the Figure below. We will make Examine the partial results in the Figure below. We will make

adjustments to improve this model.adjustments to improve this model.

Page 11: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

11 11 Slide

Slide

Cross Correlation - Hands-On Example Cross Correlation - Hands-On Example (cont.)(cont.)

From the main menu select, Describe/Time Series/Descriptive From the main menu select, Describe/Time Series/Descriptive Methods and select Units. Then type diff(units) as in the Figure Methods and select Units. Then type diff(units) as in the Figure below , to describe not the actual but the delta/difference in the below , to describe not the actual but the delta/difference in the number of units.number of units.

Page 12: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

12 12 Slide

Slide

Cross Correlation - Hands-On Example Cross Correlation - Hands-On Example (cont.)(cont.)

Click on the Graphs button and select the Crosscorrelation Click on the Graphs button and select the Crosscorrelation Function check box. Function check box.

Right click on the empty panel, and select Pane options. Type or Right click on the empty panel, and select Pane options. Type or select diff(leadind).select diff(leadind).

Notice period +3.Notice period +3.

Page 13: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

13 13 Slide

Slide

Cross Correlation - Hands-On Example Cross Correlation - Hands-On Example (cont.)(cont.)

Modify the Simple Regression’s independent variable to be the Modify the Simple Regression’s independent variable to be the leadind of the +3 period) as in the Figure below (lag(leadind, 3)).leadind of the +3 period) as in the Figure below (lag(leadind, 3)).

Compare your results to the initial model.Compare your results to the initial model.

Page 14: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

14 14 Slide

Slide

CrosstabulationsCrosstabulations In this section we will be focusing our attention on a technique In this section we will be focusing our attention on a technique

frequently used in analyzing survey results, crosstabulation. The frequently used in analyzing survey results, crosstabulation. The purpose of cross tabulation is to determine if two variables are purpose of cross tabulation is to determine if two variables are independent or whether there is a relationship between them.independent or whether there is a relationship between them.

The The Crosstabulation Crosstabulation procedure is designed to summarize two procedure is designed to summarize two columns of columns of attributeattribute datadata. . ItIt constructs a two-way table showing the constructs a two-way table showing the frequency of occurrence of all unique pairs of values in the two frequency of occurrence of all unique pairs of values in the two columns. columns.

To illustrate cross tabulation assume that a survey has been conducted To illustrate cross tabulation assume that a survey has been conducted in which the following questions were asked:in which the following questions were asked:

-- -- What is your ageWhat is your age

____ less than 25 years ____ 25-40 _____ more than 40____ less than 25 years ____ 25-40 _____ more than 40

-- What paper do you subscribe to-- What paper do you subscribe to

____ Chronicle ____ BEE ___ Times____ Chronicle ____ BEE ___ Times We will first consider the hypothesis test generally referred to as We will first consider the hypothesis test generally referred to as a test a test

of dependence:of dependence:• H0: AGE and PAPER are independentH0: AGE and PAPER are independent• H1: AGE and PAPER are dependent.H1: AGE and PAPER are dependent.

Page 15: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

15 15 Slide

Slide

Crosstabulations AnalysisCrosstabulations Analysis

To perform this test via Statgraphics, we first pull up the data file To perform this test via Statgraphics, we first pull up the data file CLTRES.SF, then we go to the main menu and select CLTRES.SF, then we go to the main menu and select Describe/Categorical Data/CrosstabulationDescribe/Categorical Data/Crosstabulation

The chi-square option gives us the value of the chi-square The chi-square option gives us the value of the chi-square statistic for the hypothesis (see Figure below).statistic for the hypothesis (see Figure below).

This value is calculated by comparing the actual observed This value is calculated by comparing the actual observed number for each cell (combination of levels for each of the two number for each cell (combination of levels for each of the two variables) and the expected number under the assumption that variables) and the expected number under the assumption that the two variables are independent.the two variables are independent.

Since the p-value for the chi-square test is 0.6218, which Since the p-value for the chi-square test is 0.6218, which exceeds the value of α = 0.05, we conclude that there is not exceeds the value of α = 0.05, we conclude that there is not enough evidence to suggest that AGE and PAPER are dependent. enough evidence to suggest that AGE and PAPER are dependent. Hence it is appropriate to conclude that age is Hence it is appropriate to conclude that age is not a factor in not a factor in determining who subscribes to which paper.determining who subscribes to which paper.

Page 16: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

16 16 Slide

Slide

Crosstabulations -Practice Problem (lab)Crosstabulations -Practice Problem (lab)

Page 17: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

17 17 Slide

Slide

Crosstabulations -Practice Problem (cont.)Crosstabulations -Practice Problem (cont.)

Page 18: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

18 18 Slide

Slide

Crosstabulations -Practice Problem (cont.)Crosstabulations -Practice Problem (cont.)

Open the data file STUDENT.SF.Open the data file STUDENT.SF. From the main menu, select Describe/Categorical Data/Cross tabulations. Then select the From the main menu, select Describe/Categorical Data/Cross tabulations. Then select the

age and gpa variables.age and gpa variables. Examine the results below.Examine the results below.

Page 19: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

19 19 Slide

Slide

Crosstabulations -Practice Problem (cont.)Crosstabulations -Practice Problem (cont.)

Click on the table button and select the Test of Independence check box.Click on the table button and select the Test of Independence check box. The Tests of Independence reveal that Age may have no relationship to The Tests of Independence reveal that Age may have no relationship to

the value of GPA.the value of GPA.

Page 20: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

20 20 Slide

Slide

Intervention AnalysisIntervention Analysis

In this section we will be introducing the topic of In this section we will be introducing the topic of intervention analysis as it applies to regression models. intervention analysis as it applies to regression models. Besides introducing intervention analysis, other Besides introducing intervention analysis, other objectives are to review the three-phase model building objectives are to review the three-phase model building process and other regression concepts previously process and other regression concepts previously discussed.discussed.

The format that will be followed is a brief introduction to The format that will be followed is a brief introduction to a case scenario, followed by an edited discussion that a case scenario, followed by an edited discussion that took place between an instructor and his class, when this took place between an instructor and his class, when this case was presented in class.case was presented in class.

As you work through the analysis, keep in mind that the As you work through the analysis, keep in mind that the sequence of steps taken by one analyst may be different sequence of steps taken by one analyst may be different from another analysis, but they end up with the same from another analysis, but they end up with the same result. What is important is the result. What is important is the thought process that thought process that is undertaken.is undertaken.

Page 21: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

21 21 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (lab)Practice Problem (lab)

You have been provided with the monthly sales (FRED.SALE) and You have been provided with the monthly sales (FRED.SALE) and advertising (FRED.ADVERT) for Fred’s Deli, with the intention that advertising (FRED.ADVERT) for Fred’s Deli, with the intention that you will construct a regression model which explains and you will construct a regression model which explains and forecasts sales. The data set starts with December 1992 (open forecasts sales. The data set starts with December 1992 (open the data file FRED.SF).the data file FRED.SF).

Page 22: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

22 22 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 1)Practice Problem (step 1)

Instructor: What is the first step you need to do in your Instructor: What is the first step you need to do in your analysis?analysis?

Students: Plot the data.Students: Plot the data. InstructorInstructor: Why?: Why? Students: To see if there is any pattern or information Students: To see if there is any pattern or information

that helps specify the model.that helps specify the model. Instructor: What data should be plotted?Instructor: What data should be plotted? Students: Let’s first plot the series of sales.Students: Let’s first plot the series of sales.

Page 23: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

23 23 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 2)Practice Problem (step 2)

Instructor: Here is the plot of the series first for the sales. What Instructor: Here is the plot of the series first for the sales. What do you see?do you see?

Students: The series seems fairly stationary. There is a peak Students: The series seems fairly stationary. There is a peak somewhere in 1997. It is a little higher and might be a pattern.somewhere in 1997. It is a little higher and might be a pattern.

Page 24: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

24 24 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 3)Practice Problem (step 3)

Instructor: What kind of pattern? How do you determine it?Instructor: What kind of pattern? How do you determine it? Students: There may be a seasonality pattern.Students: There may be a seasonality pattern. Instructor: How would you see if there is a seasonality pattern?Instructor: How would you see if there is a seasonality pattern? Students: Try the autocorrelation function and see if there is any Students: Try the autocorrelation function and see if there is any

value that would indicate a seasonal pattern.value that would indicate a seasonal pattern. Instructor: OK. Let’s go ahead and run the autocorrelation function Instructor: OK. Let’s go ahead and run the autocorrelation function

for sales. How many time periods would you like to lag it for?for sales. How many time periods would you like to lag it for? Students: Twenty-four.Students: Twenty-four. Instructor: Why?Instructor: Why? Students: Twenty-four would be two years worth in a monthly Students: Twenty-four would be two years worth in a monthly

value.value.

Page 25: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

25 25 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 4)Practice Problem (step 4)

Instructor: OK, let’s take a look at the autocorrelation function of Instructor: OK, let’s take a look at the autocorrelation function of sales for 24 lags. What do you see?sales for 24 lags. What do you see?

Students: There appears to be a significant value at lag 3, but Students: There appears to be a significant value at lag 3, but besides that there may also be some seasonality at period 12. besides that there may also be some seasonality at period 12. However, it’s hard to pick it up because the values are not However, it’s hard to pick it up because the values are not significant. So, in this case we don’t see a lot of information significant. So, in this case we don’t see a lot of information about sales as a function of itself.about sales as a function of itself.

Page 26: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

26 26 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 5)Practice Problem (step 5)

Instructor: What do you do now?Instructor: What do you do now? Students: See if advertising fits sales.Students: See if advertising fits sales. Instructor: What is the model that you will estimate or specify?Instructor: What is the model that you will estimate or specify? Students: SalesStudents: Salestt = = ββ00 + β + β11 Advert Adverttt + + εε Instructor: What is the time relationship between sales and Instructor: What is the time relationship between sales and

advertising?advertising? Students: They are the same time period.Students: They are the same time period. Instructor: OK, so what you are hypothesizing or specifying is Instructor: OK, so what you are hypothesizing or specifying is

that sales in the current time period is a function of advertising that sales in the current time period is a function of advertising in the current time period, plus the error term, correct?in the current time period, plus the error term, correct?

Students: Yes.Students: Yes.

Page 27: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

27 27 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 6)Practice Problem (step 6)

Let’s go ahead and estimate the model. To do so, you select model, regression, Let’s go ahead and estimate the model. To do so, you select model, regression, and let’s select a simple regression for right now.and let’s select a simple regression for right now.

Instructor: What do you see from the result? What are the diagnostic checks you Instructor: What do you see from the result? What are the diagnostic checks you would come up with?would come up with?

Students: Advertising is not significant.Students: Advertising is not significant. Instructor: Why?Instructor: Why? Students: The p-value is 0.6335; hence, advertising is a non-significant variable Students: The p-value is 0.6335; hence, advertising is a non-significant variable

and should be thrown out. Also, the R-squared is 24%, which indicates and should be thrown out. Also, the R-squared is 24%, which indicates advertising is not explaining sales.advertising is not explaining sales.

Page 28: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

28 28 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 7)Practice Problem (step 7)

Instructor: OK, what do we do now? You don’t have any Instructor: OK, what do we do now? You don’t have any information as its past for the most part, and you don’t have any information as its past for the most part, and you don’t have any information as advertising as current time period, what do you information as advertising as current time period, what do you do?do?

Students: To see if the past values of advertising affects sales.Students: To see if the past values of advertising affects sales. Instructor: How would you do this?Instructor: How would you do this? Students: Look at the cross-correlation function.Students: Look at the cross-correlation function. Instructor: OK. Let’s look at the cross-correlation between the Instructor: OK. Let’s look at the cross-correlation between the

sales and advertising. Let’s put in advertising as the input, sales sales and advertising. Let’s put in advertising as the input, sales as the output, and run it for 12 lags - one year on either side. as the output, and run it for 12 lags - one year on either side. Here is the result of doing the cross-correlation.Here is the result of doing the cross-correlation.

Page 29: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

29 29 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 2)Practice Problem (step 2)

Students: There is a large “spike” at lag 2 on the positive side. Students: There is a large “spike” at lag 2 on the positive side. What it means is that there is a strong correlation (relationship) What it means is that there is a strong correlation (relationship) between advertising two time periods ago and sales in the between advertising two time periods ago and sales in the current time period.current time period.

Instructor: OK, then, what do you do now?Instructor: OK, then, what do you do now? Students: Run a regression model where sales is the dependent Students: Run a regression model where sales is the dependent

variable and advertising lagged two (2) time periods will be the variable and advertising lagged two (2) time periods will be the explanatory variable.explanatory variable.

Instructor: OK, this is the model now we are going to specify: Instructor: OK, this is the model now we are going to specify: SalesSalestt = = ββ00 + β + β11 AdvertAdvertt-2t-2 + + ε1ε1

Page 30: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

30 30 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 8)Practice Problem (step 8)

Instructor: Looking at the estimation results, we are now ready to Instructor: Looking at the estimation results, we are now ready to go ahead and do the diagnostic checking. How would you go ahead and do the diagnostic checking. How would you analyze the results at this point from the estimation phase?analyze the results at this point from the estimation phase?

Students: We are getting 2 lag of advertising as being significant, Students: We are getting 2 lag of advertising as being significant, since the p-value is 0.0000. So, it is extremely significant and the since the p-value is 0.0000. So, it is extremely significant and the R-squared is now 0.3776.R-squared is now 0.3776.

Instructor: Are you satisfied at this point?Instructor: Are you satisfied at this point? Students: No.Students: No. Instructor: What would you do next?Instructor: What would you do next? Students: Take a look at some diagnostics that are available.Students: Take a look at some diagnostics that are available. Instructor: Such as what?Instructor: Such as what? Students: We can plot the residuals, look at the influence Students: We can plot the residuals, look at the influence

measures, and a couple other things.measures, and a couple other things.

Page 31: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

31 31 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 9)Practice Problem (step 9)

Instructor: OK. Let’s go ahead and first of all plot the residuals. Instructor: OK. Let’s go ahead and first of all plot the residuals. What do residuals represent? Remember that the residuals What do residuals represent? Remember that the residuals represent the difference between the actual values and the fitted represent the difference between the actual values and the fitted values. Here is the plot of the residuals against time (the index):values. Here is the plot of the residuals against time (the index):

Instructor: What do you see?Instructor: What do you see? Students: There is a clear pattern of points above the line, which Students: There is a clear pattern of points above the line, which

indicates some kind of information there.indicates some kind of information there. Instructor: What kind of information?Instructor: What kind of information? Students: It depends on what those values are.Students: It depends on what those values are.

Page 32: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

32 32 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 10)Practice Problem (step 10)

Instructor: As you see what is going on there, you have a pattern Instructor: As you see what is going on there, you have a pattern of every 12 months. Recall that we started it off in December. of every 12 months. Recall that we started it off in December. Hence each of the clicked points is in December. Likewise, if you Hence each of the clicked points is in December. Likewise, if you see the cluster in the middle, you will notice that those points see the cluster in the middle, you will notice that those points correspond to observations 56, 57, 58, 59, 60, and the 61. correspond to observations 56, 57, 58, 59, 60, and the 61. Obviously, something is going on at observation 56 through 61.Obviously, something is going on at observation 56 through 61.

Instructor: So, if you summarize the residuals, you have some Instructor: So, if you summarize the residuals, you have some seasonality going on at the month 13, 25,.... i.e. every December seasonality going on at the month 13, 25,.... i.e. every December has a value, plus something extra happen starting with 56th has a value, plus something extra happen starting with 56th value and continues on through the 61st value. We could also value and continues on through the 61st value. We could also obtain very similar information by taking a look at the "Unusual obtain very similar information by taking a look at the "Unusual Residuals" and "Influential Points“.Residuals" and "Influential Points“.

Page 33: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

33 33 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 11)Practice Problem (step 11)

Instructor: To summarize from our residuals and influential values, one Instructor: To summarize from our residuals and influential values, one can see that what we have left out of the model at this time are really can see that what we have left out of the model at this time are really two factors. One, the seasonality factor for each December, and two, an two factors. One, the seasonality factor for each December, and two, an intervention that occurred in the middle part of 1997 starting with July intervention that occurred in the middle part of 1997 starting with July and lasting through the end of 1997. This may be a case where a and lasting through the end of 1997. This may be a case where a particular salesperson came on board and some other kind of particular salesperson came on board and some other kind of policy/event may have caused sales to increase substantially over the policy/event may have caused sales to increase substantially over the previous case. So, what do you do at this point? We need to go back to previous case. So, what do you do at this point? We need to go back to incorporate the seasonality and the intervention.incorporate the seasonality and the intervention.

Students: The seasonality can be accounted for by creating a new Students: The seasonality can be accounted for by creating a new variable and assigning “1”for each December and “0” elsewhere.variable and assigning “1”for each December and “0” elsewhere.

Instructor: OK, what about the intervention variable?Instructor: OK, what about the intervention variable? Students: Create another variable by assigning a “1” to the months 56, Students: Create another variable by assigning a “1” to the months 56,

57, 58, 59, 60, and 61. Or we figure out the values for July through 57, 58, 59, 60, and 61. Or we figure out the values for July through December in 1997. i.e. “1” for the values from July 97 to December 1997 December in 1997. i.e. “1” for the values from July 97 to December 1997 inclusive, and zero elsewhere.inclusive, and zero elsewhere.

Instructor: Very good. So, what we are going to do is to run a regression Instructor: Very good. So, what we are going to do is to run a regression with these two additional variables. Those variables are already included with these two additional variables. Those variables are already included in the file. in the file.

Page 34: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

34 34 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 12)Practice Problem (step 12)

Instructor: What does this model say in words at this point?Instructor: What does this model say in words at this point? Students: Sales in the current time period is a function of advertising Students: Sales in the current time period is a function of advertising

two time periods ago, a dummy variable for December and two time periods ago, a dummy variable for December and intervention variable for the event occurred in 1997.intervention variable for the event occurred in 1997.

Instructor: Given these estimation results, how would you analyze Instructor: Given these estimation results, how would you analyze (i.e. diagnostically check) the revised model?(i.e. diagnostically check) the revised model?

Students: All the variables are significant since the p-values are all Students: All the variables are significant since the p-values are all 0.0000 (truncation). In addition, R-squared value has gone up 0.0000 (truncation). In addition, R-squared value has gone up tremendously to 0.969 (roughly 97 percent). In other words, R2 has tremendously to 0.969 (roughly 97 percent). In other words, R2 has jumped from 37 percent to approximately 97 percent, and the jumped from 37 percent to approximately 97 percent, and the standard error has gone down substantially from 17000 to about standard error has gone down substantially from 17000 to about 3800. As a result, the model looks much better at this time.3800. As a result, the model looks much better at this time.

Page 35: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

35 35 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 13)Practice Problem (step 13)

Instructor: Given these estimation results, how would you Instructor: Given these estimation results, how would you analyze (i.e. diagnostically check) the revised model?analyze (i.e. diagnostically check) the revised model?

Students: All the variables are significant since the p-values are Students: All the variables are significant since the p-values are all 0.0000 (truncation).In addition, R-squared value has gone up all 0.0000 (truncation).In addition, R-squared value has gone up tremendously to 0.969 (roughly 97 percent). In other words, R2 tremendously to 0.969 (roughly 97 percent). In other words, R2 has jumped from 37 percent to approximately 97 percent, and has jumped from 37 percent to approximately 97 percent, and the standard error has gone down substantially from 17000 to the standard error has gone down substantially from 17000 to about 3800. As a result, the model looks much better at this about 3800. As a result, the model looks much better at this time.time.

Instructor: Is there anything else you would do?Instructor: Is there anything else you would do? Students: Yes, we will go back to diagnostic check again to see if Students: Yes, we will go back to diagnostic check again to see if

this revised model still has any information that has not been this revised model still has any information that has not been included, and hence can be improved. included, and hence can be improved.

Instructor: What is some diagnostic checking you would try?Instructor: What is some diagnostic checking you would try? Students: Look at the residuals again, and plot it against time.Students: Look at the residuals again, and plot it against time.

Page 36: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

36 36 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 14)Practice Problem (step 14)

Instructor: OK, here is the plot of the residual against time. Do you see any Instructor: OK, here is the plot of the residual against time. Do you see any information?information?

Students: No, the pattern looks pretty much random. We cannot determine any Students: No, the pattern looks pretty much random. We cannot determine any information left out in the model with the series of the structure.information left out in the model with the series of the structure.

Instructor: OK, anything else you would look at?Instructor: OK, anything else you would look at? Students: Yes, let us look at the influence measures.Students: Yes, let us look at the influence measures. Instructor: OK, when you look at the "Unusual Residuals" and "Influential Points” Instructor: OK, when you look at the "Unusual Residuals" and "Influential Points”

options, what do you notice about these points.options, what do you notice about these points. Students: They have already been accounted for with the December and Students: They have already been accounted for with the December and

Intervention variables.Intervention variables.

Page 37: 1 1 Slide Slides by Spiros Velianitis CSUS Relationships Between Series, Crosstabulations, and Intervention Analysis

37 37 Slide

Slide

Intervention Analysis Scenario – Hands-on Intervention Analysis Scenario – Hands-on Practice Problem (step 15)Practice Problem (step 15)

Instructor: Would you do anything differently to the model at this Instructor: Would you do anything differently to the model at this point?point?

Students: We don’t think so.Students: We don’t think so. Instructor: Unless you are able to identify those points with Instructor: Unless you are able to identify those points with

particular events occurred, we do not just keep adding dummy particular events occurred, we do not just keep adding dummy variables in to get rid of the values that have been flagged as variables in to get rid of the values that have been flagged as possible outliers. As a result, let us assume that we have pretty possible outliers. As a result, let us assume that we have pretty much cleaned things up, and at this point, you can be satisfied much cleaned things up, and at this point, you can be satisfied with the model that you have obtained.with the model that you have obtained.