1 / 84

# Chapter 9 - PowerPoint PPT Presentation

Chapter 9. Correlation and Regression. Chapter Outline. 9.1 Correlation 9.2 Linear Regression 9.3 Measures of Regression and Prediction Intervals 9.4 Multiple Regression. Section 9.1. Correlation. Section 9.1 Objectives.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Chapter 9

Correlation and Regression

Larson/Farber 4th ed.

• 9.1 Correlation

• 9.2 Linear Regression

• 9.3 Measures of Regression and Prediction Intervals

• 9.4 Multiple Regression

Larson/Farber 4th ed.

### Section 9.1

Correlation

Larson/Farber 4th ed.

• Introduce linear correlation, independent and dependent variables, and the types of correlation

• Find a correlation coefficient

• Test a population correlation coefficient ρ using a table

• Perform a hypothesis test for a population correlation coefficient ρ

• Distinguish between correlation and causation

Larson/Farber 4th ed.

Correlation

• A relationship between two variables.

• The data can be represented by ordered pairs (x, y)

• x is theindependent(orexplanatory)variable

• y is thedependent(orresponse)variable

Larson/Farber 4th ed.

2

x

2

4

6

–2

– 4

Correlation

A scatter plot can be used to determine whether a linear (straight line) correlation exists between two variables.

Example:

Larson/Farber 4th ed.

y

y

y

x

x

x

x

Types of Correlation

As x increases, y tends to decrease.

As x increases, y tends to increase.

Negative Linear Correlation

Positive Linear Correlation

No Correlation

Nonlinear Correlation

Larson/Farber 4th ed.

A marketing manager conducted a study to determine whether there is a linear relationship between money spent on advertising and company sales. The data are shown in the table. Display the data in a scatter plot and determine whether there appears to be a positive or negative linear correlation or no linear correlation.

Larson/Farber 4th ed.

y

Company sales

(in thousands of dollars)

x

(in thousands of dollars)

Appears to be a positive linear correlation. As the advertising expenses increase, the sales tend to increase.

Larson/Farber 4th ed.

Old Faithful, located in Yellowstone National Park, is the world’s most famous geyser. The duration (in minutes) of several of Old Faithful’s eruptions and the times (in minutes) until the next eruption are shown in the table. Using a TI-83/84, display the data in a scatter plot. Determine the type of correlation.

Larson/Farber 4th ed.

• Enter the x-values into list L1 and the y-values into list L2.

• Use Stat Plot to construct the scatter plot.

STAT > Edit…

STATPLOT

100

50

1

5

From the scatter plot, it appears that the variables have a positive linear correlation.

Larson/Farber 4th ed.

Correlation coefficient

• A measure of the strength and the direction of a linear relationship between two variables.

• The symbol r represents the sample correlation coefficient.

• A formula for r is

• The population correlation coefficient is represented by ρ (rho).

n is the number of data pairs

Larson/Farber 4th ed.

-1

0

Correlation Coefficient

• The range of the correlation coefficient is -1 to 1.

If r = -1 there is a perfect negative correlation

If r is close to 0 there is no linear correlation

If r = 1 there is a perfect positive correlation

Larson/Farber 4th ed.

y

y

y

x

x

x

x

Linear Correlation

r = 0.91

r = 0.88

Strong negative correlation

Strong positive correlation

r = 0.42

r = 0.07

Weak positive correlation

Nonlinear Correlation

Larson/Farber 4th ed.

In Words In Symbols

• Find the sum of the x-values.

• Find the sum of the y-values.

• Multiply each x-value by its corresponding y-value and find the sum.

Larson/Farber 4th ed.

In Words In Symbols

Square each x-value and find the sum.

Square each y-value and find the sum.

Use these five sums to calculate the correlation coefficient.

Larson/Farber 4th ed.

Calculate the correlation coefficient for the advertising expenditures and company sales data. What can you conclude?

Larson/Farber 4th ed.

540

5.76

50,625

294.4

2.56

33,856

440

4

48,400

624

6.76

57,600

252

1.96

32,400

294.4

2.56

33,856

372

4

34,596

473

4.84

46,225

Σx = 15.8

Σy = 1634

Σxy = 3289.8

Σx2 = 32.44

Σy2 = 337,558

Larson/Farber 4th ed.

Σx = 15.8

Σy = 1634

Σxy = 3289.8

Σx2 = 32.44

Σy2 = 337,558

r ≈ 0.913 suggests a strong positive linear correlation. As the amount spent on advertising increases, the company sales also increase.

Larson/Farber 4th ed.

Use a technology tool to calculate the correlation coefficient for the Old Faithful data. What can you conclude?

Larson/Farber 4th ed.

To calculate r, you must first enter the DiagnosticOn command found in the Catalog menu

STAT > Calc

r ≈ 0.979 suggests a strong positive correlation.

Larson/Farber 4th ed.

• Once the sample correlation coefficient r has been calculated, we need to determine whether there is enough evidence to decide that the population correlation coefficient ρ is significant at a specified level of significance.

• Use Table 11 in Appendix B.

• If |r| is greater than the critical value, there is enough evidence to decide that the correlation coefficient ρis significant.

Larson/Farber 4th ed.

• Determine whether ρ is significant for five pairs of data (n = 5) at a level of significance of α = 0.01.

• If |r| > 0.959, the correlation is significant. Otherwise, there is not enough evidence to conclude that the correlation is significant.

level of significance

Number of pairs of data in sample

Larson/Farber 4th ed.

In Words In Symbols

• Determine the number of pairs of data in the sample.

• Specify the level of significance.

• Find the critical value.

Determine n.

Identify .

Use Table 11 in Appendix B.

Larson/Farber 4th ed.

In Words In Symbols

If |r| > critical value, the correlation is significant. Otherwise, there is not enough evidence to support that the correlation is significant.

Decide if the correlation is significant.

Interpret the decision in the context of the original claim.

Larson/Farber 4th ed.

Using the Old Faithful data, you used 25 pairs of data to find r ≈ 0.979. Is the correlation coefficient significant? Use α = 0.05.

Larson/Farber 4th ed.

• n = 25, α = 0.05

• |r| ≈ 0.979 > 0.396

• There is enough evidence at the 5% level of significance to conclude that there is a significant linear correlation between the duration of Old Faithful’s eruptions and the time between eruptions.

Larson/Farber 4th ed.

• A hypothesis test can also be used to determine whether the sample correlation coefficient r provides enough evidence to conclude that the population correlation coefficient ρ is significant at a specified level of significance.

• A hypothesis test can be one-tailed or two-tailed.

Larson/Farber 4th ed.

• Left-tailed test

• Right-tailed test

• Two-tailed test

H0:ρ 0 (no significant negative correlation)Ha: ρ<0 (significant negative correlation)

H0:ρ 0 (no significant positive correlation)Ha: ρ>0 (significant positive correlation)

H0:ρ= 0 (no significant correlation)Ha: ρ0 (significant correlation)

Larson/Farber 4th ed.

The Coefficient t-Test for the Correlation Coefficient

• Can be used to test whether the correlation between two variables is significant.

• The test statistic is r

• The standardized test statistic

follows a t-distribution with d.f. = n – 2.

• In this text, only two-tailed hypothesis tests for ρ are considered.

Larson/Farber 4th ed.

Using the Coefficient t-Test for ρ

In Words In Symbols

• State the null and alternative hypothesis.

• Specify the level of significance.

• Identify the degrees of freedom.

• Determine the critical value(s) and rejection region(s).

State H0 and Ha.

Identify .

d.f. = n – 2.

Use Table 5 in Appendix B.

Larson/Farber 4th ed.

Using the Coefficient t-Test for ρ

In Words In Symbols

• Find the standardized test statistic.

• Make a decision to reject or fail to reject the null hypothesis.

• Interpret the decision in the context of the original claim.

If t is in the rejection region, reject H0. Otherwise fail to reject H0.

Larson/Farber 4th ed.

Example: Coefficient t-Test for a Correlation Coefficient

Previously you calculated r ≈ 0.9129. Test the significance of this correlation coefficient. Use α = 0.05.

Larson/Farber 4th ed.

ρ Coefficient = 0

ρ ≠ 0

0.05

8 – 2 = 6

Solution: t-Test for a Correlation Coefficient

• H0:

• Ha:

• 

• d.f. =

• Rejection Region:

• Test Statistic:

Reject H0

• Decision:

At the 5% level of significance, there is enough evidence to conclude that there is a significant linear correlation between advertising expenses and company sales.

0.025

0.025

t

-2.447

0

2.447

-2.447

2.447

5.478

Larson/Farber 4th ed.

Correlation and Causation Coefficient

• The fact that two variables are strongly correlated does not in itself imply a cause-and-effect relationship between the variables.

• If there is a significant correlation between two variables, you should consider the following possibilities.

• Is there a direct cause-and-effect relationship between the variables?

• Does x cause y?

Larson/Farber 4th ed.

Correlation and Causation Coefficient

• Is there a reverse cause-and-effect relationship between the variables?

• Does y cause x?

• Is it possible that the relationship between the variables can be caused by a third variable or by a combination of several other variables?

• Is it possible that the relationship between two variables may be a coincidence?

Larson/Farber 4th ed.

Section 9.1 Summary Coefficient

• Introduced linear correlation, independent and dependent variables and the types of correlation

• Found a correlation coefficient

• Tested a population correlation coefficient ρusing a table

• Performed a hypothesis test for a population correlation coefficient ρ

• Distinguished between correlation and causation

Larson/Farber 4th ed.

### Section 9.2 Coefficient

Linear Regression

Larson/Farber 4th ed.

Section 9.2 Objectives Coefficient

• Find the equation of a regression line

• Predict y-values using a regression equation

Larson/Farber 4th ed.

Regression lines Coefficient

• After verifying that the linear correlation between two variables is significant, next we determine the equation of the line that best models the data (regression line).

• Can be used to predict the value of y for a given value of x.

y

x

Larson/Farber 4th ed.

Residuals Coefficient

Residual

• The difference between the observed y-value and the predicted y-value for a given x-value on the line.

For a given x-value,

di = (observed y-value) – (predicted y-value)

Observed y-value

y

d6{

d4{

}d5

d3{

}d2

Predicted y-value

}d1

x

Larson/Farber 4th ed.

Regression Line Coefficient

Regression line(line of best fit)

• The line for which the sum of the squares of the residuals is a minimum.

• The equation of a regression line for an independent variable x and a dependent variable y is

ŷ = mx + b

y-intercept

Predicted y-value for a given x-value

Slope

Larson/Farber 4th ed.

The Equation of a Regression Line Coefficient

• ŷ = mx + b where

• is the mean of the y-values in the data

• is the mean of the x-values in the data

• The regression line always passes through the point

Larson/Farber 4th ed.

Find the equation of the regression line for the advertising expenditures and company sales data.

Larson/Farber 4th ed.

Recall from section 9.1:

540

5.76

50,625

294.4

2.56

33,856

440

4

48,400

624

6.76

57,600

252

1.96

32,400

294.4

2.56

33,856

372

4

34,596

473

4.84

46,225

Σx = 15.8

Σy = 1634

Σxy = 3289.8

Σx2 = 32.44

Σy2 = 337,558

Larson/Farber 4th ed.

Σx = 15.8

Σy = 1634

Σxy = 3289.8

Σx2 = 32.44

Σy2 = 337,558

Equation of the regression line

Larson/Farber 4th ed.

• To sketch the regression line, use any two x-values within the range of the data and calculate the corresponding y-values from the regression line.

y

Company sales

(in thousands of dollars)

x

(in thousands of dollars)

Larson/Farber 4th ed.

Use a technology tool to find the equation of the regression line for the Old Faithful data.

Larson/Farber 4th ed.

100

50

1

5

Larson/Farber 4th ed.

The regression equation for the advertising expenses (in thousands of dollars) and company sales (in thousands of dollars) data is ŷ = 50.729x + 104.061. Use this equation to predict the expected company sales for the following advertising expenses. (Recall from section 9.1 that x and y have a significant linear correlation.)

• 1.5 thousand dollars

• 1.8 thousand dollars

• 2.5 thousand dollars

Larson/Farber 4th ed.

ŷ = 50.729x + 104.061

• 1.5 thousand dollars

ŷ =50.729(1.5) + 104.061 ≈ 180.155

When the advertising expenses are \$1500, the company sales are about \$180,155.

1.8 thousand dollars

ŷ =50.729(1.8) + 104.061 ≈ 195.373

When the advertising expenses are \$1800, the company sales are about \$195,373.

Larson/Farber 4th ed.

• 2.5 thousand dollars

ŷ =50.729(2.5) + 104.061 ≈ 230.884

When the advertising expenses are \$2500, the company sales are about \$230,884.

Prediction values are meaningful only for x-values in (or close to) the range of the data. The x-values in the original data set range from 1.4 to 2.6. So, it would

not be appropriate to use the regression line to predict

company sales for advertising expenditures such as 0.5 (\$500) or 5.0 (\$5000).

Larson/Farber 4th ed.

Section 9.2 Summary Coefficient

• Found the equation of a regression line

• Predicted y-values using a regression equation

Larson/Farber 4th ed.

### Section 9.3 Coefficient

Measures of Regression and Prediction Intervals

Larson/Farber 4th ed.

Section 9.3 Objectives Coefficient

• Interpret the three types of variation about a regression line

• Find and interpret the coefficient of determination

• Find and interpret the standard error of the estimate for a regression line

• Construct and interpret a prediction interval for y

Larson/Farber 4th ed.

Variation About a Regression Line Coefficient

• Three types of variation about a regression line

• Total variation

• Explained variation

• Unexplained variation

• To find the total variation, you must first calculate

• The total deviation

• The explained deviation

• Theunexplained deviation

Larson/Farber 4th ed.

Unexplained deviation Coefficient

Total deviation

Explained deviation

(xi, yi)

Total Deviation =

Explained Deviation =

Unexplained Deviation =

y

(xi, yi)

(xi, ŷi)

x

Larson/Farber 4th ed.

Variation About a Regression Line Coefficient

Total variation

• The sum of the squares of the differences between the y-value of each ordered pair and the mean of y.

Explained variation

• The sum of the squares of the differences between each predicted y-value and the mean of y.

Total variation =

Explained variation =

Larson/Farber 4th ed.

Variation About a Regression Line Coefficient

Unexplained variation

• The sum of the squares of the differences between the y-value of each ordered pair and each corresponding predicted y-value.

Unexplained variation =

The sum of the explained and unexplained variation is equal to the total variation.

Total variation = Explained variation + Unexplained variation

Larson/Farber 4th ed.

Coefficient of Determination Coefficient

Coefficient of determination

• The ratio of the explained variation to the total variation.

• Denoted by r2

Larson/Farber 4th ed.

Example: Coefficient of Determination Coefficient

The correlation coefficient for the advertising expenses and company sales data as calculated in Section 9.1 isr ≈ 0.913. Find the coefficient of determination. What does this tell you about the explained variation of the data about the regression line? About the unexplained variation?

Solution:

About 83.4% of the variation in the company sales can be explained by the variation in the advertising expenditures. About 16.9% of the variation is unexplained.

Larson/Farber 4th ed.

The Standard Error of Estimate Coefficient

Standard error of estimate

• The standard deviation of the observed yi -values about the predicted ŷ-value for a given xi -value.

• Denoted by se.

• The closer the observed y-values are to the predicted y-values, the smaller the standard error of estimate will be.

n is the number of ordered pairs in the data set

Larson/Farber 4th ed.

The Standard Error of Estimate Coefficient

In Words In Symbols

• Make a table that includes the column heading shown.

• Use the regression equation to calculate the predicted y-values.

• Calculate the sum of the squares of the differences between each observed y-value and the corresponding predicted y-value.

• Find the standard error of estimate.

Larson/Farber 4th ed.

Example: Standard Error of Estimate Coefficient

The regression equation for the advertising expenses and company sales data as calculated in section 9.2 isŷ = 50.729x + 104.061

Find the standard error of estimate.

Solution:

Use a table to calculate the sum of the squared differences of each observed y-value and the corresponding predicted y-value.

Larson/Farber 4th ed.

Solution: Standard Error of Estimate Coefficient

Σ = 635.3463

unexplained variation

Larson/Farber 4th ed.

Solution: Standard Error of Estimate Coefficient

• n = 8, Σ(yi – ŷi)2 = 635.3463

The standard error of estimate of the company sales for a specific advertising expense is about \$10.29.

Larson/Farber 4th ed.

Prediction Intervals Coefficient

• Two variables have a bivariate normal distribution if for any fixed value of x, the corresponding values of y are normally distributed and for any fixed values of y, the corresponding x-values are normally distributed.

Larson/Farber 4th ed.

Prediction Intervals Coefficient

• A prediction interval can be constructed for the true value of y.

• Given a linear regression equation ŷ = mx + b and x0, a specific value of x, a c-prediction intervalfor y is

ŷ – E < y < ŷ + E where

• The point estimate is ŷ and the margin of error is E. The probability that the prediction interval contains y is c.

Larson/Farber 4th ed.

Constructing a Prediction Interval for Coefficient y for a Specific Value of x

In Words In Symbols

• Identify the number of ordered pairs in the data set n and the degrees of freedom.

• Use the regression equation and the given x-value to find the point estimate ŷ.

• Find the critical value tc that corresponds to the given level of confidence c.

d.f. = n – 2

Use Table 5 in Appendix B.

Larson/Farber 4th ed.

Constructing a Prediction Interval for Coefficient y for a Specific Value of x

In Words In Symbols

• Find the standard error of estimate se.

• Find the margin of error E.

• Find the left and right endpoints and form the prediction interval.

Left endpoint: ŷ – E Right endpoint: ŷ + E

Interval: ŷ – E < y < ŷ + E

Larson/Farber 4th ed.

Example: Constructing a Prediction Interval Coefficient

Construct a 95% prediction interval for the company sales when the advertising expenses are \$2100. What can you conclude?

Recall, n = 8, ŷ = 50.729x + 104.061, se = 10.290

Solution:

Point estimate:

ŷ = 50.729(2.1)+ 104.061 ≈ 210.592

Critical value:

d.f. = n –2 = 8 – 2 = 6 tc = 2.447

Larson/Farber 4th ed.

Solution: Constructing a Prediction Interval Coefficient

Left Endpoint: ŷ – E

Right Endpoint: ŷ + E

210.592 – 26.857

≈ 183.735

210.592 + 26.857

≈ 237.449

183.735 < y < 237.449

You can be 95% confident that when advertising expenses are \$2100, the company sales will be between \$183,735 and \$237,449.

Larson/Farber 4th ed.

Section 9.3 Summary Coefficient

• Interpreted the three types of variation about a regression line

• Found and interpreted the coefficient of determination

• Found and interpreted the standard error of the estimate for a regression line

• Constructed and interpreted a prediction interval for y

Larson/Farber 4th ed.

### Section 9.4 Coefficient

Multiple Regression

Larson/Farber 4th ed.

Section 9.4 Objectives Coefficient

• Use technology to find a multiple regression equation, the standard error of estimate and the coefficient of determination

• Use a multiple regression equation to predict y-values

Larson/Farber 4th ed.

Multiple Regression Equation Coefficient

• In many instances, a better prediction can be found for a dependent (response) variable by using more than one independent (explanatory) variable.

• For example, a more accurate prediction for the company sales discussed in previous sections might be made by considering the number of employees on the sales staff as well as the advertising expenses.

Larson/Farber 4th ed.

Multiple Regression Equation Coefficient

Multiple regression equation

• ŷ = b + m1x1 + m2x2 + m3x3 + … + mkxk

• x1, x2, x3,…, xk are independent variables

• b is the y-intercept

• y is the dependent variable

* Because the mathematics associated with this concept is complicated, technology is generally used to calculate the multiple regression equation.

Larson/Farber 4th ed.

A researcher wants to determine how employee salaries at a certain company are related to the length of employment, previous experience, and education. The researcher selects eight employees from the company and obtains the data shown on the next slide. Use Minitab to find a multiple regression equation that models the data.

Larson/Farber 4th ed.

Larson/Farber 4th ed.

• Enter the y-values in C1 and the x1-, x2-, and x3-values in C2, C3 and C4 respectively.

• Select “Regression > Regression…” from the Stat menu.

• Use the salaries as the response variable and the remaining data as the predictors.

Larson/Farber 4th ed.

The regression equation isŷ = 49,764 + 364x1 + 228x2 + 267x3

Larson/Farber 4th ed.

Predicting Coefficient y-Values

• After finding the equation of the multiple regression line, you can use the equation to predict y-values over the range of the data.

• To predict y-values, substitute the given value for each independent variable into the equation, then calculate ŷ.

Larson/Farber 4th ed.

Example: Predicting Coefficient y-Values

Use the regression equationŷ = 49,764 + 364x1 + 228x2 + 267x3to predict an employee’s salary given 12 years of current employment, 5 years of experience, and 16 years of education.

Solution:

ŷ = 49,764 + 364(12) + 228(5) + 267(16)

= 59,544

The employee’s predicted salary is \$59,544.

Larson/Farber 4th ed.

Section 9.4 Summary Coefficient

• Used technology to find a multiple regression equation, the standard error of estimate and the coefficient of determination

• Used a multiple regression equation to predict y-values

Larson/Farber 4th ed.