# 3.2.2: Correlation Coefficient


The correlation coefficient (represented by the letter $$r$$) measures both the direction and strength of a linear relationship or association between two variables. The value $$r$$ will always take on a value between ‐1 and 1. Values close to zero indicate a very weak correlation. Values close to 1 or  ‐1 indicate a very strong correlation. The correlation coefficient should not be used for non‐linear correlation.

It is important to ignore the sign when determining strength of correlation. For example, $$r = ‐0.75$$ would indicate a stronger correlation than $$r = 0.62$$, since ‐0.75 is farther from zero.

We will use technology to calculate the correlation coefficient, but formulas for manually calculating $$r$$ are presented at the end of this section.

Interpreting the correlation coefficient ($$r$$)

$-1 \leq r \leq 1 \nonumber$

$$r = 1$$ means perfect positive correlation

$$r = ‐1$$ means perfect negative correlation

$$r = 0$$ mean no correlation

The farther $$r$$ is from zero, the stronger the correlation

$$r > 0$$ means positive correlation

$$r < 0$$ means negative correlation

## Some Examples

Example: Cucumber yield and rainfall

This scatterplot represents randomly collected data on growing season precipitation and cucumber yield.

$$r= 0.871$$ indicating strong positive correlation.

Example: GPA and missing class

A group of students at Georgia College conducted a survey asking random students various questions about their academic profile.   One part of their study was to see if there is any correlation between various students’ GPA and classes missed.

$$r= ‐0.236$$ indicating weak negative correlation.

Example: Commute times and temperature

A mathematics instructor commutes by car from his home in San Francisco to De Anza College in Cupertino, California. For 100 randomly selected days during the year, the instructor recorded the commuting time and the temperature in Cupertino at time of arrival.

$$r = ‐0.02$$ indicating no correlation.

## Calculating the correlation coefficient

Manually calculating the correlation coefficient is a tedious process, but the needed formulas and one simple example are presented here:

Formulas for calculating the correlation coefficient ($$r$$)

$r=\dfrac{S S X Y}{\sqrt{S S X \cdot S S Y}} \nonumber$

$S S X=\Sigma X^{2}-\dfrac{1}{n}(\Sigma X)^{2} \nonumber$

$S S Y=\Sigma Y^{2}-\dfrac{1}{n}(\Sigma Y)^{2} \nonumber$

$S S X Y=\Sigma X Y-\dfrac{1}{n}(\Sigma X \cdot \Sigma Y) \nonumber$

Example: Sunglasses sales and rainfall

A company selling sunglasses determined the units sold per 1000 people and the annual rainfall in 5 cities.

X = rainfall in inches

Y = sales of sunglasses per 1000 people.

X Y
10 40
15 35
20 25
30 25
40 15

Solution

First, find the following sums:

$\sum X, \sum Y, \sum X^{2}, \sum Y^{2}, \sum X Y \nonumber$

$$X)$$ $$Y$$ $$X^{2}$$ $$Y^{2}$$ $$XY$$
10 40 100 1600 400
15 35 225 1225 525
20 25 400 625 500
30 25 900 625 750
40 15 1600 225 600
$$\mathbf{\Sigma}$$ 115 140 3225 4300 2775

Then, find $$SSX$$, $$SSY$$, $$SSXY$$

$$\begin{array}{ll} S S X=3225-115^{2} / 5 & =580 \\ S S Y=4300-140^{2} / 5 & =380 \\ S S X Y=2775-(115)(140) / 5 & =-445 \end{array}$$

Finally, calculate $$r$$

$$r=\dfrac{S S X Y}{\sqrt{S S X \cdot S S Y}}=\dfrac{-445}{\sqrt{580 \cdot 330}}=-0.9479$$

The correlation coefficient is ‐0.95, indicating a strong, negative correlation between rainfall and sales of sunglasses.

3.2.2: Correlation Coefficient is shared under a CC BY-SA license and was authored, remixed, and/or curated by LibreTexts.