You are on page 1of 84

Chapter 9

Correlation and
Regression

© 2012 Pearson Education, Inc.


1 of 84
All rights reserved.
Chapter Outline

• 9.1 Correlation
• 9.2 Linear Regression
• 9.3 Measures of Regression and Prediction Intervals
• 9.4 Multiple Regression

© 2012 Pearson Education, Inc. All rights reserved. 2 of 84


Section 9.1

Correlation

© 2012 Pearson Education, Inc. All rights reserved. 3 of 84


Section 9.1 Objectives

• 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

© 2012 Pearson Education, Inc. All rights reserved. 4 of 84


Correlation

Correlation
• A relationship between two variables.
• The data can be represented by ordered pairs (x, y)
 x is the independent (or explanatory) variable
 y is the dependent (or response) variable

© 2012 Pearson Education, Inc. All rights reserved. 5 of 84


Correlation

A scatter plot can be used to determine whether a


linear (straight line) correlation exists between two
variables. y

Example: 2

x 1 2 3 4 5 x
y –4 –2 –1 0 2 2 4 6

–2

–4

© 2012 Pearson Education, Inc. All rights reserved. 6 of 84


Types of Correlation
y y
As x increases, y
tends to decrease.
As x increases, y
tends to increase.
x x
Negative Linear Correlation Positive Linear Correlation
y y

x x
No Correlation Nonlinear Correlation
© 2012 Pearson Education, Inc. All rights reserved. 7 of 84
Example: Constructing a Scatter Plot
An economist wants to determine CO2 emission
whether there is a linear GDP (millions of
relationship between a country’s (trillions of $), metric tons),
x y
gross domestic product (GDP)
1.6 428.2
and carbon dioxide (CO2) 3.6 828.8
emissions. The data are shown in 4.9 1214.2
the table. Display the data in a 1.1 444.6
scatter plot and determine whether 0.9 264.0
there appears to be a positive or 2.9 415.3
negative linear correlation or no 2.7 571.8
linear correlation. (Source: World 2.3 454.9
Bank and U.S. Energy Information 1.6 358.7
Administration) 1.5 573.5
© 2012 Pearson Education, Inc. All rights reserved. 8 of 84
Solution: Constructing a Scatter Plot

Appears to be a positive linear correlation. As the


gross domestic products increase, the carbon dioxide
emissions tend to increase.
© 2012 Pearson Education, Inc. All rights reserved. 9 of 84
Example: Constructing a Scatter Plot
Using Technology
Old Faithful, located in Duration
x
Time,
y
Duration
x
Time,
y
Yellowstone National Park, is the 1.80 56 3.78 79

world’s most famous geyser. The 1.82


1.90
58
62
3.83
3.88
85
80
duration (in minutes) of several of 1.93 56 4.10 89

Old Faithful’s eruptions and the 1.98 57 4.27 90


2.05 57 4.30 89
times (in minutes) until the next 2.13 60 4.43 89

eruption are shown in the table. 2.30 57 4.47 86


2.37 61 4.53 89
Using a TI-83/84, display the data 2.82 73 4.55 86
in a scatter plot. Determine the 3.13 76 4.60 92

type of correlation. 3.27


3.65
77
77
4.63 91

© 2012 Pearson Education, Inc. All rights reserved. 10 of 84


Solution: Constructing a Scatter Plot
Using Technology
• 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.
© 2012 Pearson Education, Inc. All rights reserved. 11 of 84
Correlation Coefficient
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
n ∑ xy − ( ∑ x) ( ∑ y) n is the number
r=
n ∑ x 2 − ( ∑ x)
2
n ∑ y 2 − ( ∑ y)
2 of data pairs

• The population correlation coefficient is represented


by ρ (rho).
© 2012 Pearson Education, Inc. All rights reserved. 12 of 84
Correlation Coefficient

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

-1 0 1
If r = –1 there is a If r is close to 0 If r = 1 there is a
perfect negative there is no linear perfect positive
correlation correlation correlation

© 2012 Pearson Education, Inc. All rights reserved. 13 of 84


Linear Correlation
y y

r = –0.91 r = 0.88

x x
Strong negative correlation Strong positive correlation
y y

r = 0.42 r = 0.07

x x
Weak positive correlation Nonlinear Correlation
© 2012 Pearson Education, Inc. All rights reserved. 14 of 84
Calculating a Correlation Coefficient
In Words In Symbols
1. Find the sum of the x- ∑x
values.
2. Find the sum of the y- ∑y
values.
3. Multiply each x-value by ∑ xy
its corresponding y-value
and find the sum.

© 2012 Pearson Education, Inc. All rights reserved. 15 of 84


Calculating a Correlation Coefficient
In Words In Symbols
2
4. Square each x-value ∑x
and find the sum.
5. Square each y-value ∑ y2
and find the sum.
6. Use these five sums to n ∑ xy − ( ∑ x) ( ∑ y)
r=
n ∑ x 2 − ( ∑ x) n ∑ y 2 − ( ∑ y)
2 2
calculate the
correlation coefficient.

© 2012 Pearson Education, Inc. All rights reserved. 16 of 84


Example: Finding the Correlation
Coefficient CO2
emission
Calculate the correlation GDP (millions of
coefficient for the gross (trillions of metric
$), x tons), y
domestic products and carbon
1.6 428.2
dioxide emissions data. What 3.6 828.8
can you conclude? 4.9 1214.2
1.1 444.6
0.9 264.0
2.9 415.3
2.7 571.8
2.3 454.9
1.6 358.7
1.5 573.5
© 2012 Pearson Education, Inc. All rights reserved. 17 of 84
Solution: Finding the Correlation
Coefficient
x y xy x2 y2
1.6 428.2 685.12 2.56 183,355.24
3.6 828.8 2983.68 12.96 686,909.44
4.9 1214.2 5949.58 24.01 1,474,281.64
1.1 444.6 489.06 1.21 197,669.16
0.9 264.0 237.6 0.81 69,696
2.9 415.3 1204.37 8.41 172,474.09
2.7 571.8 1543.86 7.29 326,955.24
2.3 454.9 1046.27 5.29 206,934.01
1.6 358.7 573.92 2.56 128,665.69
1.5 573.5 860.25 2.25 328,902.25
Σx = 23.1 Σy = 5554 Σxy = 15,573.71 Σx2 = 67.35 Σy2 = 3,775,842.76
© 2012 Pearson Education, Inc. All rights reserved. 18 of 84
Solution: Finding the Correlation
Coefficient
Σx = 23.1 Σy = 5554 Σxy = 15,573.71 Σx2 = 32.44
n ∑ xy − ( ∑ x) ( ∑ y) Σy2 = 3,775,842.76
r=
n ∑ x − ( ∑ x) n ∑ y − ( ∑ y)
2 2 2 2

10(15,573.71) − ( 23.1) ( 5554)


=
10(67.35) − 23.12 10(3, 775,842.76) −5554 2
27, 439.7
= ≈ 0.882
139.89 6,911,511.6
r ≈ 0.882 suggests a strong positive linear correlation. As
the gross domestic product increases, the carbon dioxide
emissions also increase.
© 2012 Pearson Education, Inc. All rights reserved. 19 of 84
Example: Using Technology to Find a
Correlation Coefficient
Use a technology tool to calculate Duration
x
Time,
y
Duration
x
Time,
y
the correlation coefficient for the 1.8 56 3.78 79

Old Faithful data. What can you 1.82


1.9
58
62
3.83
3.88
85
80
conclude? 1.93 56 4.1 89
1.98 57 4.27 90
2.05 57 4.3 89
2.13 60 4.43 89
2.3 57 4.47 86
2.37 61 4.53 89
2.82 73 4.55 86
3.13 76 4.6 92
3.27 77 4.63 91
3.65 77

© 2012 Pearson Education, Inc. All rights reserved. 20 of 84


Solution: Using Technology to Find a
Correlation Coefficient

To calculate r, you must first enter the


STAT > Calc DiagnosticOn command found in the Catalog menu

r ≈ 0.979 suggests a strong positive correlation.


© 2012 Pearson Education, Inc. All rights reserved. 21 of 84
Using a Table to Test a Population
Correlation Coefficient ρ
• 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.

© 2012 Pearson Education, Inc. All rights reserved. 22 of 84


Using a Table to Test a Population
Correlation Coefficient ρ
• Determine whether ρ is significant for five pairs of
data (n = 5) at a level of significance of α = 0.01.

level of significance
Number of
pairs of data
in sample

• If |r| > 0.959, the correlation is significant. Otherwise,


there is not enough evidence to conclude that the
correlation is significant.

© 2012 Pearson Education, Inc. All rights reserved. 23 of 84


Using a Table to Test a Population
Correlation Coefficient ρ
In Words In Symbols
1. Determine the number Determine n.
of pairs of data in the
sample.
2. Specify the level of Identify α.
significance.
3. Find the critical value. Use Table 11 in
Appendix B.

© 2012 Pearson Education, Inc. All rights reserved. 24 of 84


Using a Table to Test a Population
Correlation Coefficient ρ
In Words In Symbols
4. Decide if the If |r| > critical value, the
correlation is correlation is significant.
significant. Otherwise, there is not
enough evidence to
support that the
correlation is significant.
5. Interpret the decision
in the context of the
original claim.
© 2012 Pearson Education, Inc. All rights reserved. 25 of 84
Example: Using a Table to Test a
Population Correlation Coefficient ρ
Using the Old Faithful data, you Duration
x
Time,
y
Duration
x
Time,
y
used 25 pairs of data to find 1.8 56 3.78 79

r ≈ 0.979. Is the correlation 1.82


1.9
58
62
3.83
3.88
85
80
coefficient significant? Use 1.93 56 4.1 89

α = 0.05. 1.98 57 4.27 90


2.05 57 4.3 89
2.13 60 4.43 89
2.3 57 4.47 86
2.37 61 4.53 89
2.82 73 4.55 86
3.13 76 4.6 92
3.27 77 4.63 91
3.65 77

© 2012 Pearson Education, Inc. All rights reserved. 26 of 84


Solution: Using a Table to Test a
Population Correlation Coefficient ρ
• 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.
© 2012 Pearson Education, Inc. All rights reserved. 27 of 84
Hypothesis Testing for a Population
Correlation Coefficient ρ
• 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.

© 2012 Pearson Education, Inc. All rights reserved. 28 of 84


Hypothesis Testing for a Population
Correlation Coefficient ρ
• Left-tailed test
H0: ρ ≥ 0 (no significant negative correlation)
Ha: ρ < 0 (significant negative correlation)
• Right-tailed test
H0: ρ ≤ 0 (no significant positive correlation)
Ha: ρ > 0 (significant positive correlation)

• Two-tailed test
H0: ρ = 0 (no significant correlation)
Ha: ρ ≠ 0 (significant correlation)

© 2012 Pearson Education, Inc. All rights reserved. 29 of 84


The 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
r r
t= =
σr 1− r2
n−2
follows a t-distribution with d.f. = n – 2.
• In this text, only two-tailed hypothesis tests for ρ are
considered.

© 2012 Pearson Education, Inc. All rights reserved. 30 of 84


Using the t-Test for ρ
In Words In Symbols
1. State the null and alternative State H0 and Ha.
hypothesis.
2. Specify the level of Identify α.
significance.
3. Identify the degrees of d.f. = n – 2
freedom.
4. Determine the critical value(s)
Use Table 5 in
and rejection region(s).
Appendix B.

© 2012 Pearson Education, Inc. All rights reserved. 31 of 84


Using the t-Test for ρ
In Words In Symbols
r
5. Find the standardized test t=
1− r2
statistic. n−2

6. Make a decision to reject or If t is in the rejection


fail to reject the null region, reject H0.
hypothesis. Otherwise fail to reject
H 0.
7. Interpret the decision in the
context of the original claim.
© 2012 Pearson Education, Inc. All rights reserved. 32 of 84
Example: t-Test for a Correlation
Coefficient CO2
emission
Previously you calculated GDP (millions of
r ≈ 0.882. Test the significance (trillions of metric
$), x tons), y
of this correlation coefficient.
1.6 428.2
Use α = 0.05. 3.6 828.8
4.9 1214.2
1.1 444.6
0.9 264.0
2.9 415.3
2.7 571.8
2.3 454.9
1.6 358.7
1.5 573.5
© 2012 Pearson Education, Inc. All rights reserved. 33 of 84
Solution: t-Test for a Correlation
Coefficient
• H0: ρ = 0 • Test Statistic:
• Ha: ρ ≠ 0 0.882
t≈ ≈ 5.294
• α =0.05 1 − (0.882) 2
• d.f. = 10 – 2 = 8 10 − 2
• Rejection Region: • Decision: Reject H0
At the 5% level of significance,
there is enough evidence to
conclude that there is a
significant linear correlation
between gross domestic
products and carbon dioxide
© 2012 Pearson Education, Inc. All rights reserved. emissions. 34 of 84
Correlation and Causation

• 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.
1. Is there a direct cause-and-effect relationship
between the variables?
• Does x cause y?

© 2012 Pearson Education, Inc. All rights reserved. 35 of 84


Correlation and Causation

2. Is there a reverse cause-and-effect relationship


between the variables?
• Does y cause x?
2. Is it possible that the relationship between the
variables can be caused by a third variable or by
a combination of several other variables?
3. Is it possible that the relationship between two
variables may be a coincidence?

© 2012 Pearson Education, Inc. All rights reserved. 36 of 84


Section 9.1 Summary

• 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

© 2012 Pearson Education, Inc. All rights reserved. 37 of 84


Section 9.2

Linear Regression

© 2012 Pearson Education, Inc. All rights reserved. 38 of 84


Section 9.2 Objectives

• Find the equation of a regression line


• Predict y-values using a regression equation

© 2012 Pearson Education, Inc. All rights reserved. 39 of 84


Regression lines
• 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
© 2012 Pearson Education, Inc. All rights reserved. 40 of 84
Residuals
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)
y
Observed
d6{
y-value
d4 { }d
d3{ 5

}d2 Predicted
}d1 y-value
x
© 2012 Pearson Education, Inc. All rights reserved. 41 of 84
Regression Line

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 Slope
y-value for
a given x-
value
© 2012 Pearson Education, Inc. All rights reserved. 42 of 84
The Equation of a Regression Line

• ŷ = mx + b where

n ∑ xy − ( ∑ x) ( ∑ y) ∑y ∑x
m= b = y − mx = −m
n ∑ x 2 − ( ∑ x)
2
n n
• y is the mean of the y-values in the data
• x is the mean of the x-values in the data
• The regression line always passes through the point
( x, y )

© 2012 Pearson Education, Inc. All rights reserved. 43 of 84


Example: Finding the Equation of a
Regression Line

Find the equation of the GDP CO2 emission


(trillions of $), (millions of
regression line for the gross x metric tons), y
domestic products and 1.6 428.2
carbon dioxide emissions 3.6 828.8
data. 4.9 1214.2
1.1 444.6
0.9 264.0
2.9 415.3
2.7 571.8
2.3 454.9
1.6 358.7
1.5 573.5
© 2012 Pearson Education, Inc. All rights reserved. 44 of 84
Solution: Finding the Equation of a
Regression Line
Recall from section 9.1:
x y xy x2 y2
1.6 428.2 685.12 2.56 183,355.24
3.6 828.8 2983.68 12.96 686,909.44
4.9 1214.2 5949.58 24.01 1,474,281.64
1.1 444.6 489.06 1.21 197,669.16
0.9 264.0 237.6 0.81 69,696
2.9 415.3 1204.37 8.41 172,474.09
2.7 571.8 1543.86 7.29 326,955.24
2.3 454.9 1046.27 5.29 206,934.01
1.6 358.7 573.92 2.56 128,665.69
1.5 573.5 860.25 2.25 328,902.25
Σy2 =
Σx = 23.1 Σy = 5554 Σxy = 15,573.71 Σx2 = 67.35 3,775,842.76
© 2012 Pearson Education, Inc. All rights reserved. 45 of 84
Solution: Finding the Equation of a
Regression Line
Σx = 23.1 Σy = 5554 Σxy = 15,573.71 Σx2 = 67.35 Σy2 =
3,775,842.76
n ∑ xy − ( ∑ x) ( ∑ y) 10(15,573.71) − (23.1)(5554)
m= =
n ∑ x − ( ∑ x)
2 2
2 10(67.35) − 23.1
27, 439.7
= ≈196.151977
139.89
5554 23.1
b = y − mx ≈ 10 − (196.151977) 10
= 555.4 − (196.151977)(2.31) ≈102.2889

Equation of the regression line yˆ = 196.152 x + 102.289


© 2012 Pearson Education, Inc. All rights reserved. 46 of 84
Solution: Finding the Equation of a
Regression Line
• 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.

© 2012 Pearson Education, Inc. All rights reserved. 47 of 84


Example: Using Technology to Find a
Regression Equation
Use a technology tool to find the Duration
x
Time,
y
Duration
x
Time,
y
equation of the regression line for 1.8 56 3.78 79

the Old Faithful data. 1.82


1.9
58
62
3.83
3.88
85
80
1.93 56 4.1 89
1.98 57 4.27 90
2.05 57 4.3 89
2.13 60 4.43 89
2.3 57 4.47 86
2.37 61 4.53 89
2.82 73 4.55 86
3.13 76 4.6 92
3.27 77 4.63 91
3.65 77

© 2012 Pearson Education, Inc. All rights reserved. 48 of 84


Solution: Using Technology to Find a
Regression Equation

yˆ = 12.481x + 33.683
100

50
1 5
© 2012 Pearson Education, Inc. All rights reserved. 49 of 84
Example: Predicting y-Values Using
Regression Equations
The regression equation for the gross domestic products
(in trillions of dollars) and carbon dioxide emissions (in
millions of metric tons) data is ŷ = 196.152x + 102.289.
Use this equation to predict the expected carbon dioxide
emissions for the following gross domestic products.
(Recall from section 9.1 that x and y have a significant
linear correlation.)
1. 1.2 trillion dollars
2. 2.0 trillion dollars
3. 2.5 trillion dollars
© 2012 Pearson Education, Inc. All rights reserved. 50 of 84
Solution: Predicting y-Values Using
Regression Equations
ŷ = 196.152x + 102.289
1. 1.2 trillion dollars
ŷ =196.152(1.2) + 102.289 ≈ 337.671
When the gross domestic product is $1.2 trillion, the
CO2 emissions are about 337.671 million metric tons.

2. 2.0 trillion dollars


ŷ =196.152(2.0) + 102.289 = 494.593
When the gross domestic product is $2.0 trillion, the
CO2 emissions are 494.595 million metric tons.

© 2012 Pearson Education, Inc. All rights reserved. 51 of 84


Solution: Predicting y-Values Using
Regression Equations
3. 2.5 trillion dollars
ŷ =196.152(2.5) + 102.289 = 592.669
When the gross domestic product is $2.5 trillion, the
CO2 emissions are 592.669 million metric tons.

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 0.9 to 4.9. So, it would
not be appropriate to use the regression line to predict
carbon dioxide emissions for gross domestic products
such as $0.2 or $14.5 trillion dollars.
© 2012 Pearson Education, Inc. All rights reserved. 52 of 84
Section 9.2 Summary

• Found the equation of a regression line


• Predicted y-values using a regression equation

© 2012 Pearson Education, Inc. All rights reserved. 53 of 84


Section 9.3

Measures of Regression and


Prediction Intervals

© 2012 Pearson Education, Inc. All rights reserved. 54 of 84


Section 9.3 Objectives

• 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

© 2012 Pearson Education, Inc. All rights reserved. 55 of 84


Variation About a Regression Line

• 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
 The unexplained deviation

© 2012 Pearson Education, Inc. All rights reserved. 56 of 84


Variation About a Regression Line

Total Deviation = yi − y
Explained Deviation = yˆi − y
Unexplained Deviation = yi − yˆi
y (xi, yi) Unexplained
Total deviation
deviation yi − yˆi
yi − y Explained
(xi, ŷi)
y deviation
(xi, yi)
yˆi − y
x
x
© 2012 Pearson Education, Inc. All rights reserved. 57 of 84
Variation About a Regression Line

Total variation
• The sum of the squares of the differences between the
y-value of each ordered pair and the mean of y.
Total variation = ∑ ( yi − y )
2

Explained variation
• The sum of the squares of the differences between
each predicted y-value and the mean of y.
Explained variation = ∑ ( yˆi − y )
2

© 2012 Pearson Education, Inc. All rights reserved. 58 of 84


Variation About a Regression Line

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 = ∑ ( yi − yˆi)
2

The sum of the explained and unexplained variation is


equal to the total variation.
Total variation = Explained variation + Unexplained variation
© 2012 Pearson Education, Inc. All rights reserved. 59 of 84
Coefficient of Determination

Coefficient of determination
• The ratio of the explained variation to the total
variation.
• Denoted by r2
2 Explained variation
r =
Total variation

© 2012 Pearson Education, Inc. All rights reserved. 60 of 84


Example: Coefficient of Determination
The correlation coefficient for the gross domestic
products and carbon dioxide emissions data as
calculated in Section 9.1 is r ≈ 0.882. 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: r 2 ≈ (0.882) 2
≈ 0.778
About 77.8% of the variation in the carbon emissions can be
explained by the variation in the gross domestic products.
About 22.2% of the variation is unexplained.
© 2012 Pearson Education, Inc. All rights reserved. 61 of 84
The Standard Error of Estimate

Standard error of estimate


• The standard deviation of the observed yi -values
about the predicted ŷ-value for a given xi -value.
• Denoted by se.
∑( yi − yˆi) 2 n is the number of ordered pairs
se = in the data set
n−2
• The closer the observed y-values are to the predicted
y-values, the smaller the standard error of estimate
will be.
© 2012 Pearson Education, Inc. All rights reserved. 62 of 84
The Standard Error of Estimate
In Words In Symbols
1. Make a table that includes the xi, yi, yˆi, ( yi − yˆi ),
column headings shown. ( yi − yˆi ) 2
2. Use the regression equation to
yˆi = mxi + b
calculate the predicted y-values.
3. Calculate the sum of the squares
of the differences between each ∑( yi − yˆi ) 2
observed y-value and the
corresponding predicted y-value.
4. Find the standard error of ∑( yi − yˆi) 2
se =
n−2
estimate.
© 2012 Pearson Education, Inc. All rights reserved. 63 of 84
Example: Standard Error of Estimate

The regression equation for the gross domestic products


and carbon dioxide emissions data as calculated in
section 9.2 is
ŷ = 196.152x + 102.289
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.

© 2012 Pearson Education, Inc. All rights reserved. 64 of 84


Solution: Standard Error of Estimate
x y ŷi yi – ŷ i (yi – ŷ i)2
1.6 428.2 416.1322 12.0678 145.63179684
3.6 828.8 808.4362 20.3638 414.68435044
4.9 1214.2 1063.4338 150.7662 22,730.44706244
1.1 444.6 318.0562 126.5438 16,013.33331844
0.9 264.0 278.8258 –14.8258 219.80434564
2.9 415.3 671.1298 –255.8298 65,448.88656804
2.7 571.8 631.8994 –60.0994 3611.93788036
2.3 454.9 553.4386 –98.5386 9709.85568996
1.6 358.7 416.1322 –57.4322 3298.45759684
1.5 573.5 396.517 176.983 31,322.982289
Σ = 152,916.020898
65 of 84
© 2012 Pearson Education, Inc. All rights reserved.
unexplained variation
Solution: Standard Error of Estimate

• n = 10, Σ(yi – ŷ i)2 = 152,916.020898

∑( yi − yˆi) 2 152,916.020898
se = = ≈ 138.255
n−2 10 − 2

The standard error of estimate of the carbon dioxide


emissions for a specific gross domestic product is
about 138.255 million metric tons.

© 2012 Pearson Education, Inc. All rights reserved. 66 of 84


Prediction Intervals
• 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.

© 2012 Pearson Education, Inc. All rights reserved. 67 of 84


Prediction Intervals

• 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 interval for y is
ŷ–E<y<ŷ +E where
2
1 n(x0 − x )
E = tcse 1 + +
n n ∑ x 2 − (∑ x) 2
• The point estimate is ŷ and the margin of error is E.
The probability that the prediction interval contains y
is c.
© 2012 Pearson Education, Inc. All rights reserved. 68 of 84
Constructing a Prediction Interval for y
for a Specific Value of x
In Words In Symbols
1. Identify the number of ordered d.f. = n – 2
pairs in the data set n and the
degrees of freedom.
2. Use the regression equation and yˆi = mxi + b
the given x-value to find the
point estimate ŷ.
3. Find the critical value tc that Use Table 5 in
corresponds to the given level of Appendix B.
confidence c.
© 2012 Pearson Education, Inc. All rights reserved. 69 of 84
Constructing a Prediction Interval for y
for a Specific Value of x
In Words In Symbols
4. Find the standard error of ∑( yi − yˆi) 2
se =
estimate se. n−2

2
1 n( x − x )
4. Find the margin of error E. E = tcse 1 + + 0
n n ∑ x 2 − (∑ x) 2

5. Find the left and right Left endpoint: ŷ – E


endpoints and form the Right endpoint: ŷ + E
prediction interval. Interval: ŷ – E < y < ŷ + E
© 2012 Pearson Education, Inc. All rights reserved. 70 of 84
Example: Constructing a Prediction
Interval
Construct a 95% prediction interval for the carbon
dioxide emission when the gross domestic product is
$3.5 trillion. What can you conclude?
Recall, n = 10, ŷ = 196.152x + 102.289, se = 138.255
Σx = 23.1, Σx 2 = 67.35, x = 2.31
Solution:
Point estimate:
ŷ = 196.152(3.5) + 102.289 ≈ 788.821
Critical value:
d.f. = n –2 = 10 – 2 = 8 tc = 2.306
© 2012 Pearson Education, Inc. All rights reserved. 71 of 84
Solution: Constructing a Prediction
Interval
1 n(x0 − x ) 2
E = tcse 1 + +
n n ∑ x 2 − (∑ x)2

1 10(3.5 − 2.31) 2
≈ (2.306)(138.255) 1 + + ≈ 349.424
10 10(67.35) − (23.1) 2

Left Endpoint: ŷ – E Right Endpoint: ŷ + E


788.821 – 349.424 788.821 + 349.424
= 439.397 = 1138.245
439.397 < y < 1138.245
You can be 95% confident that when the gross domestic
product is $3.5 trillion, the carbon dioxide emissions will be
between 439.397 and 1138.245 million metric tons.
© 2012 Pearson Education, Inc. All rights reserved. 72 of 84
Section 9.3 Summary

• 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

© 2012 Pearson Education, Inc. All rights reserved. 73 of 84


Section 9.4

Multiple Regression

© 2012 Pearson Education, Inc. All rights reserved. 74 of 84


Section 9.4 Objectives

• 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

© 2012 Pearson Education, Inc. All rights reserved. 75 of 84


Multiple Regression Equation

• 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
carbon dioxide emissions discussed in previous
sections might be made by considering the number of
cars as well as the gross domestic product.

© 2012 Pearson Education, Inc. All rights reserved. 76 of 84


Multiple Regression Equation

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.

© 2012 Pearson Education, Inc. All rights reserved. 77 of 84


Example: Finding a Multiple Regression
Equation
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.

© 2012 Pearson Education, Inc. All rights reserved. 78 of 84


Example: Finding a Multiple Regression
Equation
Employment Experience Education
Employee Salary, y (yrs), x1 (yrs), x2 (yrs), x3
A 57,310 10 2 16
B 57,380 5 6 16
C 54,135 3 1 12
D 56,985 6 5 14
E 58,715 8 8 16
F 60,620 20 0 12
G 59,200 8 4 18
H 60,320 14 6 17

© 2012 Pearson Education, Inc. All rights reserved. 79 of 84


Solution: Finding a Multiple Regression
Equation
• 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.

© 2012 Pearson Education, Inc. All rights reserved. 80 of 84


Solution: Finding a Multiple Regression
Equation

The regression equation is


ŷ = 49,764 + 364x1 + 228x2 + 267x3
© 2012 Pearson Education, Inc. All rights reserved. 81 of 84
Predicting 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 ŷ.

© 2012 Pearson Education, Inc. All rights reserved. 82 of 84


Example: Predicting y-Values

Use the regression equation


ŷ = 49,764 + 364x1 + 228x2 + 267x3
to 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.

© 2012 Pearson Education, Inc. All rights reserved. 83 of 84


Section 9.4 Summary

• 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

© 2012 Pearson Education, Inc. All rights reserved. 84 of 84

You might also like