



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




As well as finding the correlation of paired data {{ x 1 , y 1 }, { x 2 , y 2 },.. ., { xn , yn }}, we also
can plot the data with a scatterplot and find the Least Squares Line of Best Fit through the data. This line, having equation y = a x + b , provides an approximate linear functional
relationship between the values of xi and yi. Of course, it is only a “good fit” if the
correlation is near ± 1 , which means that there is a strong linear dependence between the measurements X and Y.
The slope a is given by
a =
x y − ( x )( y )
x^2 − ( x )^2
where x y =
n
xi yi i = 1
n
n
xi^2 i = 1
n
After the slope a is calculated, then the intercept b is given by
b = y − a x.
Then Y ≈ a X + b.
This least squares line is the line that minimizes the “sum of squared errors” between the actual yi values and the linear approximations ax (^) i + b. That is, the sum
( axi + b − yi )^2 i = 1
n
To compute both the correlation and the least-squares line, enter paired data into lists L1 and L2 (or some other pair of lists), press STAT , scroll to CALC , press 4 for LinReg(ax+b) , then enter the command LinReg(ax+b) L1, L.
Some Other Quick Facts
r ˜^ X ˜ (^) Y
, where r is
the sample correlation, ˜^ X = x^2 − (^ x )^2 , and ˜^ Y = y^2 − ( y )^2.
observed values accounted for by the regression fit. Because 0 ≤ r^2 ≤ 1 , an r^2 near 1
means that there is a strong fit, and an r^2 near 0 means that there is virtually no fit of the data.
Examples. (i) Make a scatterplot; (ii) Compute r and explain what it means; (iii) Find the equation of the least-squares regression line and graph it through the scatterplot.
Brand Tar (mg) Nicotine (mg) Alpine 14.1 0. Benson & Hedges 16.0 1. Bull Durham 29.8 2. Camel Lights 8.0 0. Carlton 4.1 0. Chesterfield 15.0 1. Golden Lights 8.8 0. Kent 12.4 0. Kool 16.6 1. L&M 14.9 1.
STAT EDIT STAT PLOT Adjust Settings ZOOM 9
We see the general trend: As the tar level increases, then the nicotine level increases.
STAT CALC Enter command r ≈ 0.
Because r is so close to +1, there is a strong positive linear relationship between tar and nicotine.
The least-squares regression line is given by y = a x + b ≈ 0.0610475 x + 0.. Due to the close fit, this linear function could be used to predict a nicotine level y for a given tar level x. For instance, if x = 20 mg of tar, then y ≈ 1.359 mg of nicotine.
Y= From VARS STATISTICS EQ Press ENTER
Press GRAPH From CALC ( 2nd TRACE) value, X = 20
Because r^2 ≈ 0.974, nicotine level is 97.4% determined by tar level when using y = 0.0610475 x + 0.138167 as a predictor, and 2.6% determined by other factors.
Speed (mph) MPG 10 18 20 20 40 22 60 20 70 18
STAT EDIT STAT PLOT Adjust Settings ZOOM 9
There clearly seems to be some sort of relationship (perhaps quadratic). The mpg increases as speed increases to a certain point; but then as speed increases further, the mpg drops off.
STAT CALC r = 0.
There is no correlation!
The correlation measures the strength and direction of the linear association between the variables. Just because the correlation equals 0, it does not mean that there is no relationship. In this case, there simply is not a permanent linear relationship between speed and mpg; but there certainly is a relationship.
Here, the least-squares regression line is constant and is given by y = 19..
Press GRAPH
In this case, the least-squares regression line is not a good fit of the data. However, it is the best linear approximation of the data, which really does no good here because there is no permanent linear relationship between speed and mpg.
Because r^2 = 0, the line does not fit the data at all. Using the line y = 19.6 as a predictor, then the mpg is not at all determined by its speed.
Student Height (inches) GPA
STAT EDIT STAT PLOT Adjust Settings ZOOM 9
There does not appear to be any relationship between height and grade point average. High and low (and middle) GPAs are attained from students of all heights.
STAT CALC r ≈ –0.
The correlation is nearly 0.
When there is no relationship whatsoever between the variables, then we say that they are independent. When variables are independent, then the true correlation will equal 0. So the correlation coefficient from a random sample of measurements should be very close to 0 when the two variables have no association between them.
Here, the least-squares regression line is given by y = −0.007754 x + 3..
Press GRAPH
Because the correlation is nearly 0, there is no linear relationship between height and GPA. (In fact, there is no relationship at all because GPA is independent of height.) So again, the least-squares regression line is not a good fit of the data.
Because r^2 ≈ 0.0035, less than 1% of a person‘s GPA is determined by height when using the line y = −0.007754 x + 3.3663446 as a predictor.