Skip to main content
Statistics LibreTexts

9.1: Scatterplots and Direction of Association

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

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

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \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{\longvect}{\overrightarrow}\)

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

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Recall the terminology from the chapter introduction, that we are working with what are called bivariate data. This specifically refers to taking two different variable measurements for each observation, which can then be compared. For example, we may look at:

    • Vehicle age and gas mileage.
    • Student study time and exam scores.
    • Rent price and square footage.

    To explore the possible relationship between two quantitative variables, the first thing to do is visualize with a scatterplot.


    What is a Scatterplot?

    A scatterplot is a graph that plots paired data points in a coordinate system. Each point represents one individual (or measurement), with one variable on the horizontal axis (x-axis) and one variable on the vertical axis (y-axis).

    clipboard_e3f9cbc53597e4f8bcc88c94726f66d87.pngFor example, suppose we collect data on 10 students' hours of study and exam scores. Each student's study time and score becomes one point on the graph. You can see the horizontal axis is labeled "Study Hours", which means that how far to the right the point lies tells us how much that single student studied. The vertical axis is labeled "Exam Score" and will indicate how well they did on the exam.

    For example, you can see that two different students studied 5 hours, with each student scoring between a 70 and 75 on their exam.

    In previous sections, we talked about methods to find the average study time, or testing a hypothesis on the proportion of students passing. We may still be interested in these facts separately, but here we are only considering the relationship between the two.

    It is clear from this graph that the amount of time studying is linked to the exam scores on the graph! This example is made particularly clear for demonstration, and in general we should be cautious about drawing conclusions about the relationships, especially causal relationships, between variables.


    Explanatory and Response Variables

    When we study the relationship between two variables, we often have a reason to think that one variable helps explain or predicts the other. We give these variables specific names:

    • Explanatory variable (also called the independent variable or predictor): the variable we think influences or explains the other. It goes on the x-axis.
    • Response variable (also called the dependent variable or outcome): the variable we are trying to explain or predict. It goes on the y-axis.

    In our study hours example, hours of study is the explanatory variable, as we believe that how long a student studies helps explain the score they earn, and exam score is the response variable since the exam grade may change in response to changes in study time.

    Important: Labeling one variable as "explanatory" does not mean it causes changes in the response variable. It simply means we are using it to help predict or describe the response. For example, both variables could be a symptom of a hidden cause, but one variable is easier to measure and predict with. This gives a good rational for declaring it the explanatory variable.

    In experimental studies, the explanatory variable is the one that is changed by the researchers which allows for much stronger assumptions to be made about causality, or the actual state of one variable's trend causing an other's.


    Direction of Association

    One of the most important patterns to look for is the direction of association between the two variables. This tells us how values in one variable tend to change as the other variable increases.

    • Positive association: As x increases, y tends to increase (upward slope)
      • See below two cases of positive correlation. In the left one we have a strong indication of a pattern, but in the right one the data is more spread out and there are even some points that seem to dip low as x increases.
    • Negative association: As x increases, y tends to decrease (downward slope)
      • See how this negative correlation is almost a mirror image of the positive correlation.
    • No association: No clear pattern in either direction
      • This last image can be counter intuitive. The data seems to be grouped and follow a trend to the right. But we need to remember what scatter plots show us. As we go to the right, x is increasing but y hardly changes at all. This lack of upward or downward trend in y tells us that x cannot be used to predict y. How closely grouped the data in the y direction simply tells us that y has a small deviation.

    clipboard_eacf96d55b0b30978b6b2c1c75addfb25.png            clipboard_e09afc97086063335ff1e39ae12310d15.pngclipboard_e7e33e12ea8e5ccbea8fcf2ea979d0850.png            clipboard_e0605f6ef908b63f2ed7399c0cd6fe0fd.png


    Next time: Correlation Coefficients

    You may have noticed the "r = " statement in the graphs above. This is a number called the correlation coefficient and gives an indicator about both the strength and direction of correlation. Try to see if you notice the patterns in the graphs above. In the next few sections we will discuss this constant in more detail, including how to calculate it.


    Related Video


    This page titled 9.1: Scatterplots and Direction of Association is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Mathematics Department.

    • Was this article helpful?