Skip to main content
Engineering LibreTexts

20.5: Two Numeric Variables

  • 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}}\)

    Finally, we have the case where both variables are numeric. The salary and followers columns are this case. Are they associated?


    Scatter Plots

    The correct plot to visualize this is the scatter plot. It has an axis for each numeric variable, and plots one dot (or other marker) for each object of study: its x/y coordinates depend on that object’s value for each variable.

    The Pandas code is as follows:

    Code \(\PageIndex{1}\) (Python):



    which produces Figure 20.5.1. Interestingly, there appear to be a lot of people pegged at zero salary, and also at 10-ish followers. (These observations would have shown up in a univariate analysis as well.) There’s no super obvious connection between the two variables, but if you squint at the plot it (maybe) looks like there’s a slight up-andto-the-right trend, which would indicate that having more followers is modestly associated with earning more money.


    Figure \(\PageIndex{1}\): A scatter plot of followers vs. salary. Each point in the plot represents one person, with the x and y coordinates corresponding to his/her/their number of followers and salary.


    20.5: Two Numeric Variables is shared under a CC BY-SA license and was authored, remixed, and/or curated by Stephen Davies ( .

    • Was this article helpful?