Parameters of a Bivariate Distribution
Marcus tracks his practice for five weeks: hours practiced each week and free throws made out of 20 in the Friday shootout. The dots on his scatter plot climb to the right. But how strong is that pattern, and how much should he trust a prediction for next week? In this section you turn the picture into numbers you can calculate, compare, and use to predict.
The mean point and marginal parameters
When you have paired data $(x_i, y_i)$ for $n$ individuals, you can study each variable on its own. These are the marginal parameters: the mean $\bar{x}$ and standard deviation $\sigma_x$ of $X$, and the same for $Y$.
A note on notation: here we divide by $n$, treating the data as the whole group. Many problems write the standard deviations as $\sigma_x, \sigma_y$ and others as $s_x, s_y$. They mean the same thing in this section. (In AP Statistics the sample versions divide by $n-1$, but the correlation $r$ and the regression slope come out exactly the same.)
Given the following table of values representing the number of followers on a social network in thousands ($X$) and the advertising income in dollars ($Y$) of 5…
Given the following table of values representing the number of followers on a social network in thousands ($X$) and the advertising income in dollars ($Y$) of 5 influencers:
| $X$ (followers) | 10 | 20 | 30 | 40 | 50 |
|---|---|---|---|---|---|
| $Y$ (revenue) | 100 | 150 | 250 | 300 | 450 |
Calculate the marginal means $\bar{x}$ and $\bar{y}$.
A group of friends analyzes the relationship between the hours they spend playing a video game per week ($X$) and the score obtained in the last tournament ($Y$). The…
A group of friends analyzes the relationship between the hours they spend playing a video game per week ($X$) and the score obtained in the last tournament ($Y$). The data for four of them is: $(2, 150)$, $(4, 300)$, $(6, 450)$ and $(8, 500)$.
Calculate the coordinates of the center of gravity $(\bar{x}, \bar{y})$ of this bivariate distribution and represent it on a scatter plot along with the previous points.
A sociological study analyzes the relationship between the number of weekly hours teenagers dedicate to reading for pleasure ($X$) and their score on a reading…
A sociological study analyzes the relationship between the number of weekly hours teenagers dedicate to reading for pleasure ($X$) and their score on a reading comprehension test ($Y$). The data from a sample of 5 students is collected in the following table:
| Hours ($X$) | 2 | 4 | 5 | 8 | 11 |
|---|---|---|---|---|---|
| Score ($Y$) | 62 | 70 | 75 | 88 | 95 |
- a) Calculate the marginal means $\bar{x}$ and $\bar{y}$.
- b) Determine the marginal standard deviations $\sigma_x$ and $\sigma_y$.
- c) Represent the center of gravity of the distribution on a scatter plot.
Covariance
Means and standard deviations describe each variable separately. To measure how $X$ and $Y$ move together, use the covariance.
Why does this measure "moving together"? Draw lines through the mean point. A point in the upper right (or lower left) has $(x_i - \bar{x})(y_i - \bar{y}) > 0$. A point in the upper left (or lower right) gives a negative product. The covariance is the average of those products.
Most points here sit in the "+" quadrants, so $\sigma_{xy} > 0$. The sign tells you the direction of the relationship:
-
$\sigma_{xy} > 0$: $X$ and $Y$ tend to increase together.
-
$\sigma_{xy} < 0$: when one increases, the other tends to decrease.
-
$\sigma_{xy} \approx 0$: no linear trend.
State, without performing calculations, what sign you expect the covariance $\sigma_{xy}$ to have in the following situations. Justify your answer based on the…
State, without performing calculations, what sign you expect the covariance $\sigma_{xy}$ to have in the following situations. Justify your answer based on the relationship between the variables:
- a) $X$: Speed of a car, $Y$: Time taken to travel a fixed distance.
- b) $X$: Hours studying a language, $Y$: Number of words known in that language.
- c) $X$: A person's shoe size, $Y$: Their score on the History exam.
In a study on physical performance, the resting heart rate ($X$) and the time in seconds taken to recover the normal heart rate after exertion ($Y$) are measured. It is…
In a study on physical performance, the resting heart rate ($X$) and the time in seconds taken to recover the normal heart rate after exertion ($Y$) are measured. It is known that the sum of the products of the variables is $\sum x_i y_i = 15200$, the number of individuals is $n = 10$, and the means are $\bar{x} = 70$ and $\bar{y} = 20$.
Use the simplified formula $\sigma_{xy} = \frac{\sum x_i y_i}{n} - \bar{x} \bar{y}$ to calculate the covariance. What does the sign of the result indicate about the relationship between heart rate and recovery time?
A streaming platform wants to check if there is a relationship between the length of a series (in number of seasons, $X$) and the mean user rating (out of 10 points,…
A streaming platform wants to check if there is a relationship between the length of a series (in number of seasons, $X$) and the mean user rating (out of 10 points, $Y$). The following parameters are available after analyzing 50 series:
$\sum x_i = 150 \quad \sum y_i = 325 \quad \sum x_i^2 = 580 \quad \sum y_i^2 = 2200 \quad \sum x_i y_i = 940$
- a) Calculate the covariance $\sigma_{xy}$.
- b) Interpret the result obtained in the context of the problem: do longer series tend to have better or worse ratings?
Changing units: what happens to the parameters
What if Marcus switches from hours to minutes, or a teacher adds 5 bonus points to every test? Each variable is transformed by a linear change $X' = aX + b$ and $Y' = cY + d$.
Now the correlation. Because $r = \dfrac{\sigma_{xy}}{\sigma_x \sigma_y}$, in the transformed data the factor $a c$ in the numerator divides by $|a||c|$ in the denominator. So $r$ does not change when $a$ and $c$ are positive, and it only flips sign if exactly one of $a, c$ is negative.
| Transformation | Means | Std. deviations | Covariance | $r$ |
|---|---|---|---|---|
| Add a constant | shifts | same | same | same |
| Multiply by $k > 0$ | $\times k$ | $\times k$ | $\times k$ (for that variable) | same |
It is known that the relationship between heating expenditure ($Y$, in dollars) and the mean outside temperature ($X$, in $^\circ C$) during winter follows a bivariate…
It is known that the relationship between heating expenditure ($Y$, in dollars) and the mean outside temperature ($X$, in $^\circ C$) during winter follows a bivariate distribution with a correlation coefficient of $r = -0,85$. The mean temperature was $8$ $^\circ C$ with a standard deviation of $3$ $^\circ C$, while the mean expenditure was $\$150$ with a variance of $400\,\$^2$.
If for next year a climate change is forecast that will cause all temperatures to rise by $2$ $^\circ C$ and the price of gas to increase so that all expenditures are multiplied by $1,2$:
- a) How will these changes affect the new correlation coefficient? Justify your answer without performing exhaustive calculations.
- b) Calculate the new covariance between temperature and expenditure after applying both transformations.
- c) Find the new regression line of $Y$ on $X$.
The correlation coefficient $r$
How to read it (a rough guide):
-
$r$ close to $1$: strong positive linear relationship.
-
$r$ close to $-1$: strong negative linear relationship.
-
$r$ close to $0$: weak or no linear relationship.
-
$r = \pm 1$ exactly: all points lie on a line.
Match each of the following values of the linear correlation coefficient ($r$) with its corresponding scatter plot, briefly reasoning your answer: $r = 0,95$ $r = -0,80$…
Match each of the following values of the linear correlation coefficient ($r$) with its corresponding scatter plot, briefly reasoning your answer:
-
$r = 0,95$
-
$r = -0,80$
-
$r = 0,05$
A nutritionist studies the relationship between the grams of sugar ($X$) and the kilocalories ($Y$) of five types of energy bars. She has obtained the following marginal…
A nutritionist studies the relationship between the grams of sugar ($X$) and the kilocalories ($Y$) of five types of energy bars. She has obtained the following marginal parameters:
-
Mean sugar: $\bar{x} = 12$ g
-
Mean energy: $\bar{y} = 210$ kcal
-
Standard deviations: $\sigma_x = 3$ g and $\sigma_y = 25$ kcal
-
Covariance: $\sigma_{xy} = 60$
Calculate the linear correlation coefficient ($r$) and interpret whether there is a strong relationship between both variables.
Observe the following scatter plot representing the relationship between the advertising investment of 8 small businesses and their monthly profits (both in thousands of…
Observe the following scatter plot representing the relationship between the advertising investment of 8 small businesses and their monthly profits (both in thousands of dollars).
- a) Justify, without performing calculations, whether the sign of the covariance will be positive or negative.
- b) Choose with reasoning which of the following values could be the Pearson correlation coefficient ($r$): $-0,85$; $0,12$; $0,91$; $1,5$.
- c) What would happen to the value of $r$ if we decided to express the data in dollars instead of thousands of dollars?
Coefficient of determination
Going backwards: if you know $r^2$, then $r = \pm\sqrt{r^2}$, and you choose the sign from the direction of the relationship (the sign of $\sigma_{xy}$ or of the slope).
If the coefficient of determination of a bivariate distribution is $R^2 = 0,81$, calculate the value of the correlation coefficient $r$ (assuming the relationship is…
If the coefficient of determination of a bivariate distribution is $R^2 = 0,81$, calculate the value of the correlation coefficient $r$ (assuming the relationship is direct) and explain what percentage of the variation in variable $Y$ is explained by variable $X$.
In a basketball training session, the distance to the basket in feet ($X$) and the number of baskets scored out of every 10 attempts ($Y$) are recorded for a group of…
In a basketball training session, the distance to the basket in feet ($X$) and the number of baskets scored out of every 10 attempts ($Y$) are recorded for a group of players. The summary data is:
$\bar{x} = 4,5 \text{ ft} \quad \sigma_x = 1,2 \text{ ft}$
$\bar{y} = 6 \text{ baskets} \quad \sigma_y = 1,8 \text{ baskets}$
$\sigma_{xy} = -1,944$
- a) Calculate the Pearson correlation coefficient and interpret its strength and direction.
- b) Calculate the coefficient of determination $r^2$ and explain what percentage of the variation in successful shots is explained by the distance to the basket.
A streaming platform analyzes the relationship between the number of followers of a streamer (variable $X$, in thousands) and the monthly income from subscriptions…
A streaming platform analyzes the relationship between the number of followers of a streamer (variable $X$, in thousands) and the monthly income from subscriptions (variable $Y$, in dollars). The following summary data is known after studying $20$ content creators:
$\sum x_i = 400$
$\sum y_i = 60.000$
$\sum x_i^2 = 12.000$
$\sum y_i^2 = 250.000.000$
$\sum x_i y_i = 1.500.000$
Calculate:
- a) The covariance $s_{xy}$ and the marginal standard deviations $s_x$ and $s_y$.
- b) The linear correlation coefficient. What percentage of the variation in income is explained by the number of followers?
- c) A streamer decides to invest in advertising to increase their follower base from $25.000$ to $35.000$. According to the linear model, by how much is their monthly income estimated to increase?
The two regression lines
The best-fit line lets you predict. There are actually two of them, and which you use depends on what you want to predict.
Going backwards. If you know a slope and a variance, you can recover the covariance: $\sigma_{xy} = m_{yx}\,\sigma_x^2$ (or $m_{xy}\,\sigma_y^2$). Then $r = \dfrac{\sigma_{xy}}{\sigma_x\sigma_y}$.
How reliable is a prediction? It is more trustworthy when $|r|$ is close to $1$ and when $x$ is inside the range of the data. Predicting far outside that range (extrapolation) is risky, because the pattern may not continue.
Back to Marcus: the pattern is strong ($r \approx 0.92$), and about $85\%$ of the variation in his free throws is explained by his practice hours. Each extra hour of practice is associated with about $1.6$ more shots made, and $4.5$ hours predicts about $11$ made.
The relationship between a family's weekly food expenditure ($X$) and their weekly income ($Y$), both in dollars, has been studied. The following data has been obtained:…
The relationship between a family's weekly food expenditure ($X$) and their weekly income ($Y$), both in dollars, has been studied. The following data has been obtained:
$\bar{x} = 180, \quad \sigma_x^2 = 900, \quad \bar{y} = 600, \quad \sigma_y^2 = 2500, \quad \sigma_{xy} = 1200$
- a) Find the equation of the regression line of $Y$ on $X$.
- b) If a family spends $\$250$ on food, what would their estimated income be according to the model?
- c) Is this prediction reliable? Justify your answer by calculating the correlation coefficient.
The relationship between the price of a plane ticket ($X$) and how many days in advance it is bought ($Y$) is analyzed. It is known that the correlation is $r = -0,82$.…
The relationship between the price of a plane ticket ($X$) and how many days in advance it is bought ($Y$) is analyzed. It is known that the correlation is $r = -0,82$.
If the standard deviations are $\sigma_x = 45 \text{ \$}$ and $\sigma_y = 12 \text{ days}$, and the means are $\bar{x} = 150 \text{ \$}$ and $\bar{y} = 25 \text{ days}$:
- a) Calculate the covariance of the distribution.
- b) Calculate the regression line of $X$ on $Y$ to estimate the ticket price based on the days in advance.
- c) What price would be estimated for a ticket bought 40 days in advance?
In a sample of 100 homes, the area in $m^2$ ($X$) and the monthly electricity consumption in $kWh$ ($Y$) are studied. The following information is known: The center of…
In a sample of 100 homes, the area in $m^2$ ($X$) and the monthly electricity consumption in $kWh$ ($Y$) are studied. The following information is known:
-
The center of gravity is $G(90, 350)$.
-
The variance of the area is $400$.
-
The regression line of $Y$ on $X$ is $y = 0,6x + 296$.
- a) What is the value of the covariance $\sigma_{xy}$?
- b) Given that the standard deviation of consumption is $\sigma_y = 15$, calculate the correlation coefficient.
- c) If a home has an area of $120 \text{ m}^2$, calculate the residual (prediction error) if the actual observed consumption was $375 \text{ kWh}$.
Reading $r$ and the mean point from the two lines
Sometimes a problem gives you the two equations and nothing else. You can still get a lot.
A farmer observes that the yield of their orange harvest depends on the hours of sunshine received during the ripening stage. The regression lines obtained from…
A farmer observes that the yield of their orange harvest depends on the hours of sunshine received during the ripening stage. The regression lines obtained from historical data are:
Regression line of $Y$ on $X$: $y = 0,85x + 12$
Regression line of $X$ on $Y$: $x = 0,92y - 4$
- a) Determine the center of gravity $(\bar{x}, \bar{y})$ of the distribution.
- b) Calculate the Pearson correlation coefficient from the slopes of the two regression lines.
In a study on the real estate market in a coastal city, the equations of the two regression lines relating the sale price of apartments, $Y$ (in hundreds of thousands of…
In a study on the real estate market in a coastal city, the equations of the two regression lines relating the sale price of apartments, $Y$ (in hundreds of thousands of dollars), to their area, $X$ (in square feet), have been obtained:
-
Regression line of $Y$ on $X$: $y = 0,012x + 0,5$
-
Regression line of $X$ on $Y$: $x = 65y - 20$
Determine with reasoning:
- a) The center of gravity of the distribution $(\bar{x}, \bar{y})$.
- b) The Pearson linear correlation coefficient, $r$, and interpret its sign and strength.
- c) If an apartment has an area of $120$ $m^2$, what would its estimated price be? Is this estimate reliable? Justify your answer using the coefficient of determination.
Special cases and the angle between the lines
Because both slopes come from the same covariance, a few facts about the lines are worth knowing.
The last fact is the key to a common question. Plotted on the same $xy$-plane, the line of $X$ on $Y$ has slope $\dfrac{1}{m_{xy}} = \dfrac{\sigma_y^2}{\sigma_{xy}}$, not $m_{xy}$. For the lines to be perpendicular you would need $\dfrac{\sigma_{xy}}{\sigma_x^2}\cdot\dfrac{\sigma_y^2}{\sigma_{xy}} = \dfrac{\sigma_y^2}{\sigma_x^2} = -1$, which is impossible since both are positive. The only way out is a horizontal line and a vertical line, which means $\sigma_{xy} = 0$ and $r = 0$.
The angle $\theta$ between two lines with slopes $m_1$ and $m_2$ satisfies
$$\tan\theta = \left|\frac{m_2 - m_1}{1 + m_1 m_2}\right|$$Slide $a$ below. It plays the role of $r$ for standardized data (both spreads equal to 1): the lines are $y = ax$ and $x = ay$, i.e. $y = x/a$.
Given a bivariate distribution, it has been verified that the standard deviations of both variables are equal ($s_x = s_y$). a) Prove algebraically that, in this case,…
Given a bivariate distribution, it has been verified that the standard deviations of both variables are equal ($s_x = s_y$).
- a) Prove algebraically that, in this case, the linear correlation coefficient coincides with the slope of the regression line of $Y$ on $X$.
- b) If the regression line of $Y$ on $X$ is $y = 0,6x + 2$, what is the coefficient of determination?
- c) What would the slope of the regression line of $X$ on $Y$ be under these conditions?
A sociologist studies the relationship between the age of emancipation of young people ($X$) and the per capita income level of their region ($Y$). When plotting the…
A sociologist studies the relationship between the age of emancipation of young people ($X$) and the per capita income level of their region ($Y$). When plotting the scatter plot, they observe that the center of gravity is $G(28, 1400)$. One of the regression lines is $y = -50x + 2800$. Given that the variance of age is $s_x^2 = 9$ and the variance of income is $s_y^2 = 360.000$:
- a) Calculate the covariance $s_{xy}$ and the linear correlation coefficient.
- b) Obtain the equation of the regression line of $X$ on $Y$.
- c) Determine the angle formed by both regression lines. Does this angle alone allow you to claim that the correlation is strong? Justify your answer by comparing it with the value of $r$.
Two variables $X$ and $Y$ have marginal standard deviations $s_x = 4$ and $s_y = 6$. It is known that the two regression lines are perpendicular to each other. a) What…
Two variables $X$ and $Y$ have marginal standard deviations $s_x = 4$ and $s_y = 6$. It is known that the two regression lines are perpendicular to each other.
- a) What is the value of the covariance $s_{xy}$ and the correlation coefficient $r$?
- b) What does this result imply for the predictive capacity of the linear model?
- c) If we added a new point $(x, y)$ to the distribution that coincided exactly with the center of gravity, would the value of the correlation coefficient change? Reason your answer.
Joint frequency tables and grouped data
When many individuals share the same values, the data come as a two-way table of joint frequencies $n_{ij}$: how many individuals have $X = x_i$ and $Y = y_j$.
-
The row totals form the marginal distribution of $X$; the column totals form the marginal distribution of $Y$.
-
Both sets of totals add up to $N$, the grand total. If a number is missing, subtract from the total of its row or column.
-
If the variables are grouped in intervals, use the class midpoints (the midpoint of $[0, 5)$ is $2.5$).
In a language academy, the relationship between the weekly hours of personal study ($X$) and the score on the final exam ($Y$) of a group of students has been observed.…
In a language academy, the relationship between the weekly hours of personal study ($X$) and the score on the final exam ($Y$) of a group of students has been observed. The joint frequency table is as follows, where three values ($a, b, c$) have been lost:
| $X \setminus Y$ | $40$ | $60$ | $80$ | Total $n_i$ |
|---|---|---|---|---|
| $2$ | $4$ | $2$ | $0$ | $a$ |
| $5$ | $1$ | $b$ | $3$ | $10$ |
| $8$ | $0$ | $1$ | $5$ | $c$ |
| Total $n_j$ | $5$ | $9$ | $8$ | $22$ |
- a) Calculate the values of $a, b$ and $c$.
- b) Determine the marginal distribution of the variable $Y$ and calculate its mean and variance.
- c) Calculate the mean exam score ($Y$) conditional on the students studying $5$ hours per week ($X=5$).
A survey has been carried out on the number of books read per year ($X$) and the score on a reading comprehension test ($Y$). The results are grouped in the following…
A survey has been carried out on the number of books read per year ($X$) and the score on a reading comprehension test ($Y$). The results are grouped in the following table:
| $X \setminus Y$ | $[0, 20)$ | $[20, 40)$ | $[40, 60)$ |
|---|---|---|---|
| $[0, 5)$ | $8$ | $2$ | $0$ |
| $[5, 10)$ | $1$ | $12$ | $3$ |
| $[10, 15)$ | $0$ | $4$ | $10$ |
Using the class midpoints for both variables:
- a) Calculate the center of gravity of the distribution.
- b) Calculate the Pearson linear correlation coefficient.
- c) Which of the two variables shows a greater relative dispersion? Use the coefficient of variation to justify your answer.