HLSL 03 Bivariate Statistics & Modeling

Table of contents

  1. Variables and association
  2. Linear correlation
  3. Line of best fit
  4. Least square regression line
  5. Regression line (x vs y)
  6. Non-linear models

1. Variables and association

1.1 Variables association

Bivariate statistics focus on how two different variables relate to one another. When we look at two sets of data together, we are looking for an association between them.

  • Bivariate data: this refers to data that involves two different variables for each observation.
  • Scatter plot: it is a visual tool used to show the relationship between two variables by plotting points on a graph.
  • Trend line: it is a line drawn through a scatter plot to show the general direction of the data.
  • Outliers: these are data points that sit far away from the main group or the general trend of the rest of the data.

A scatter plot showing the relationship between age and distance thrown, with a trend line and identified outliers.

The relationship between variables can be described by how the points are spread out on a scatter plot. We look for patterns in how one variable changes as the other variable changes.

📝 If we plot the number of hours worked against the number of customers served, we can see if more work hours lead to more customers.

1.2 Linear correlation

Linear correlation describes a specific type of relationship where the data points follow a straight-line pattern. This means that as one variable increases, the other variable changes at a constant rate.

  • Positive correlation: it occurs when both variables increase or decrease together.
  • Negative correlation: it occurs when one variable increases while the other variable decreases.
  • No correlation: it happens when there is no clear pattern or relationship between the two variables.
Correlation TypeDirection of Change
PositiveBoth variables move in the same direction
NegativeVariables move in opposite directions
No correlationNo predictable pattern exists

A scatter plot showing the relationship between age and distance thrown, with a line of best fit drawn through the mean point.

A line of best fit is a straight line drawn through the center of the data points on a scatter plot. This line helps us model the relationship and make predictions about the data.

📝 A line of best fit can help us estimate the distance a person might throw a discus based on their age.

2. Linear correlation

2.1 Pearson's coefficient

Pearson's coefficient, often called rr, is a number that measures the strength and direction of a linear relationship. It tells us how closely the data points cluster around a straight line.

  • Correlation coefficient (rr): it is a value that ranges from −1-1 to 11.
  • Strength of correlation: it is determined by how close the value of rr is to either 11 or −1-1.
  • Coefficient of determination (r2r^2): it is the square of the correlation coefficient and shows how well the line fits the data.
Value of rrStrength and Direction
r=1r = 1Perfect positive correlation
r=−1r = -1Perfect negative correlation
r=0r = 0No linear correlation
Close to 11 or −1-1Strong correlation
Close to 00Weak correlation

A calculator screen displaying the results of a linear regression analysis, including the equation of the line, correlation coefficient (r), and coefficient of determination (r²).

The linear regression equation is written as y=ax+by = ax + b. This equation allows us to calculate predicted values for yy if we know the value of xx.

📝 Using the equation y=ax+by = ax + b, we can plug in a specific value for xx to find the predicted value of yy on the line.

2.2 Interpolation and extrapolation

Once we have a line of best fit, we can use it to predict values for variables that were not in our original data set. The reliability of these predictions depends on where the xx value is located.

  • Interpolation: it is the process of predicting a value within the range of the original data points.
  • Extrapolation: it is the process of predicting a value outside the range of the original data points.
MethodLocation of xx valueReliability
InterpolationInside the data rangeGenerally reliable
ExtrapolationOutside the data rangeLess reliable/Risky

A scatter plot illustrating interpolation and extrapolation with a line of best fit.

Extrapolation is considered risky because we cannot be certain that the linear pattern continues indefinitely outside the observed data.

📝 If we have data for ages 10 to 20, predicting the throw distance for a 15-year-old is interpolation, but predicting for a 50-year-old is extrapolation.

This scatter plot shows the relationship between the age of discus throwers and the distance they can throw the discus.

3. Line of best fit

3.1 Representing data patterns

A line of best fit is a straight line drawn through a scatter plot to represent the general trend of the data. It helps us see how one variable might change in relation to another.

  • Purpose of the line: it shows the overall direction and pattern of the data points.
  • The mean point: this is the central point of the data, often represented by the average of all xx and yy values.
  • Scatter plot: it displays individual data points to show the relationship between two variables.

A scatter plot showing the relationship between student weight and pulse rate, with a line of best fit and the mean point indicated.

The line should pass through or near the mean point to ensure it stays central to the data. When we look at a scatter plot, we are looking for a pattern that the line can capture.

📝 If you have a scatter plot of student weight versus pulse rate, the line of best fit would follow the general path of the dots and pass through the mean point.

3.2 Correlation and residuals

The relationship between variables can be described by how closely the points follow the line and the direction of that line. We use specific terms to describe these patterns and the errors made by the line.

  • Correlation: it describes the strength and direction of the relationship between two variables.
  • Residuals: these are the vertical distances between the actual data points and the regression line.
  • Positive correlation: it occurs when both variables increase together, creating an upward slope.
  • Negative correlation: it occurs when one variable increases while the other decreases, creating a downward slope.

A scatter plot illustrating linear regression with data points and their vertical distances to the regression line.

The size of the residuals tells us how well the line actually fits the data. Smaller vertical distances mean the line is a better representation of the points.

Correlation TypeDirection of Trend
Positive correlationThe line slopes upwards
Negative correlationThe line slopes downwards

📝 In a study of exercise hours versus television hours, a negative correlation would show that as exercise time goes up, television time goes down.

3.3 Statistical outputs from regression

When using technology to find a line, we get specific values that tell us exactly how reliable our model is. These values help us understand the mathematical strength of the relationship.

  • Linear regression equation: it is the mathematical formula for the line, usually written in the form y=mx+cy = mx + c or y=a+bxy = a + bx.
  • Correlation coefficient (rr): it is a number that measures the strength and direction of the linear relationship.
  • Coefficient of determination (r2r^2): it is the square of the correlation coefficient and shows how much of the variation is explained by the model.

A calculator screen displaying the results of a linear regression calculation.

StatisticWhat it tells us
rrThe strength and direction of the linear relationship
r2r^2The proportion of variance explained by the model

📝 If a calculator shows a high rr value close to 1 or -1, it means the data points sit very close to the line of best fit.

4. Least square regression line

4.1 The least squares method

The least square regression line is a specific line chosen to minimize the total error between the data points and the line itself. It uses a mathematical approach to find the most accurate fit possible.

  • Minimizing error: the method works by making the sum of the squares of the vertical residuals as small as possible.
  • Squaring residuals: we square the vertical distances because it turns negative distances into positive values, preventing them from canceling each other out.
  • Accuracy: this method provides a unique, mathematically "best" line for any given set of data points.
StepAction
1Calculate the vertical distance (residual) for each point
2Square each of those distances
3Find the line that results in the smallest sum of these squares

📝 To find the best line for a set of data, the method calculates the squared vertical distance from every point to the line and picks the line where this total sum is the lowest.

4.2 Outliers and their impact

An outlier is a data point that sits far away from the general pattern of the rest of the data. These points can significantly affect the position and slope of the regression line.

  • Definition of outlier: it is an observation that deviates markedly from the other observations in the sample.
  • Impact on the line: an outlier can "pull" the line toward itself, which might make the line less accurate for the other points.

A scatter plot showing the relationship between fertilizer amount and yield, with an outlier identified.

FeatureDescription
Standard data pointFollows the general trend of the scatter plot
OutlierLocated far from the main cluster of points

📝 If most plants grow more with more fertilizer, but one plant dies despite high fertilizer, that single point is an outlier that might tilt the regression line downward.

5. Regression line (x vs y)

5.1 Regression of x on y

A regression line is a mathematical way to model the relationship between two variables by comparing their values. In a standard setup, we look at how one variable changes in response to another.

  • Independent variable: this is the variable placed on the horizontal axis (the x-axis) to see how it affects the outcome.
  • Dependent variable: this is the variable placed on the vertical axis (the y-axis) which changes based on the independent variable.
  • Scatter diagram: this is a visual plot where individual data points are shown to represent the relationship between the two variables.

A scatter diagram showing the relationship between age and distance thrown.

To perform a regression of x on y, you must change how you set up your data. Instead of the usual way, you simply invert the lists of x and y values before running the calculation.

  • Inverting lists: you swap the positions of the x and y data sets during the setup phase.
  • Interpretation warning: you must be very careful when reading the results after swapping the variables, as the meaning of the slope and intercept will change.

📝 If you want to see how y depends on x but the software requires x on y, you can swap the x and y lists in your setup.

5.2 Correlation types and strength

The relationship between variables is often described by the type and strength of their correlation. This tells us if the variables move together or in opposite directions.

Correlation typeVisual trend
Positive correlationAn upward trend where both variables increase together
Negative correlationA downward trend where one variable increases as the other decreases
No correlationPoints are randomly scattered with no clear pattern

Three scatter plots illustrating different types of correlation: positive, negative, and no correlation.

The strength of a correlation describes how closely the data points follow a specific pattern or line. A strong relationship means the points are very close to the trend, while a weak relationship means they are spread out.

StrengthDescription
StrongData points lie very close to the trend line
ModerateData points follow a visible trend but with more spread
WeakData points show a vague trend with significant scattering

Scatter plots illustrating the strength of correlation, showing strong, moderate, and weak positive and negative relationships.

📝 A strong positive correlation is like a tight group of points climbing a hill, whereas a weak positive correlation looks like a loose cloud of points drifting slightly upward.

6. Non-linear models

6.1 Modeling non-linear patterns

Sometimes, the relationship between two variables does not follow a straight line. In these cases, we use non-linear models to better describe the data.

  • Non-linear patterns: these are relationships where the rate of change between variables is not constant.
  • Complex modeling: this involves using mathematical functions that can capture curves or more complicated shapes in the data.

📝 If a graph curves upward like a ramp instead of moving in a straight line, a non-linear model is needed to fit the data.

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also