Two Variable Relationships: Side-by-Side Boxplots, Scatterplots, and Correlation

Comparative Graphs: Side-by-Side Boxplots

  • Application and Variables:
    • Analysis focuses on 2025 electric vehicles to predict vehicle acceleration time based on vehicle class.
    • Explanatory Variable: Vehicle Class, categorized as Hybrid, Plug-in Hybrid (PHEV), or Battery Only (BEV).
    • Response Variable: Acceleration time to 30 mph30\,\text{mph} (measured in seconds).

Side-by-side boxplots of acceleration time to 30 mph across hybrid, PHEV, and BEV electric vehicle classes

  • Evaluating Association from Boxplots:

    • There is an association between vehicle class and acceleration time because the interquartile range boxes show very little overlap, demonstrating that acceleration times differ substantially across the three classes.
  • Central Tendencies and Extremes Across Classes:

    • Highest Typical Acceleration Time: The Hybrid class tends to have the highest acceleration time, as its median line (≈3.00 seconds\approx 3.00\,\text{seconds}) and box are positioned furthest to the right.
    • Highest Overall Individual Acceleration Time: The Plug-in Hybrid (PHEV) class possesses the single highest overall value due to an extreme high outlier located near 3.8 seconds3.8\,\text{seconds}.
    • Lowest Typical Acceleration Time: The Battery-Only (BEV) class tends to have the lowest acceleration time, with its median (≈2.00 seconds\approx 2.00\,\text{seconds}) and entire box shifted furthest to the left.
  • Outliers and Spread:

    • Presence of Outliers: The Plug-in Hybrid (PHEV) class contains an isolated outlier plotted beyond the upper whisker at approximately 3.8 seconds3.8\,\text{seconds}.
    • Variability and Spread: Comparing overall spread across the classes, the Battery-Only (BEV) class displays the highest spread/variability, while the Hybrid class displays the lowest spread/variability; however, the difference in spread among the three groups is not extreme.

Scatterplots and Bivariate Trends

  • Bivariate Quantitative Relationships:
    • When both the explanatory variable and the response variable are quantitative, bivariate data are plotted on a scatterplot.
    • The explanatory variable is placed on the horizontal axis (XX), and the response variable is placed on the vertical axis (YY).
    • Point Interpretation: In a plot of 2025 gas vehicles comparing Highway MPG (XX) to City MPG (YY), an individual coordinate point such as (35,21)(35, 21) represents a specific vehicle that achieves 35 mpg35\,\text{mpg} on the highway and 21 mpg21\,\text{mpg} in city driving.
    • General Trend: Vehicles that possess higher fuel economy on the highway tend to also possess higher fuel economy on city streets.

Scatterplots showing positive association between highway and city MPG and negative association between vehicle weight and city MPG

  • Directional Trends of Association:
    • Positive Association:
    • Occurs when an increase in the explanatory variable is associated with a tendency for the response variable to increase.
    • Moving from left to right, data points trend upward.
    • Example: The association between Highway MPG and City MPG is positive.
    • Negative Association:
    • Occurs when an increase in the explanatory variable is associated with a tendency for the response variable to decrease.
    • Moving from left to right, data points trend downward.
    • Example: The association between Vehicle Weight (in pounds) and City MPG is negative, meaning heavier vehicles tend to have lower fuel efficiency in city driving.

Describing Bivariate Association

  • Core Components of Association Descriptions:
    • Any comprehensive description of an association between two quantitative variables must specify three distinct features:
    • Direction: Positive or Negative.
    • Shape: Linear or Nonlinear.
    • Strength: Very strong, Strong, Moderate, Weak, or None.
    • Critical Caveat: If there is no association ("none"), it is impossible and invalid to describe a direction or a shape.

Scatterplots illustrating linear versus nonlinear shapes and strong versus weak associations

  • Shape Classifications:

    • Linear: The overall pattern of points follows an approximately straight-line path across the scatterplot (e.g., College Admissions data comparing Median ACT Score to Mean SAT Score).
    • Nonlinear: The points follow a curved or peaked functional form rather than a straight line (e.g., Austin, TX monthly weather data comparing Average High Temperature to Average Precipitation, which increases to a central peak and then falls).
  • Strength Classifications:

    • Strong Association: Points fall very close to the underlying line or curve, showing minimal vertical dispersion around the trend (e.g., Roller Coaster data comparing Drop Height in feet to Speed in mph\text{mph}, where points tightly hug a line).
    • Weak Association: Points are widely dispersed and scattered loosely, exhibiting substantial variability around the trend line (e.g., College Experience data comparing Phone Unlocked minutes per month to a Feel Good rating on a scale from 11 to 55).
  • Comprehensive Example:

    • The relationship between Vehicle Weight (pounds) and City MPG is characterized as a moderately strong negative linear association.

Correlation Principles and Interpretations

  • Mathematical Definition and Properties:
    • Correlation measures the strength and direction of the linear association between two quantitative variables.
    • It is bounded strictly within the closed interval from −1-1 to 11:     −1≤r≤1-1 \le r \le 1
    • Notation Conventions:
    • Sample correlation is denoted by the lowercase Latin letter rr.
    • Population correlation is denoted by the Greek letter ρ\rho (pronounced "rho"), written as a rounded symbol distinct from the serifed Latin letter pp.

Scatterplot examples of various positive and negative correlation values and a nonlinear curve with near-zero correlation

  • Interpreting Correlation Coefficients:

    • Positive Linear Associations (r>0r > 0):
    • Weak to None: r=0.1r = 0.1 (diffuse cloud with very faint upward tilt).
    • Moderate: r=0.5r = 0.5 (discernible upward diagonal drift with noticeable scatter).
    • Strong: r=0.9r = 0.9 (points tightly confined along an upward linear path).
    • Perfect: r=1r = 1 (every single point falls exactly on a straight line with positive slope).
    • Negative Linear Associations (r<0r < 0):
    • Weak to None: r=−0.3r = -0.3 (broad dispersion with slight downward slope).
    • Moderate: r=−0.7r = -0.7 (clear downward alignment with moderate scatter).
    • Strong: r=−0.99r = -0.99 (points tightly clustered along a downward linear trajectory).
    • Perfect: r=−1r = -1 (every single point falls exactly on a straight line with negative slope).
  • Nonlinear Trends and Limitations of Correlation:

    • When examining the relationship between Driving Speed (mph\text{mph}) and Fuel Efficiency (mpg\text{mpg}):
    • Speed is an effective predictor of fuel efficiency because efficiency increases from 10 mph10\,\text{mph} up to approximately 45 mph45\,\text{mph}, and then systematically drops as speed increases to 70 mph70\,\text{mph}.
    • The linear correlation coefficient rr for this inverted U-shaped pattern is near zero (r≈0r \approx 0).
    • Linear correlation does not accurately describe this relationship. A correlation near zero can easily be misinterpreted as a lack of association, when in reality there is a very strong nonlinear association.

Mathematical Formula for Correlation

  • Algebraic Formulation:
    • The sample correlation coefficient is defined as the average product of standardized scores (zz-scores) for xx and yy:     r=1n−1∑i=1n(xi−xˉsx)(yi−yˉsy)r = \frac{1}{n-1} \sum_{i=1}^{n} \left(\frac{x_i - \bar{x}}{s_x}\right)\left(\frac{y_i - \bar{y}}{s_y}\right)
    • This computation is never performed by hand in standard practice; it is generated via statistical software.

Geometric quadrant contributions to the correlation coefficient around the center of means

  • Geometric Decomposition by Quadrants:
    • The Cartesian plane is partitioned into four quadrants centered at the point of the sample means: (xˉ,yˉ)(\bar{x}, \bar{y}).
    • The term xi−xˉsx\frac{x_i - \bar{x}}{s_x} represents standardized horizontal deviation ("run").
    • The term yi−yˉsy\frac{y_i - \bar{y}}{s_y} represents standardized vertical deviation ("rise").
    • Quadrant Contribution to the Total Sum:
    • Upper-Right Quadrant (x>xˉx > \bar{x}, y>yˉy > \bar{y}): Both terms are positive; (+)(+)=+(+)(+) = +, producing a positive contribution to rr.
    • Lower-Left Quadrant (x<xˉx < \bar{x}, y<yˉy < \bar{y}): Both terms are negative; (−)(−)=+(-)(-) = +, producing a positive contribution to rr.
    • Upper-Left Quadrant (x<xˉx < \bar{x}, y>yˉy > \bar{y}): One negative and one positive term; (−)(+)=−(-)(+) = -, producing a negative contribution to rr.
    • Lower-Right Quadrant (x>xˉx > \bar{x}, y<yˉy < \bar{y}): One positive and one negative term; (+)(−)=−(+)(-) = -, producing a negative contribution to rr.

Classification of Statistical Display Types

  • Variable Combinations and Matching Visualizations:
    • One Categorical Variable:
    • Practical Example: Diamond Clarity (Section 2.1).
    • Appropriate Graphic: Bar chart.
    • One Quantitative Variable:
    • Practical Example: Lake Travis Water Levels (Section 2.2).
    • Appropriate Graphics: Histogram, Dotplot.
    • Two Categorical Variables:
    • Practical Example: Titanic Passenger Class and Survival (Section 2.1).
    • Appropriate Graphic: Segmented bar chart.
    • One Quantitative Variable and One Categorical Variable (Group Comparisons):
    • Practical Example: Acceleration Time compared across EV Classes (Hybrid, PHEV, BEV).
    • Appropriate Graphic: Side-by-side boxplots.
    • Two Quantitative Variables ((x,y)(x, y) Ordered Pairs):
    • Practical Example: Vehicle Weight and City MPG.
    • Appropriate Graphic: Scatterplot.

StatKey Analysis: Scatterplots, Outliers, and Group Comparisons

  • Two Quantitative Variables Procedure (Cereal Dataset):

    • Navigation: Under Descriptive Statistics and Graphs, select Two Quantitative Variables, and upload the dataset Cereal.
    • Variable Assignment: Designate Protein (grams) as the explanatory variable (XX) and Fiber (grams) as the response variable (YY).
    • Initial Association: The overall relationship exhibits a moderate positive linear association with a baseline correlation coefficient of:     r=0.505r = 0.505
  • Identification and Impact of Outliers:

    • High-Fiber Outlier:
    • Values: 1.3 grams1.3\,\text{grams} of protein and 6.4 grams6.4\,\text{grams} of fiber.
    • Relative Behavior: Contains substantially much higher fiber content than all other cereals with comparable protein levels.
    • Brand Identity: Crunchy Bran.
    • Low-Fiber Outlier:
    • Values: 7.0 grams7.0\,\text{grams} of protein and 0.8 grams0.8\,\text{grams} of fiber.
    • Relative Behavior: Contains unusually low fiber content despite having the highest protein content in the dataset.
    • Brand Identity: Special K.
    • Effect of Removing Outliers:
    • Using Edit Data to delete both Crunchy Bran and Special K dramatically alters the linear correlation coefficient, increasing it to:       r=0.859r = 0.859
    • Outliers can substantially attenuate (depress) the correlation coefficient; removing them reveals a far stronger underlying linear relationship.
  • One Quantitative and One Categorical Variable Procedure:

    • Research Goal: Investigate cereal sugar content by company to determine whether particular manufacturers systematically add more sugar to their cereals.
    • Navigation: Return to the StatKey main menu and select One Quantitative and One Categorical Variable under Descriptive Statistics.
    • Column Configuration: Use Change Columns to specify Sugar as the quantitative response variable and Company as the categorical grouping variable in that order.
    • Evaluation of Association:
    • There is no association between sugar content and cereal company.
    • Explanation: The distributions of sugar content across the three manufacturing groups appear fairly similar, with extensive overlap in their comparative boxplots and dotplots.