Lecture Slides
Essentials of Statistics
5th Edition
Global Edition
and the Triola Statistics Series
by Mario F. Triola
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-1
Chapter 7
Correlation and Regression
7-1 Review and Preview
7-2 Correlation
7-3 Regression
7-4 Rank Correlation
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-2
Key Concept
In part 1 of this section introduces the linear correlation
coefficient, r, which is a number that measures how well
paired sample data fit a straight-line pattern when
graphed.
Using paired sample data (sometimes called bivariate
data), we find the value of r (usually using technology),
then we use that value to conclude that there is (or is not)
a linear correlation between the two variables.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-3
Key Concept
In this section we consider only linear relationships,
which means that when graphed, the points approximate
a straight-line pattern.
In Part 2, we discuss methods of hypothesis testing for
correlation.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-4
Part 1: Basic Concepts of Correlation
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-5
Definition
A correlation exists between two variables when the
values of one are somehow associated with the values
of the other in some way.
A linear correlation exists between two variables when
there is a correlation and the plotted points of paired
data result in a pattern that can be approximated by a
straight line.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-6
Exploring the Data
We can often see a relationship between two variables by
constructing a scatterplot.
The following slides show scatterplots with different characteristics.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-7
Scatterplots of Paired Data
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-8
Scatterplots of Paired Data
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-9
Requirements for
Linear Correlation
1. The sample of paired (x, y) data is a simple random
sample of quantitative data.
2. Visual examination of the scatterplot must confirm that
the points approximate a straight-line pattern.
3. The outliers must be removed if they are known to be
errors. The effects of any other outliers should be
considered by calculating r with and without the
outliers included.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-10
Notation for the
Linear Correlation Coefficient
n number of pairs of sample data
denotes the addition of the items indicated
x sum of all x-values
x 2
indicates that each x-value should be squared and then those squares added
( x)
2
indicates that each x-value should be added and the total then squared
xy indicates each x-value is multiplied by its corresponding y -value. Then sum those up.
r linear correlation coefficient for sample data
linear correlation coefficient for a population of paired data
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-11
Formula
The linear correlation coefficient r measures the strength
of a linear relationship between the paired values in a
sample. Here are two formulas:
Technology can (and should) compute this
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-12
Interpreting r
Using Table A-6: If the absolute value of the computed
value of r, exceeds the value in Table A-6, conclude that
there is a linear correlation. Otherwise, there is not
sufficient evidence to support the conclusion of a linear
correlation.
Using Software: If the computed P-value is less than or
equal to the significance level, conclude that there is a
linear correlation. Otherwise, there is not sufficient
evidence to support the conclusion of a linear correlation.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-13
Caution
Know that the methods of this section apply to a linear
correlation.
If you conclude that there does not appear to be linear
correlation, know that it is possible that there might be
some other association that is not linear.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-14
Properties of the
Linear Correlation Coefficient r
1. – 1 ≤ r ≤ 1
2. If all values of either variable are converted to a different
scale, the value of r does not change.
3. The value of r is not affected by the choice of x and y.
Interchange all x- and y-values and the value of r will not
change.
4. r measures strength of a linear relationship.
5. r is very sensitive to outliers, which can dramatically
affect the value of r.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-15
Example
The paired shoe / height data from five males are listed
below. Use a computer or a calculator to find the value
of the correlation coefficient r.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-16
Example - Continued
Requirement Check: The data are a simple random
sample of quantitative data, the plotted points appear to
roughly approximate a straight-line pattern, and there
are no outliers.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-17
Example
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-18
Example
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-19
Is There a Linear Correlation?
We found previously for the shoe and height example that
r = 0.591.
We now proceed to interpret its meaning.
Our goal is to decide whether or not there appears to be a
linear correlation between shoe print lengths and heights
of people.
We can base our interpretation on a P-value or a critical
value from Table A-6.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-20
Interpreting the Linear
Correlation Coefficient r
Using computer software:
If the P-value is less than the level of significance,
conclude there is a linear correlation.
Our example with technologies provided a P-value of
0.294.
Because that P-value is not less than the significance
level of 0.05, we conclude there is not sufficient evidence
to support the conclusion that there is a linear correlation
between shoe print length and heights of people.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-21
Interpreting the Linear
Correlation Coefficient r
Using Table A-6:
Table A-6 yields r = 0.878 for five pairs of data and a 0.05
level of significance. Since our correlation was r = 0.591,
we conclude there is not sufficient evidence to support the
claim of a linear correlation.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-22
Interpreting r:
Explained Variation
The value of r2 is the proportion of the variation in y that is
explained by the linear relationship between x and y.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-23
Example
We found previously for the shoe and height example that
r = 0.591.
With r = 0.591, we get r2 = 0.349.
We conclude that about 34.9% of the variation in height
can be explained by the linear relationship between
lengths of shoe prints and heights.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-24
Common Errors
Involving Correlation
1. Causation: It is wrong to conclude that correlation
implies causality.
2. Averages: Averages suppress individual variation and
may inflate the correlation coefficient.
3. Linearity: There may be some relationship between x
and y even when there is no linear correlation.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-25
Caution
Know that correlation does not imply causality.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-26
Part 2: Formal Hypothesis Test
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-27
Formal Hypothesis Test
We wish to determine whether there is a significant linear
correlation between two variables.
Notation:
n = number of pairs of sample data
r = linear correlation coefficient for a sample of paired data
ρ = linear correlation coefficient for a population of paired data
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-28
Hypothesis Test for Correlation
Requirements
1. The sample of paired (x, y) data is a simple random
sample of quantitative data.
2. Visual examination of the scatterplot must confirm that
the points approximate a straight-line pattern.
3. The outliers must be removed if they are known to be
errors. The effects of any other outliers should be
considered by calculating r with and without the
outliers included.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-29
Hypothesis Test for Correlation
Hypotheses
H0 : = 0 (There is no linear correlation.)
H1 : 0 (There is a linear correlation.)
Test Statistic: r
Critical Values: Refer to Table A-6.
P-values: Refer to technology.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-30
Hypothesis Test for Correlation
If | r | > critical value from Table A-6, reject the null
hypothesis and conclude that there is sufficient evidence
to support the claim of a linear correlation.
If | r | ≤ critical value from Table A-6, fail to reject the null
hypothesis and conclude that there is not sufficient
evidence to support the claim of a linear correlation.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-31
Example
We found previously for the shoe and height example that
r = 0.591.
Conduct a formal hypothesis test of the claim that there is
a linear correlation between the two variables.
Use a 0.05 significance level.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-32
Example - Continued
We test the claim:
H0 : = 0 (There is no linear correlation)
H1 : 0 (There is a linear correlation)
With the test statistic r = 0.591 from the earlier example.
The critical values of r = ± 0.878 are found in Table A-6
with n = 5 and α = 0.05.
We fail to reject the null and conclude there is not
sufficient evidence to support the claim of a linear
correlation.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-33
Chapter 7
Correlation and Regression
7-1 Review and Preview
7-2 Correlation
7-3 Regression
7-4 Rank Correlation
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-34
Key Concept
This section describes the nonparametric method of
the rank correlation test, which uses paired data to test
for an association between two variables.
In Chapter 10 we used paired sample data to compute
values for the linear correlation coefficient r, but in this
section we use ranks as a the basis for computing the
rank correlation coefficient rs.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-35
Definition
The rank correlation test (or Spearman’s rank correlation
test) is a non-parametric test that uses ranks of sample
data consisting of matched pairs.
It is used to test for an association between two variables.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-36
Advantages
1. With rank correlation, we can analyze paired data that
are ranks or can be converted to ranks. This method
does not require a normal distribution for any
population.
2. Rank correlation can be used to detect some (not all)
relationships that are not linear.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-37
Objective
Compute the rank correlation coefficient rs and use it to
test for an association between two variables.
Then we can test the following:
H 0 : s = 0 (There is no correlation between the two variables.)
H1 : s 0 (There is a correlation between the two variables.)
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-38
Notation
rs = rank correlation coefficient for sample paired
data (rs is a sample statistic)
ρs = rank correlation coefficient for all the
population data (ρs is a population parameter)
n = number of pairs of sample data
d = difference between ranks for the two values
within an individual pair
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-39
Requirements
The paired data are a simple random sample and the
data are ranks or can be converted to ranks.
Note: Unlike the parametric methods of Section 10-2,
there is no requirement that the sample pairs of data
have a bivariate normal distribution. There is no
requirement of a normal distribution for any population.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-40
Test Statistic
First convert the data to ranks. Then calculate:
nxy − (x)(y )
rs =
n(x ) − (x)
2 2
n(y )(y ) 2 2
No ties: After converting the data in each sample to ranks,
if there are no ties among ranks for either variable, the
exact value of the test statistic can be calculated using this
formula: 6d 2
rs = 1 −
n(n 2 − 1)
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-41
Disadvantage
A not very serious disadvantage of rank correlation is its
efficiency rating of 0.91.
This efficiency rating shows that with all other circumstances
being equal, the nonparametric approach of rank correlation
requires 100 pairs of sample data to achieve the same
results as only 91 pairs of sample observations analyzed
through parametric methods, assuming that the stricter
requirements of the parametric approach are met.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-42
Example
Table 13-7 lists quality rankings and prices of 37-inch LCD
televisions. Find the value of the rank correlation
coefficient and use it to determine whether or not there is a
correlation between quality and price.
Use a 0.05 significance level. Based on the result, does it
appear that you can get better quality by spending more?
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-43
Example - Continued
Requirement Check: We assume we have a simple
random sample.
The hypotheses are:
H 0 : s = 0 (There is no correlation between quality and price.)
H1 : s 0 (There is a correlation between quality and price.)
On the following slide, we convert to ranks.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-44
Example
We have no ties, so the exact value of the test statistic can
be calculated as shown on the next slide:
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-45
Example - Continued
Test Statistic:
6d 6 ( 32 )
2
rs = 1 − = 1−
n(n − 1) 7 ( 7 2 − 1)
2
192
= 1− = 0.429
336
We refer to Table A-9 to find the critical values of ±0.786.
Because the test statistic rs = 0.429 is between the critical
values, we fail to reject the null hypothesis.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-46
Example - Continued
There is not sufficient evidence to support a claim of a
correlation between quality and price.
Based on the given sample data, it appears you don’t
necessarily get better quality by paying more.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-47
Example
Rank correlation methods sometimes allow us to detect
relationships that we cannot detect with the methods of
Chapter 10.
Below is a scatterplot that shows an S-shaped pattern:
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-48
Example - Continued
The methods of Chapter 10 give r = 0.590 and critical values
of ±0.632, suggesting that there is not a linear relationship
between x and y.
If we use the methods of this section, we get rs = 1 and
critical values of ±0.648, suggesting that there is a
correlation between x and y.
With rank correlations, we can sometimes detect
relationships that are not linear.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-49
Chapter 7
Correlation and Regression
10-1 Review and Preview
10-2 Correlation
10-3 Regression
10-4 Rank Correlation
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-50
Key Concept
In Part 1 of this section we find the equation of the straight
line that best fits the paired sample data. That equation
algebraically describes the relationship between two
variables.
The best-fitting straight line is called a regression line and
its equation is called the regression equation.
In Part 2, we discuss marginal change, influential points,
and residual plots as tools for analyzing correlation and
regression results.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-51
Part 1: Basic Concepts of Regression
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-52
Regression
The regression equation expresses a relationship
between x (called the explanatory variable, predictor
variable or independent variable), and ŷ (called the
response variable or dependent variable).
The typical equation of a straight line y = mx + b is
expressed in the form ŷ = b0 + b1x, where b0 is the y-
intercept and b1 is the slope.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-53
Definitions
Regression Equation:
Given a collection of paired sample data, the regression
line (or line of best fit, or least-squares line) is the
straight line that “best” fits the scatterplot of data.
The regression equation ŷ = b0 + b1x algebraically
describes the regression line.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-54
Notation for
Regression Equation
Population Sample
Parameter Statistic
y-Intercept of
β0 b0
regression equation
Slope of regression
β1 b1
equation
Equation of the
y = β0 + β1x ŷ = b0 + b1x
regression line
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-55
Requirements
1. The sample of paired (x, y) data is a random sample
of quantitative data.
2. Visual examination of the scatterplot shows that the
points approximate a straight-line pattern.
3. Any outliers must be removed if they are known to be
errors. Consider the effects of any outliers that are
not known errors.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-56
Formulas for b1 and b0
sy
Slope: b1 = r
sx
y-intercept: b0 = y − b1x
Technology will compute these values.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-57
Example
Let us return to the example from Section 10.2. We
would like to use the explanatory variable, x, shoe print
length, to predict the response variable, y, height.
The data are listed below:
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-58
Example - Continued
Requirement Check:
1. The data are assumed to be a simple random
sample.
2. The scatterplot showed a roughly straight-line
pattern.
3. There are no outliers.
The use of technology is recommended for finding the
equation of a regression line.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-59
Example – Continued
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-60
Example - Continued
All these technologies show that the regression equation
can be expressed as:
yˆ = 125 + 1.73x
Now we use the formulas to determine the regression
equation (technology is recommended).
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-61
Example
Recall from the previous section that r = 0.591269.
Technology can be used to find the values of the sample
means and sample standard deviations used below.
sy 4.87391
b1 = r = 0.591269 = 1.72745
sx 1.66823
b0 = y − b1 x = 177.3 − (1.72745 )( 30.04 ) = 125.40740
(These are the same coefficients found using
technology)
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-62
Example
Graph the regression equation on a scatterplot:
yˆ = 125 + 1.73x
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-63
Using the Regression
Equation for Predictions
1. Use the regression equation for predictions only if the
graph of the regression line on the scatterplot confirms
that the regression line fits the points reasonably well.
2. Use the regression equation for predictions only if the
linear correlation coefficient r indicates that there is a
linear correlation between the two variables (as
described in Section 10-2).
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-64
Using the Regression
Equation for Predictions
3. Use the regression line for predictions only if the data do
not go much beyond the scope of the available sample
data. (Predicting too far beyond the scope of the
available sample data is called extrapolation, and it
could result in bad predictions.)
4. If the regression equation does not appear to be useful
for making predictions, the best predicted value of a
variable is its sample mean.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-65
Strategy for Predicting Values of y
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-66
Using the Regression
Equation for Predictions
If the regression equation is not a good model, the best
predicted value of y is simply y , the mean of the y
values.
Remember, this strategy applies to linear patterns of
points in a scatterplot.
If the scatterplot shows a pattern that is not a straight-line
pattern, other methods apply, as described in Section 10-
6.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-67
Example
Use the 5 pairs of shoe print lengths and heights to
predict the height of a person with a shoe print length of
29 cm.
The regression line does not fit the points well. The
correlation is r = 0.591, which suggests there is not a
linear correlation (the P-value was 0.294).
The best predicted height is simply the mean of the
sample heights:
y = 177.3 cm
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-68
Example
Use the 40 pairs of shoe print lengths from Data Set 2 in
Appendix B to predict the height of a person with a shoe
print length of 29 cm.
Now, the regression line does fit the points well, and the
correlation of r = 0.813 suggests that there is a linear
correlation (the P-value is 0.000).
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-69
Example - Continued
Using technology we obtain the regression equation and
scatterplot:
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-70
Example - Continued
The given shoe length of 29 cm is not beyond the scope
of the available data, so substitute in 29 cm into the
regression model:
yˆ = 80.9 + 3.22 x
= 80.9 + 3.22 ( 29 )
= 174.3 cm
A person with a shoe length of 29 cm is predicted to be
174.3 cm tall.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-71
Part 2: Beyond the Basics of Regression
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-72
Definition
In working with two variables related by a regression
equation, the marginal change in a variable is the amount
that it changes when the other variable changes by
exactly one unit.
The slope b1 in the regression equation represents the
marginal change in y that occurs when x changes by one
unit.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-73
Example
For the 40 pairs of shoe print lengths and heights, the
regression equation was:
yˆ = 80.9 + 3.22 x
The slope of 3.22 tells us that if we increase shoe print
length by 1 cm, the predicted height of a person
increases by 3.22 cm.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-74
Definition
In a scatterplot, an outlier is a point lying far away from
the other data points.
Paired sample data may include one or more influential
points, which are points that strongly affect the graph of
the regression line.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-75
Example
For the 40 pairs of shoe prints and heights, observe what
happens if we include this additional data point:
x = 35 cm and y = 25 cm
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-76
Example - Continued
The additional point is an influential point because the
graph of the regression line because the graph of the
regression line did change considerably.
The additional point is also an outlier because it is far
from the other points.
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-77
Definition
For a pair of sample x and y values, the residual is the
difference between the observed sample value of y and
the y-value that is predicted by using the regression
equation.
That is:
residual = observed y − predicted y = y − yˆ
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-78
Residuals
Copyright © 2015, 2011, 2008 Pearson Education, Inc. Section 10.2-79