HLSL 03 Bivariate Statistics & Modeling
Table of contents
- Variables and association
- Linear correlation
- Line of best fit
- Least square regression line
- Regression line (x vs y)
- 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.

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 Type | Direction of Change |
|---|---|
| Positive | Both variables move in the same direction |
| Negative | Variables move in opposite directions |
| No correlation | No predictable pattern exists |

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 r, 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 (r): it is a value that ranges from −1 to 1.
- Strength of correlation: it is determined by how close the value of r is to either 1 or −1.
- Coefficient of determination (r2): it is the square of the correlation coefficient and shows how well the line fits the data.
| Value of r | Strength and Direction |
|---|---|
| r=1 | Perfect positive correlation |
| r=−1 | Perfect negative correlation |
| r=0 | No linear correlation |
| Close to 1 or −1 | Strong correlation |
| Close to 0 | Weak correlation |

The linear regression equation is written as y=ax+b. This equation allows us to calculate predicted values for y if we know the value of x.
📝 Using the equation y=ax+b, we can plug in a specific value for x to find the predicted value of y 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 x 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.
| Method | Location of x value | Reliability |
|---|---|---|
| Interpolation | Inside the data range | Generally reliable |
| Extrapolation | Outside the data range | Less reliable/Risky |

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.

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 x and y values.
- Scatter plot: it displays individual data points to show the relationship between two variables.

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.

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 Type | Direction of Trend |
|---|---|
| Positive correlation | The line slopes upwards |
| Negative correlation | The 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+c or y=a+bx.
- Correlation coefficient (r): it is a number that measures the strength and direction of the linear relationship.
- Coefficient of determination (r2): it is the square of the correlation coefficient and shows how much of the variation is explained by the model.

| Statistic | What it tells us |
|---|---|
| r | The strength and direction of the linear relationship |
| r2 | The proportion of variance explained by the model |
📝 If a calculator shows a high r 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.
| Step | Action |
|---|---|
| 1 | Calculate the vertical distance (residual) for each point |
| 2 | Square each of those distances |
| 3 | Find 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.

| Feature | Description |
|---|---|
| Standard data point | Follows the general trend of the scatter plot |
| Outlier | Located 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.

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 type | Visual trend |
|---|---|
| Positive correlation | An upward trend where both variables increase together |
| Negative correlation | A downward trend where one variable increases as the other decreases |
| No correlation | Points are randomly scattered with no clear pattern |

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.
| Strength | Description |
|---|---|
| Strong | Data points lie very close to the trend line |
| Moderate | Data points follow a visible trend but with more spread |
| Weak | Data points show a vague trend with significant scattering |

📝 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.