Docsity

Calculating Pearson's Correlation Coefficient and Fitting Lines - Prof. Brett D. Hunter, Study notes of Data Analysis & Statistical Methods

Toggle sidebar
bg1
11 November
Obtain a numeric assessment of the relationship by calculating Pearson’s correlation coefficient, r
r =
∑
i=1
n
(
x1−x
Sx
)
(y1−y
Sy
¿)
n−1¿
=
∑
i=1
n
Z
x
i
Z
y
i
n−1
Sx is the standard deviation of the X variable
Sy is the standard deviation of the Y variable
Properties of r
r does not depend on the units of measurement of either X or Y
r does not depend on which of the variables is labeled X and which is labeled Y
-1 ≤ r ≤ 1
A positive number suggests a positive relationship and a negative number suggest a negative
relationship
Magnitude indicates strength of relationship. The closer |r| is to 1, the stronger the
relationship.
Rules for determining strength of correlation
|r| < .5 → weak linear relationship
.5 ≤ |r| < .8 → moderate linear relationship
.8 ≤ |r| < 1 → stronger linear relationship
A value of r = 0 does not indicate that there is no relationship between X and Y, but that there is
no linear relationship.
A strong relationship between X and Y does not mean that a large value of one variable causes
the value of the other variable to be large.
Correlation does not imply causation!!!
Strongly related variables are often also strongly related to other variables.
pf2

Partial preview of the text

Download Calculating Pearson's Correlation Coefficient and Fitting Lines - Prof. Brett D. Hunter and more Study notes Data Analysis & Statistical Methods in PDF only on Docsity!

11 November Obtain a numeric assessment of the relationship by calculating Pearson’s correlation coefficient, r r =

i = 1 n

x 1 − x

Sx )

y 1 − y

S y

n − 1

i = 1

n Z

xi^ Z^ yi

n − 1

Sx is the standard deviation of the X variable Sy is the standard deviation of the Y variable Properties of r r does not depend on the units of measurement of either X or Y r does not depend on which of the variables is labeled X and which is labeled Y -1 ≤ r ≤ 1 A positive number suggests a positive relationship and a negative number suggest a negative relationship Magnitude indicates strength of relationship. The closer |r| is to 1, the stronger the relationship. Rules for determining strength of correlation |r| < .5 → weak linear relationship .5 ≤ |r| < .8 → moderate linear relationship .8 ≤ |r| < 1 → stronger linear relationship A value of r = 0 does not indicate that there is no relationship between X and Y, but that there is no linear relationship. A strong relationship between X and Y does not mean that a large value of one variable causes the value of the other variable to be large. Correlation does not imply causation!!! Strongly related variables are often also strongly related to other variables.

Fitting Lines A line is defined by two pieces of information A y-intercept A slope The equation of a line is y = b 0 + b 1 x Where b 0 is the y-intercept, b 1 is the slope The y-intercept is the value of y when x = 0 The slope is the amount by which y increases (or decreases) for every 1-unit increase in x We call Y: response variable, dependent variable We call X: explanatory variable, independent variable, predictor In order to assess the fit of the lines, we need to define how far each data point is from the fitted line.

We define the height of the line at Yi as ^ yi = b 0 + bi xi → predicted value of y at xi

Define the distance the observed yi is from the fitted line as ei = yi - ^ yi → called errors or

residuals When we fit a line to the data, we want our errors to be as small as possible. So we want to minimize some average measure of error. Thus, because (^) ∑ ei = 0, we choose a line that minimizes the sum of squared error (sum of squared residuals), defined as SSE = (^) ∑ ( yi − ^ yi ) 2 = (^) ∑ ei 2 In order to minimize SSE, we use the formulas below to find our predicted line (called the least square line). b 1 = ∑ ( xi − x^ ) (^ yi −^ y^ ) ∑ ( xi − x )

2 =^ ¿^ ¿^ = r^

S y

Sx

b 0 = y – b 1 x