Modified Correlation
Modified Correlation
Regression
Correlation
Correlation
A correlation is a relationship between two variables. The data
can be represented by the ordered pairs (x, y) where x is the
independent (or explanatory) variable, and y is the dependent
(or response) variable.
y
A scatter plot can be used to determine
whether a linear (straight line) correlation
2
exists between two variables.
x
Example: 2 4 6
x 1 2 3 4 5 –2
y –4 –2 –1 0 2
–4
Larson & Farber, Elementary Statistics: Picturing the World, 3e 3
Linear Correlation
y y
As x increases, y As x increases, y
tends to decrease. tends to increase.
x x
Negative Linear Correlation Positive Linear Correlation
y y
x x
No Correlation Nonlinear Correlation
Larson & Farber, Elementary Statistics: Picturing the World, 3e 4
Correlation Coefficient
The correlation coefficient is a measure of the strength and the
direction of a linear relationship between two variables. The
symbol r represents the sample correlation coefficient. The
formula for r is
n xy x y
r .
n x 2 x n y 2 y
2 2
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
Larson & Farber, Elementary Statistics: Picturing the World, 3e 6
Calculating a Correlation Coefficient
Calculating a Correlation Coefficient
In Words In Symbols
1. Find the sum of the x-values. x
2. Find the sum of the y-values. y
3. Multiply each x-value by its corresponding xy
y-value and find the sum.
4. Square each x-value and find the sum.
5. Square each y-value and find the sum. x 2
6. Use these five sums to calculate the y 2
correlation coefficient. n xy x y
r .
n x x n y y
2 2 2 2
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 7
Correlation Coefficient
Example:
Calculate the correlation coefficient r for the following data.
x y xy x2 y2
1 –3 –3 1 9
2 –1 –2 4 1
3 0 0 9 0
4 1 4 16 1
5 2 10 25 4
x 15 y 1 xy 9 x 2 55 y 2 15
Hours, x 0 1 2 3 3 5 5 5 6 7 7 10
Test score, y 96 85 82 74 95 68 76 84 58 65 75 50
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 9
Correlation Coefficient
Example continued:
Hours, x 0 1 2 3 3 5 5 5 6 7 7 10
Test score, y 96 85 82 74 95 68 76 84 58 65 75 50
y
100
80
Test score
60
40
20
x
2 4 6 8 10
Hours watching TV
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 10
Correlation Coefficient
Example continued:
Hours, x 0 1 2 3 3 5 5 5 6 7 7 10
Test score, y 96 85 82 74 95 68 76 84 58 65 75 50
xy 0 85 164 222 285 340 380 420 348 455 525 500
x2 0 1 4 9 9 25 25 25 36 49 49 100
y2 9216 7225 6724 5476 9025 4624 5776 7056 3364 4225 5625 2500
n xy x y 12(3724) 54 908
r 0.831
n x x n y y 12(70836) 908
2 2 2 2 2 2
12(332) 54
n = 0.05 = 0.01
For a sample of size n = 6, ρ
4 0.950 0.990
is significant at the 5%
5 0.878 0.959
significance level, if |r| >
6 0.811 0.917
0.811.
7 0.754 0.875
Age of person, in 12 13 14 16 16 17 17 18
years (x)
Weight, in 40 42 38 35 45 51 48 48
kilograms (y)
Height of
Eldest Son (y) 71 75 69 69 65 60 66 63 68 70 60 58
Example:
The following data represents the number of hours 12 different
students watched television during the weekend and the scores of
each student who took a test the following Monday.
Hours, x 0 1 2 3 3 5 5 5 6 7 7 10
Test score, y 96 85 82 74 95 68 76 84 58 65 75 50
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 20
Testing a Population Correlation Coefficient
Example continued: Appendix B: Table 11
r 0.831 n = 0.05 = 0.01
4 0.950 0.990
n = 12 5 0.878 0.959
= 0.01 6 0.811 0.917
10 0.632 0.765
11 0.602 0.735
12 0.576 0.708 |r| > 0.708
13 0.553 0.684
Because, the population correlation is significant, there is enough evidence
at the 1% level of significance to conclude that there is a significant linear
correlation between the number of hours of television watched during the
weekend and the scores of each student who took a test the following
Monday.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 21
Hypothesis Testing for ρ
Hours, x 0 1 2 3 3 5 5 5 6 7 7 10
Test score, y 96 85 82 74 95 68 76 84 58 65 75 50
Predicted y- d
3
value
x
Each data point di represents the difference between the observed
y-value and the predicted y-value for a given x-value on the line.
These differences are called residuals.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 29
Regression Line
A regression line, also called a line of best fit, is the line for
which the sum of the squares of the residuals is a minimum.
wh er e y is t h e m ea n of t h e y - va lu es a n d x is t h e m ea n of t h e
x - va lu es. Th e r egr ession lin e a lwa ys pa ss es t h r ou gh (x , y ).
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 31
Regression Line
Example continued:
1 15
b y mx (1.2) 3.8
5 5
The equation of the regression line is
ŷ = 1.2x – 3.8. y
2
1
x
1 2 3 4 5
1
1
2 (x , y ) 3,
5
3
y
b y mx 100 (x , y ) 1254 , 908
12
4.5,75.7
908 54
(4.067) 80
Test score
12 12
60
93.97
40
20
ŷ = –4.07x + 93.97
x
2 4 6 8 10
Hours watching TV
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 34
Regression Line
Example continued:
Using the equation ŷ = –4.07x + 93.97, we can predict the test
score for a student who watches 9 hours of TV.
ŷ = –4.07x + 93.97
= –4.07(9) + 93.97
= 57.34
x
x
Larson & Farber, Elementary Statistics: Picturing the World, 3e 37
Variation About a Regression Line
The total variation about a regression line is the sum of the squares of
the differences between the y-value of each ordered pair and the mean of
y.
Tot a l va r ia t ion y i y
2
Example:
The correlation coefficient for the data that represents the number
of hours students watched television and the test scores of each
student is r 0.831. Find the coefficient of determination.
The closer the observed y-values are to the predicted y-values, the
smaller the standard error of estimate will be.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 40
The Standard Error of Estimate
Finding the Standard Error of Estimate
In Words In Symbols
1. Make a table that includes the column x i , y i , yˆ i , ( y i yˆ i ),
heading shown. ( y i yˆ i )2
2. Use the regression equation to yˆ m x i b
calculate the predicted y-values.
3. Calculate the sum of the squares of the ( y i yˆ i )2
differences between each observed y-
value and the corresponding predicted
y-value.
4. Find the standard error of estimate.
( y i yˆ i )2
se
n 2
( y i yˆ i )2 658.25
Unexplained
variation
( y i yˆ i )2 658.25 8.11
se
n 2 12 2
Continued.
Larson & Farber, Elementary Statistics: Picturing the World, 3e 46
Prediction Intervals
Construct a Prediction Interval for y for a Specific Value of x
In Words In Symbols
4. Find the standard error of ( y i yˆ i )2
estimate se. se
n 2
Hours, x 0 1 2 3 3 5 5 5 6 7 7 10
Test score, y 96 85 82 74 95 68 76 84 58 65 75 50