Scatter Plots and Correlation
A friend says, "The more I scroll on my phone, the lower my grades get." Is that just a feeling, or do the data show it? And even if the data show it, would you bet that scrolling causes the lower grades? Before you calculate anything, one picture can tell you a lot: the scatter plot. By the end of this page you will know how to read it, and how to avoid being fooled by it.
What a scatter plot shows
Each point is one person. The point $(4, 6)$ is a player who practiced $4$ hours and made $6$ free throws. Six players means six points, no more and no less.
By convention, if one variable might help explain the other, it goes on the $x$-axis. It is called the explanatory variable. The variable we want to predict or explain goes on the $y$-axis. It is called the response variable.
A group of 11th grade students has carried out a small study on the time they spend on video games per week ($X$, in hours) and the grade obtained in the last Math exam…
A group of 11th grade students has carried out a small study on the time they spend on video games per week ($X$, in hours) and the grade obtained in the last Math exam ($Y$, from 0 to 10). The data collected are as follows:
| Hours ($X$) | 2 | 5 | 8 | 10 | 12 | 15 |
|---|---|---|---|---|---|---|
| Grade ($Y$) | 9 | 8 | 6 | 5 | 4 | 3 |
Represent the scatter plot corresponding to this two-dimensional distribution on a Cartesian coordinate system and state, simply by observing the graph, whether the relationship between both variables seems to be direct or inverse.
Match each of the following pairs of variables with the type of scatter plot you would expect to obtain (increasing, decreasing or with no defined shape): a) The number…
Match each of the following pairs of variables with the type of scatter plot you would expect to obtain (increasing, decreasing or with no defined shape):
- a) The number of miles driven by a car and the fuel left in its tank.
- b) The height of a group of teenagers and their grade in the English exam.
- c) The training hours of an athlete and their personal best in a 100-meter sprint.
- d) The outside temperature in summer and the energy consumption of air conditioning units.
A group of researchers wants to study whether there is a relationship between the weekly time teenagers spend using video streaming* applications and their academic…
A group of researchers wants to study whether there is a relationship between the weekly time teenagers spend using video streaming applications and their academic performance. To do this, they have selected a sample of 8 students and collected the following data:
| Streaming hours ($X$) | 12 | 18 | 5 | 22 | 10 | 15 | 8 | 25 |
|---|---|---|---|---|---|---|---|---|
| Mean grade ($Y$) | $7,5$ | $6,2$ | $8,8$ | $5,5$ | $8,0$ | $6,8$ | $8,2$ | $4,8$ |
- a) Represent the scatter plot associated with this two-dimensional distribution.
- b) Looking at the graph, what type of correlation seems to exist between both variables (direct or inverse)? Justify whether you think the relationship is strong or weak.
Which variables can go in a scatter plot?
A scatter plot needs two quantitative variables, meaning numbers you can measure or count and place in order on an axis. Examples are height, miles driven, hours of sleep, and price.
If one of the variables is categorical (eye color, favorite sport, names), there is no numerical position to put on an axis. A scatter plot makes no sense. For categorical data, use a two-way table instead.
| Pair of variables | Scatter plot? | Why |
|---|---|---|
| Hours of sleep and score on a quiz | Yes | Both are numbers |
| Eye color and favorite sport | No | Both are categories |
| Student names and height | No | Names are not numbers |
Explain with reasoning why the following data could not be correctly represented using a scatter plot in the context of two-dimensional statistics: | Student | Eye color…
Explain with reasoning why the following data could not be correctly represented using a scatter plot in the context of two-dimensional statistics:
| Student | Eye color | Favorite sport |
|---|---|---|
| Emma | Blue | Basketball |
| Michael | Brown | Soccer |
| Olivia | Green | Tennis |
Given the following pairs of variables, state for which of them it would make sense to construct a scatter plot to analyze their relationship. Justify your decision in…
Given the following pairs of variables, state for which of them it would make sense to construct a scatter plot to analyze their relationship. Justify your decision in each case:
-
The names of the students in the class and their height.
-
The number of hours of study and the grade in an exam.
-
The eye color and the gender of a person.
-
The price of a second-hand car and its miles driven.
Direction, strength, and form
To describe a scatter plot, answer three questions.
The words direct (or positive) and inverse (or negative) describe the direction. A very narrow band that rises, like the heights and weights of a basketball team, is a strong positive association.
Every scatter plot also has a "center": the point $(\bar{x}, \bar{y})$ made of the two means. Some problems call it the center of gravity of the cloud. Two clouds can share the same center and still be very different. One can be a round, scattered blob while the other is a thin streak.
Observe the following scatter plots represented below. Identify in each case whether the correlation is positive, negative or zero.
Observe the following scatter plots represented below. Identify in each case whether the correlation is positive, negative or zero.
The weight ($X$) and height ($Y$) of the players in a basketball team have been measured. The scatter plot shows a very elongated and narrow shape that follows an upward…
The weight ($X$) and height ($Y$) of the players in a basketball team have been measured. The scatter plot shows a very elongated and narrow shape that follows an upward direction.
What does the fact that the scatter plot is "narrow" indicate regarding the strength of the correlation? What would we call the relationship between weight and height in this case (direct or inverse)?
The relationship between the investment in social media advertising ($X$, in thousands of dollars) and the number of new subscribers ($Y$, in hundreds) for two different…
The relationship between the investment in social media advertising ($X$, in thousands of dollars) and the number of new subscribers ($Y$, in hundreds) for two different mobile applications, "App A" and "App B", is studied. The resulting scatter plots show that both have a mean investment of $\bar{x} = 5$ and a mean number of subscribers of $\bar{y} = 12$. However, App A presents a very scattered circular cloud, while App B presents a very narrow and elongated cloud with a negative slope.
-
Sketch both scatter plots on the same set of axes, differentiating them by colors or symbols.
-
Compare the correlation coefficients $r_A$ and $r_B$. In which case is it more reliable to make a prediction of the number of subscribers based on the investment?
-
What would it mean, in the context of marketing, for App B to have a negative slope?
The correlation coefficient r
Describing strength with words is fuzzy. The correlation coefficient $r$ (Pearson's $r$) puts a number on how closely the points follow a straight line. Your calculator computes it, so your job is to know what the number means.
Why can't $r$ leave $[-1, 1]$? The covariance $s_{xy}$ measures how $x$ and $y$ vary together, and $r = \dfrac{s_{xy}}{s_x s_y}$ divides it by the product of the two standard deviations. This standardization keeps $r$ between $-1$ and $1$ and also removes the units. The covariance has the same sign as $r$: positive when the cloud rises, negative when it falls.
As a rough guide, $|r|$ above about $0.8$ is strong, between about $0.5$ and $0.8$ is moderate, and below about $0.3$ is weak. These cutoffs are a rule of thumb, not a law.
State whether the following statements about scatter plots are true or false: a) If all the points in the scatter plot lie exactly on an increasing straight line, the…
State whether the following statements about scatter plots are true or false:
- a) If all the points in the scatter plot lie exactly on an increasing straight line, the correlation is perfect and positive ($r = 1$).
- b) A scatter plot with a circular shape indicates a very strong correlation.
- c) In a scatter plot, the independent variable is always represented on the y-axis ($Y$).
- d) The scatter plot allows us to quickly visualize whether there is any relationship between two numerical variables.
Match each of the following Pearson linear correlation coefficients with its corresponding scatter plot: $r_1 = 0,98$ ; $r_2 = -0,75$ ; $r_3 = 0,05$ ; $r_4 = -0,99$
Match each of the following Pearson linear correlation coefficients with its corresponding scatter plot:
$r_1 = 0,98$ ; $r_2 = -0,75$ ; $r_3 = 0,05$ ; $r_4 = -0,99$
Given the following four scatter plots associated with different social phenomena, reasonably assign to each one of these correlation coefficients: $r_1 = 0,95$,…
Given the following four scatter plots associated with different social phenomena, reasonably assign to each one of these correlation coefficients: $r_1 = 0,95$, $r_2 = -0,80$, $r_3 = 0,05$ and $r_4 = -0,10$.
Argue your choice based on the dispersion with respect to a possible line and the direction of the inclination of the points.
Correlation and causation
Two kinds of relationship show up in real data.
Pizza price per slice times the number of slices is functional. Hours of studying and test score are statistical, since two students who study $3$ hours can get different scores.
A strong correlation also does not prove that $x$ causes $y$. A third variable may drive both, or the match may be a coincidence.
Back to the opening question: if phone time and grades are strongly negatively correlated, the scatter plot shows they move together. It cannot show that scrolling causes the lower grades. Sleep, motivation, or free time could be behind both.
A study has been carried out on the relationship between the number of books read per year ($X$) and the score in a reading comprehension test ($Y$) in a group of…
A study has been carried out on the relationship between the number of books read per year ($X$) and the score in a reading comprehension test ($Y$) in a group of students. The resulting scatter plot is shown below:
- a) State whether there is a functional dependence or a statistical dependence. Explain the difference between both concepts using this example.
- b) Classify the correlation according to its sign and its strength (strong, moderate or weak).
- c) Could we state that "reading more books necessarily causes getting a better grade"? Reason the difference between correlation and causality.
A courier company analyzes the weight of the parcels ($X$, in pounds) and the shipping cost ($Y$, in dollars). They observe that the scatter plot is practically a…
A courier company analyzes the weight of the parcels ($X$, in pounds) and the shipping cost ($Y$, in dollars). They observe that the scatter plot is practically a perfect straight line with a positive slope.
- a) What would be the approximate value of the correlation coefficient $r$ in this case?
- b) If the shipping cost is calculated using a fixed rate per pound, would we be looking at a statistical or functional relationship?
- c) Draw what the scatter plot would look like if, in addition to the weight, the cost depended on random factors such as the availability of delivery drivers at that time.
Outliers
One outlier can change $r$ a lot. In the picture below, eight points follow a strong upward line, but a ninth point, a student who spends many hours on a game and scores very low, sits far below the pattern.
An outlier that goes against the trend makes $|r|$ smaller. If you remove it, $|r|$ gets closer to $1$. An outlier that sits far out along the trend can do the opposite and inflate $r$.
An influencer* analyzes the relationship between the number of hours they spend editing a video ($X$) and the number of "likes" they receive in the first 24 hours ($Y$,…
An influencer analyzes the relationship between the number of hours they spend editing a video ($X$) and the number of "likes" they receive in the first 24 hours ($Y$, in thousands). After publishing 10 videos, they obtain a very narrow and ascending scatter plot, except for one video which, after only 1 hour of editing, got a massive number of "likes" due to a viral challenge.
- a) What is the technical name for that point which deviates from the general trend of the scatter plot?
- b) If the influencer decides to remove that special data point from their study, what would happen to the absolute value of the correlation coefficient $r$? Would it increase or decrease? Justify your answer.
- c) Would the relationship between the variables become more or less linear after removing this point?
A group of researchers analyzes the relationship between the weekly time spent on strategy video games (variable $X$, in hours) and the score obtained in a logical…
A group of researchers analyzes the relationship between the weekly time spent on strategy video games (variable $X$, in hours) and the score obtained in a logical reasoning test (variable $Y$, from 0 to 100). The data from 10 teenagers show a very strong positive linear correlation, with the exception of one individual who spends 25 hours a week and scores only 10 points on the test.
Based on the graphical representation:
-
Explain reasonably how the point $P$ affects the value of Pearson's correlation coefficient $r$ and the slope of the future regression line.
-
If we removed the point $P$, could we state that there is a causal relationship between playing video games and logical reasoning? Justify your answer by analyzing the nature of the variables.
Curved patterns and r near 0
Sometimes the points have a clear pattern, but it is a curve. Think of a plant. A little fertilizer helps it grow, a lot of it causes harm, and the best height comes somewhere in the middle. Or think of a basketball player. Too little nerves and they're careless, too many and they freeze, so free-throw percentage peaks at a medium level of anxiety.
The left half rises and the right half falls, so they cancel. The covariance $s_{xy}$ and $r$ come out close to $0$, yet the relationship is clear and strong.
A biologist measures the height of an exotic plant species ($Y$, in inches) as a function of the amount of nitrogen fertilizer applied ($X$, in mg). They observe that,…
A biologist measures the height of an exotic plant species ($Y$, in inches) as a function of the amount of nitrogen fertilizer applied ($X$, in mg). They observe that, initially, the height increases rapidly with the fertilizer, but after a certain amount, the plant becomes saturated and the height stabilizes or even decreases slightly due to toxicity.
-
Analyze the scatter plot and determine whether a linear regression model would be suitable to describe this relationship over the entire domain of $X$.
-
If the biologist calculates Pearson's correlation coefficient for all the data and obtains a value close to $0$, does this mean that the variables are independent? Justify the answer based on the shape of the scatter plot.
A sports psychologist is studying the relationship between the pre-game activation level (anxiety, variable $X$) and the free-throw performance of basketball players…
A sports psychologist is studying the relationship between the pre-game activation level (anxiety, variable $X$) and the free-throw performance of basketball players (success percentage, variable $Y$). The literature suggests that there is an "optimal level" of activation: if it is too low, the player is apathetic; if it is too high, they are blocked.
-
Draw a hypothetical scatter plot reflecting this situation (known as the Yerkes-Dodson law).
-
If a data analyst calculated the covariance $s_{xy}$ of this scatter plot and obtained a value close to zero, would it be correct to conclude that the anxiety level does not influence performance? Justify your answer by analyzing the geometry of the scatter plot you have drawn.
Mixed groups and changing units
Groups mixed together
Sometimes the data contain separate groups, called clusters. Inside each group the trend may be strong, but when you pool everything together, the overall picture can look weak, flat, or even reversed.
Example: in each neighborhood, rent goes up with population density, but the suburbs and the downtown clusters sit far apart. One single $r$ for all the points would be misleading. Analyze each cluster separately first.
Changing units
What if you convert units, say from inches to feet, or shift all the values? The cloud moves or stretches, but its shape does not change.
So for $r = 0.98$, the transformed data still have $r' = 0.98$. Predictions from the new line are as reliable as before, because the strength of the association is unchanged. Only the numbers in the equation of the line change.
In a study on urban demographics, the population density (inhabitants/$km^2$) is represented on the $X$-axis and the average rent price ($\$/m^2$) on the $Y…
In a study on urban demographics, the population density (inhabitants/$km^2$) is represented on the $X$-axis and the average rent price ($\$/m^2$) on the $Y$-axis. The scatter plot obtained shows a very peculiar structure: two clearly differentiated groups of points ("clusters"). Group 1 corresponds to suburban neighborhoods and group 2 to historic center neighborhoods.
-
If within each separate group the correlation is positive and strong, but when considering all the points together the scatter plot seems to have no clear trend, what problems would we encounter when trying to calculate a single Pearson correlation coefficient for the whole city?
-
Explain how the existence of hidden qualitative variables (such as the type of neighborhood) can "deceive" the interpretation of a two-dimensional scatter plot.
Consider a scatter plot with a very strong positive linear correlation ($r = 0,98$). Suppose we transform all the values of variable $X$ using the operation…
Consider a scatter plot with a very strong positive linear correlation ($r = 0,98$). Suppose we transform all the values of variable $X$ using the operation $X' = X + 50$ and all the values of variable $Y$ using $Y' = 3 \cdot Y$.
-
Describe what changes the scatter plot would undergo in the plane (translation, deformation, change of scale).
-
Reason, without performing calculations, whether the new correlation coefficient $r'$ will be greater than, less than, or equal to the original $r$.
-
Would the reliability of the predictions change if we used the new transformed scatter plot? Explain why.
Sketching a line of fit and predicting
When the cloud is roughly linear, you can draw a line of fit by eye and use it to estimate. A formal, calculated line of best fit comes later, but the idea is the same.
Using the line to estimate a value inside the range of the data is interpolation, and it is usually reliable. Going outside the range is extrapolation, and it is risky, because the pattern may not continue.
The following table shows the distance traveled ($X$, in miles) and the time taken ($Y$, in min) by a cyclist on their training rides: | Distance ($X$) | 10 | 15 | 20 |…
The following table shows the distance traveled ($X$, in miles) and the time taken ($Y$, in min) by a cyclist on their training rides:
| Distance ($X$) | 10 | 15 | 20 | 25 | 30 | 35 |
|---|---|---|---|---|---|---|
| Time ($Y$) | 22 | 35 | 42 | 58 | 70 | 82 |
- a) Draw the scatter plot.
- b) Draw freehand the line of best fit for the points (regression line).
- c) Using the line you have drawn, estimate how long it would take the cyclist to travel 45 miles. Do you think this estimation is reliable?
Observe the following scatter plot representing the relationship between the average monthly temperature ($X$, in $^\circ C$) and the heating expenditure ($Y$, in…
Observe the following scatter plot representing the relationship between the average monthly temperature ($X$, in $^\circ C$) and the heating expenditure ($Y$, in dollars) of a residents' association over a year.
- a) Explain with reasoning the sign of the correlation and what it means in this real context.
- b) If the center of gravity of the distribution is the point $G(12, 110)$, what do these values represent in relation to the data collected during the year?
- c) Would it be reliable to use a regression line to predict the expenditure if the temperature is $2^\circ C$? And if it is $45^\circ C$? Reason your answer based on the shape of the scatter plot.
The following scatter plot has been obtained, relating the monthly electrical energy consumption of a household ($X$, in kWh) to the average outside temperature that…
The following scatter plot has been obtained, relating the monthly electrical energy consumption of a household ($X$, in kWh) to the average outside temperature that month ($Y$, in $^\circ C$).
-
Describe the relationship between the variables. Is it a linear relationship throughout its range?
-
Justify why the coefficient of determination $R^2$ for a linear fit would be very low even though there is an obvious relationship between the variables.
-
Propose a way to divide the study of this scatter plot in order to apply linear regression techniques effectively.