1.5 Correlation and Linear Regression
Section Overview
- Gallery 1.5.1 - Scatterplots & Correlations
- Example 1.5.1
- Gallery 1.5.2- Scatterplot & Reg on Calc
- Gallery 1.5.2 - Lin. Reg. & 2 Vars on Calc
- Interactive 1.5.1 - Example 1.5.1
- Pop Quiz 1.5.1
Scatterplots
We’ve already discussed using two categorical variables together, visually expressed in the form of two way tables. In this section we will discuss using two quantitative variables together. If you have taken any sort of math or physical science class before, you are probably already familiar with the scatterplot, a graph that displays the relationship between the explanatory variable (represented by the x-coordinate and graphed on the x-axis) and the response variable (represented by the y-coordinate and graphed on the y-axis). An observation’s explanatory variable is named as such because we want it to predict, explain or cause a response in the observation’s response variable.
Scatterplots have three primary attributes – their direction, strength, and form:
Direction – If the x-values increase as the y-values increase on the scatterplot, then the two variables have a positive association. Conversely, if the x-values increase as the y-values decrease on the scatterplot, then the two variables have a negative association. If neither of these scenarios occurs, then we have no association.
Strength – Strength defines how closely a scatterplot follows a clear form. We call scatterplots with a very clear linear form strong and scatterplots with a less clear linear form weak.
Form – We can usually describe a scatterplot’s form in terms of being linear or non-linear. One thing that occurs in both linear and non-linear scatterplots that we can’t directly account for in either the direction or strength of a scatterplot is any clustering that occurs in certain sections of the graph.
Correlation
We can use a measure to also describe the relationship’s direction and strength. This measure is known as the correlation coefficient, represented by the variable .
- For relationships with a positive association, .
- For relationships with a negative association, .
- The range of values the correlation coefficient can take is . The closer is to , the greater the stronger the relationship is between the two variables.
- Similar to the mean and standard deviation, the correlation coefficient is not a resistant measure because it is strongly affected by outliers.
- The correlation stays the same regardless of which of your quantitative variables is your explanatory variable and which is your response variable. It’s up to you to determine which variable is which!
What can the correlation tell us about the relationship’s form, though? Well, we can calculate the correlation for any scatterplot, but is best at measuring linear relationships. This means that even if the scatterplot has an that is close to 0, the scatterplot could still follow some form, such as a curve. See Gallery 1.5.1 for some examples of scatterplots and their estimated correlation values.
Gallery 1.5.1 Scatterplots and Correlations
Frame 1 of 6
The x and y variables in this scatterplot have no association and thus have a correlation of r=0 Open full-size image S0076Frame 2 of 6
The x and y variables in this scatterplot have a weak negative association and has a correlation of about r=-0.3 Open full-size image S0077Frame 3 of 6
The x and y variables in this scatterplot have a moderately strong positive association and have a correlation of about r=0.6 Open full-size image S0078Frame 4 of 6
The x and y variables in this scatterplot have a strong positive association and have a correlation of about r=0.9 Open full-size image S0079Frame 5 of 6
The x and y variables in this scatterplot have a very strong positive association and have a correlation of about r=0.99 Open full-size image S0080Frame 6 of 6
The x and y variables in this scatterplot have no association because the scatterplot follows a curved pattern. Its correlation is about r=0. Open full-size image S0081
Capture provenance
Filename capture times, with no recorded timezone. Frames above follow the original gallery positions.
- · S0076 · displayed frame 1
Screenshot 2026-10-05 at 3.41.07 PM.png - · S0077 · displayed frame 2
Screenshot 2026-10-05 at 3.41.13 PM.png - · S0078 · displayed frame 3
Screenshot 2026-10-05 at 3.41.18 PM.png - · S0079 · displayed frame 4
Screenshot 2026-10-05 at 3.41.23 PM.png - · S0080 · displayed frame 5
Screenshot 2026-10-05 at 3.41.28 PM.png - · S0081 · displayed frame 6
Screenshot 2026-10-05 at 3.41.32 PM.png
Regression Line
Our brain loves to interpret data by creating models. That might explain why you feel the urge to draw a “line of best fit” through the points on a scatterplot, formally called a least-squares regression line. It is named as such because it minimizes the squares of the vertical distances between the points on the scatterplot and the line. The regression line is represented by the equation , where
- = intercept, or the y-value of the line where
- = slope, or the value that tells you by how many units has increased when has increased by 1 unit
- = value of explanatory variable
- = predicted value of response variable
The slope can also be obtained through the formula:
where
- = correlation coefficient
- = standard deviation of x
- = standard deviation of y
Example 1.5.1
Gallery 1.5.2 Example 1.5.1 (Creating Scatterplots and Least-Squares Regression Lines on TI-83/84)
Frame 1 of 12
Press the STAT button and under EDIT, select “Edit” and press ENTER Open full-size image S0083Frame 2 of 12
Enter your 21 data points in the two lists. L1 is for backpack weights and L2 is for grades. Open full-size image S0084Frame 3 of 12
For graphing the boxplot, Press the 2nd>Y= buttons, and when you are taken to the STAT PLOTS page, select Plot1 and press ENTER Open full-size image S0085Frame 4 of 12
With Plot1 selected, make sure the scatterplot is selected and L1 and L2 are selected for Xlist and Ylist, respectively. Open full-size image S0086Frame 5 of 12
Press the ZOOM button and under ZOOM, choose ZoomStat. Open full-size image S0087Frame 6 of 12
The resulting scatterplot for Example 1.5.1. Open full-size image S0088Frame 7 of 12
Press the Y= button and your cursor should be resting on the Y1 line. Open full-size image S0089Frame 8 of 12
Press the VARS button and under VARS, select Statistics. Open full-size image S0090Frame 9 of 12
Scroll to EQ and select RegEQ. Open full-size image S0091Frame 10 of 12
The least-squares regression line for your data should appear on the Y1 line. Open full-size image S0092Frame 11 of 12
Press Zoom and select ZoomStat Open full-size image S0093Frame 12 of 12
Press the GRAPH Button and you should see the least squares regression line going through your data. Open full-size image S0094
Capture provenance
Filename capture times, with no recorded timezone. Frames above follow the original gallery positions.
- · S0083 · displayed frame 1
Screenshot 2026-10-05 at 3.41.36 PM.png - · S0084 · displayed frame 2
Screenshot 2026-10-05 at 3.41.48 PM.png - · S0085 · displayed frame 3
Screenshot 2026-10-05 at 3.41.53 PM.png - · S0086 · displayed frame 4
Screenshot 2026-10-05 at 3.41.57 PM.png - · S0087 · displayed frame 5
Screenshot 2026-10-05 at 3.42.03 PM.png - · S0088 · displayed frame 6
Screenshot 2026-10-05 at 3.42.12 PM.png - · S0089 · displayed frame 7
Screenshot 2026-10-05 at 3.42.16 PM.png - · S0090 · displayed frame 8
Screenshot 2026-10-05 at 3.42.21 PM.png - · S0091 · displayed frame 9
Screenshot 2026-10-05 at 3.42.27 PM.png - · S0092 · displayed frame 10
Screenshot 2026-10-05 at 3.42.32 PM.png - · S0093 · displayed frame 11
Screenshot 2026-10-05 at 3.42.38 PM.png - · S0094 · displayed frame 12
Screenshot 2026-10-05 at 3.42.43 PM.png
The equation displayed in frame 10 is .
Gallery 1.5.3 Example 1.5.1 (Performing Linear Regression and Two-Variable Summary Statistics on TI 83/84)
Frame 1 of 9
Press 2nd>0 to be brought to the CATALOG screen. Scroll down to DiagnosticOn. Open full-size image S0083Frame 2 of 9
Press ENTER and you will arrive at this screen. Open full-size image S0095Frame 3 of 9
Go to STAT > EDIT and select LinReg(a+bx). Press ENTER. Open full-size image S0096Frame 4 of 9
You will be brought to this screen. Press ENTER again. Open full-size image S0097Frame 5 of 9
The slope, intercept, and correlation coefficient are shown. Open full-size image S0098Frame 6 of 9
Go to STAT > CALC and select 2-Var Stats Open full-size image S0099Frame 7 of 9
You will be brought to this screen. If your values are still stored in L1 and L2, then press Enter. Open full-size image S0100Frame 8 of 9
Summary Statistics displayed for the backpack weights Open full-size image S0101Frame 9 of 9
Summary Statistics displayed for the Grade Point Average. Open full-size image S0102
Capture provenance
Filename capture times, with no recorded timezone. Frames above follow the original gallery positions.
- · S0083 · displayed frame 1
Screenshot 2026-10-05 at 3.41.36 PM.png - · S0095 · displayed frame 2
Screenshot 2026-10-05 at 3.42.51 PM.png - · S0096 · displayed frame 3
Screenshot 2026-10-05 at 3.42.58 PM.png - · S0097 · displayed frame 4
Screenshot 2026-10-05 at 3.43.04 PM.png - · S0098 · displayed frame 5
Screenshot 2026-10-05 at 3.43.09 PM.png - · S0099 · displayed frame 6
Screenshot 2026-10-05 at 3.43.16 PM.png - · S0100 · displayed frame 7
Screenshot 2026-10-05 at 3.43.22 PM.png - · S0101 · displayed frame 8
Screenshot 2026-10-05 at 3.43.28 PM.png - · S0102 · displayed frame 9
Screenshot 2026-10-05 at 3.43.35 PM.png
The visible summary values in frames 8 and 9 are transcribed below. The table associates them with the recognizable calculator statistics; the original overlapping labels remain available in the images.
| Statistic | Backpack weights | Grade Point Average |
|---|---|---|
| Mean | 3.243809524 | 83.85714286 |
| Sum | 68.12 | 1761 |
| Sum of squares | 298.3348 | 148079 |
| Sample standard deviation | 1.966805726 | 4.508721707 |
| Population standard deviation | 1.919405851 | 4.400061842 |
| Number of observations (visible in weight display) | 21 |
The GPA display also shows .
Example 1.5.1 — recorded answer
a) See Gallery 1.5.2 on how to create scatterplots on your calculator. You can also create one by hand, but we recommend entering the data into your calculator since we will be using it to make other calculations. Upon sketching/graphing the scatterplot, we see that a very weak, positive linear correlation exists between the two variables: backpack weight and GPA due to the two noticeable outliers in the data, the one where the student has an unusually low GPA of 72% and the one where the student has an unusually high backpack weight of 8.3 kilograms.
b) See Gallery 1.5.3 on how to find the correlation, intercept, and slope for a least squares regression line.
For the correlation, we get , which confirms our earlier statement of a weak, positive correlation.
For the intercept, we get .
For the slope, we get . We can also confirm this value by using our slope formula:
We already know the correlation, and the standard deviations are calculated to be: and . See Gallery 1.5.3 on how to find these values. Plugging them into our formula we get:
Interactive 1.5.1 Example 1.5.1
Pop Quiz 1.5.1
Glossary and deeper reading · 11 refreshers
These editorial refreshers supplement the reading. Definitions and examples are added guidance; original source wording and recorded answers remain in their original context.
-
Scatterplot
A scatterplot displays paired values of two quantitative variables as points. The horizontal coordinate represents one variable and the vertical coordinate represents the other. For example, plotting hours studied against test scores helps reveal a pattern without establishing causation.
-
Categorical variable
A categorical variable records a group or label for each individual. Numeric labels still count as categories when arithmetic on them has no meaningful interpretation. For example, favorite school subject is categorical, even if each subject receives a numbered code.
Read more: Categorical variable in the captured Statistics reading →
-
Two-way table
A two-way table organizes counts for combinations of two categorical variables. The cells show combinations, while row and column totals summarize each variable separately. For example, a table can classify students by grade level and whether they walk to school.
Read more: Two-way table in the captured Statistics reading →
-
Positive association
Two variables have a positive association when larger values of one tend to accompany larger values of the other. Individual observations need not follow the tendency perfectly. For example, taller trees may tend to have wider trunks.
-
Negative association
Two variables have a negative association when larger values of one tend to accompany smaller values of the other. The tendency can be linear or curved and does not by itself show cause and effect. For example, higher fuel efficiency may accompany lower fuel use per mile.
-
Mean
The mean is a measure of center often called an average. For a finite data set, the arithmetic mean is the sum of the values divided by their number; for a random variable, the mean is its probability-weighted expected value when that value exists. Means can be pulled toward extreme values and are not generally resistant. For example, the arithmetic mean of 2, 4, and 9 is 5.
-
Standard deviation
Standard deviation measures spread around the mean using squared deviations and a square root. A sample standard deviation uses the sum of squared deviations divided by one less than the sample size before taking the square root. For example, a larger standard deviation of travel times indicates greater variability, in the original time units.
Read more: Standard deviation in the captured Statistics reading →
-
Quantitative variable
A quantitative variable records a numerical count or measurement for each individual. Differences between its values have a meaningful numerical interpretation. For example, the number of books borrowed and the mass of a backpack are quantitative variables.
Read more: Quantitative variable in the captured Statistics reading →
-
Explanatory variable
An explanatory variable is used to predict or explain variation in a response variable. In an experiment, researchers deliberately assign values or treatments related to an explanatory variable. For example, assigned study time could be an explanatory variable when test score is the response.
-
Regression intercept
A regression intercept is the line’s predicted response when the explanatory variable is zero. It may lack a useful contextual interpretation when zero lies outside the relevant data range. For example, an intercept predicts height at age zero even if measurements were collected only for mature plants.
-
Response variable
A response variable records the outcome being studied. Its relationship to an explanatory variable can be investigated without assuming that the explanatory variable causes it. For example, plant height is a response when researchers compare fertilizer treatments.