Skip to main content
Statistics LibreTexts

3.21: Linear Relationships (2 of 4)

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    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)

    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.


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

    Thumbnail for the embedded element "Interpreting the value of r"

    A YouTube element has been excluded from this version of the text. You can view it online here:

    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.

    Click here to open this simulation in its own window.

    A link to an interactive elements can be found at the bottom of this page.

    Contributors and Attributions

    CC licensed content, Shared previously

    3.21: Linear Relationships (2 of 4) is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?