# 3.21: Linear Relationships (2 of 4)

Learning Objectives

• Use a correlation coefficient to describe the direction and strength of a linear relationship. Recognize its limitations as a measure of the relationship between two quantitative variables.

## The Correlation Coefficient (r)

The numerical measure that assesses the strength of a linear relationship is called the correlation coefficient and is denoted by r. In this section, we

• define r.
• discuss the calculation of r.
• explain how to interpret the value of r.
• talk about some of the properties of r.
Correlation coefficient (r)
(Definition)

The correlation coefficient (r) is a numeric measure that measures the strength and direction of a linear relationship between two quantitative variables.

Calculation: r is calculated using the following formula: $r=\frac{∑\left(\frac{x-\stackrel{¯}{x}}{{s}_{x}}\right)\left(\frac{y-\stackrel{¯}{y}}{{s}_{y}}\right)}{n-1}$

where n is the sample size; x is a data value for the explanatory variable; $\stackrel{¯}{x}$ is the mean of the x-values; ${s}_{x}$ is the standard deviation of the x-values; similarly, for the terms involving y. To calculate r, the term $\left(\frac{x-\stackrel{¯}{x}}{{s}_{x}}\right)\left(\frac{y-\stackrel{¯}{y}}{{s}_{y}}\right)$ is calculated for each individual. These terms are added together, then the sum is divided by (n–1).

However, the calculation of r is not the focus of this course. We use a statistics package to calculate the correlation coefficient for us, and the emphasis of this course is on the interpretation of r’s value.

## Interpretation

Once we obtain the value of r, its interpretation with respect to the strength of linear relationships is quite simple, as this walkthrough illustrates:

A YouTube element has been excluded from this version of the text. You can view it online here: pb.libretexts.org/cis/?p=154

Use the simulation below to investigate how the value of $r$ relates to the direction and strength of the relationship between the two variables in the scatterplot.

In the simulation, use the slider bar at the top of the simulation to change the value of the correlation coefficient (r) between −1 and 1. Observe the effect on the scatterplot. Click on the “Switch Sign” button to jump between positive and negative relationships of the same strength.