Interactive Graph:
Correlation Coefficient

By Elena Llaudet, co-author of Data Analysis for Social Science (DSS)

The correlation coefficient (or correlation) captures the direction and strength of the linear association between two variables with a number that ranges from -1 to 1.

  • The sign reflects the direction: positive when the variables tend to move together (when the slope of the line of best fit is positive) and negative when the variables tend to move in opposite directions (when the slope of the line of best fit is negative).
  • The absolute value reflects the strength: it ranges from 0 (no linear association) to 1 (perfect linear association), increasing as dots get closer to the line of best fit.

Let's explore how changing the direction and strength of the linear association affects the correlation coefficient:

STEP 1: The graph below shows a scatterplot of two variables with a correlation of 1. The sign is positive because the slope of the line of best fit is positive (it moves upward from left to right), and the absolute value is 1 because all dots lie exactly on the line. (Check the box to show the line of best fit as a dashed red line.) This indicates a perfectly positive linear relationship between X and Y.
STEP 2: Use the first drop-down menu to change the direction of the linear association from positive to negative. The line of best fit changes from sloping upward to sloping downward (from left to right), and the correlation coefficient changes from positive to negative. It is now -1, indicating a perfectly negatively linear relationship.
STEP 3: Now, use the second drop-down menu to change the strength of the linear association. When selecting weaker linear associations (for example, from perfect to strong or from strong to weak to moderate) , the dots spread farther from the line, and the absolute value of the correlation decreases. When there is no linear association, the correlation coefficient will be approximately 0, and the dots will be scattered without any discernible pattern or trend.

Select whether the variables tend to move in the same direction (positive) or in opposite directions (negative) and observe how that changes the slope of the line of best fit and the sign of the correlation coefficient.

Select the strength of the linear association and observe how that changes how tightly the dots cluster around the line of best fit and the absolute value of the correlation coefficient.

Correlation = 1

Notes: In a scatterplot, each dot represents an observation, positioned according to the values of (Xi, Yi). The line of best fit is the line that best summarizes the data cloud. For illustration purposes, here we use weak, moderate, and strong, but note that what is considered a weak correlation in one field may be considered strong in another.