Exercises: Bivariate distributions
Classify the following pairs of bivariate statistical variables according to the type of linear correlation (positive, negative or zero) expected between them: The…
Classify the following pairs of bivariate statistical variables according to the type of linear correlation (positive, negative or zero) expected between them:
-
The weight of a vehicle and its fuel consumption per 100 km.
-
The number of hours of direct sunlight and the amount of energy produced by a solar panel.
-
An adult's shoe size and their monthly salary.
-
The continuous usage time of a laptop and the remaining battery percentage.
In an electronics factory, the number of defects found in a batch ($X$) and the production shift ($Y$, where 1 is morning, 2 is afternoon and 3 is night) were measured…
In an electronics factory, the number of defects found in a batch ($X$) and the production shift ($Y$, where 1 is morning, 2 is afternoon and 3 is night) were measured over 50 days. The joint frequency table is as follows:
| $Y \backslash X$ | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| 1 | 5 | 8 | 2 | 0 |
| 2 | 4 | 10 | 5 | 1 |
| 3 | 1 | 4 | 8 | 2 |
Calculate the marginal distribution of the variable $X$ (number of defects) and determine its arithmetic mean.
In an electronics factory, the number of defects found in a batch ($X$) and the production shift ($Y$, where 1 is morning, 2 is afternoon and 3 is night) were measured…
In an electronics factory, the number of defects found in a batch ($X$) and the production shift ($Y$, where 1 is morning, 2 is afternoon and 3 is night) were measured over 50 days. The joint frequency table is as follows:
| $Y \backslash X$ | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| 1 | 5 | 8 | 2 | 0 |
| 2 | 4 | 10 | 5 | 1 |
| 3 | 1 | 4 | 8 | 2 |
Obtain the distribution of the variable $X$ conditional on production having taken place exclusively during the night shift ($Y=3$).
In a study on the performance of 12 servers, the amount of allocated RAM in GB ($X$) and the number of requests processed per second ($Y$) were recorded. Given that…
In a study on the performance of 12 servers, the amount of allocated RAM in GB ($X$) and the number of requests processed per second ($Y$) were recorded. Given that $\sum_{i=1}^{12} x_i y_i = 4500$, the mean RAM is $\bar{x} = 16$ GB and the mean number of requests is $\bar{y} = 22$, calculate the covariance $\sigma_{xy}$.
The covariance between the daily mean temperature in degrees Celsius ($X$) and ice cream sales in hundreds of euros ($Y$) at an ice cream parlour during summer is…
The covariance between the daily mean temperature in degrees Celsius ($X$) and ice cream sales in hundreds of euros ($Y$) at an ice cream parlour during summer is $\sigma_{xy} = 18,5$. If the marginal standard deviations are $\sigma_x = 4,2$ and $\sigma_y = 5,1$, calculate the linear correlation coefficient $r$ and interpret the result.
In an analysis of the relationship between monthly digital marketing spend ($X$, in thousands of euros) and sales revenue ($Y$, in thousands of euros), the two…
In an analysis of the relationship between monthly digital marketing spend ($X$, in thousands of euros) and sales revenue ($Y$, in thousands of euros), the two regression lines have been obtained. The regression line of $Y$ on $X$ is $y = 2,5x + 10$ and the regression line of $X$ on $Y$ is $x = 0,36y - 2$. Determine the mean point (centre of gravity) $(\bar{x}, \bar{y})$ of this bivariate distribution.
The human resources department of a software company has determined that the regression line relating years of experience ($X$) to monthly salary in euros ($Y$) of its…
The human resources department of a software company has determined that the regression line relating years of experience ($X$) to monthly salary in euros ($Y$) of its programmers is $y = 85x + 1200$. Estimate the monthly salary of an employee who has 5 years of experience.
Look at the following scatter diagrams relating different variables in three different experiments. Giving reasons, match each graph to one of the following linear…
Look at the following scatter diagrams relating different variables in three different experiments. Giving reasons, match each graph to one of the following linear correlation coefficients: $r = -0,92$, $r = 0,05$, $r = 0,88$.
At a weather station in Castilla y León, Lucas analyzes the relationship between the daily mean temperature ($X$, in degrees Celsius) and the natural gas consumption of…
At a weather station in Castilla y León, Lucas analyzes the relationship between the daily mean temperature ($X$, in degrees Celsius) and the natural gas consumption of the central heating system ($Y$, in cubic meters) over five winter days. After processing the data, he obtains a covariance $\sigma_{xy} = -14,5\text{ }^\circ\text{C}\cdot\text{m}^3$. To submit the report to an international scientific journal, he decides to convert the temperature to kelvins ($U = X + 273,15$) and the gas volume to liters ($V = 1000Y$). In his draft, Lucas concludes: “Since we add $273,15$ to $X$ and multiply $Y$ by $1000$, the new covariance is $\sigma_{uv} = (-14,5 + 273,15) \cdot 1000 = 258\,650\text{ K}\cdot\text{L}$, so now the relationship between both quantities becomes positive.” Identify and explain the two conceptual errors made by Lucas, justify the geometric and algebraic effects that translations and scale changes have on covariance, and calculate the correct numerical value of $\sigma_{uv}$ with its units.
An educational guidance team at a secondary school has recorded, in a sample of 30 1st-year Bachillerato students, the daily time spent on recreational mobile phone use…
An educational guidance team at a secondary school has recorded, in a sample of 30 1st-year Bachillerato students, the daily time spent on recreational mobile phone use ($X$, in hours) and nighttime sleep hours ($Y$, in hours). After tabulating the individual data, the means $\bar{x} = 3,5\text{ h}$, $\bar{y} = 7,0\text{ h}$ and the covariance $\sigma_{xy} = -1,8\text{ h}^2$ are obtained. To coordinate with a regional youth health study, both variables need to be expressed in minutes ($U = 60X$, $V = 60Y$). To find the new covariance $\sigma_{uv}$, two methods are proposed:
-
Method 1: Multiply each of the 30 original pairs of values $(x_i, y_i)$ by 60, construct a new table with the pairs $(u_i, v_i)$, find the new means $\bar{u}$ and $\bar{v}$, and calculate $\sigma_{uv} = \frac{\sum u_i v_i}{30} - \bar{u}\bar{v}$.
-
Method 2: Apply the algebraic property of invariance/scaling of covariance under linear transformations $\sigma_{uv} = ac\cdot\sigma_{xy}$.
Compare both methods by evaluating computation time and the risk of rounding error propagation, and state with reasoning which one is preferable. Finally, apply the selected method to calculate the exact value of $\sigma_{uv}$ and interpret its sign.
In an agricultural cooperative, the amount of fertiliser applied in kg/ha ($X$) and the crop yield in tonnes/ha ($Y$) were recorded across 5 experimental plots: $X$: 10,…
In an agricultural cooperative, the amount of fertiliser applied in kg/ha ($X$) and the crop yield in tonnes/ha ($Y$) were recorded across 5 experimental plots:
-
$X$: 10, 20, 30, 40, 50
-
$Y$: 2.5, 3.8, 4.2, 5.5, 6.0
Calculate the marginal means, marginal variances and covariance of this bivariate distribution.
In a clinical trial, 100 patients were classified according to their age group ($X$, in years) and their blood cholesterol level ($Y$, in mg/dL), grouped into class…
In a clinical trial, 100 patients were classified according to their age group ($X$, in years) and their blood cholesterol level ($Y$, in mg/dL), grouped into class intervals.
| $X \backslash Y$ | $[150, 180)$ | $[180, 210)$ | $[210, 240)$ |
|---|---|---|---|
| $[30, 40)$ | 15 | 10 | 5 |
| $[40, 50)$ | 5 | 20 | 15 |
| $[50, 60)$ | 2 | 8 | 20 |
Calculate the mean and standard deviation of the cholesterol level exclusively for patients in the age group $[40, 50)$. Use class midpoints for your calculations.
The analysis of macroeconomic data from 20 countries shows that the mean Gross Domestic Product per capita ($X$, in thousands of euros) is $\bar{x} = 25$, with a…
The analysis of macroeconomic data from 20 countries shows that the mean Gross Domestic Product per capita ($X$, in thousands of euros) is $\bar{x} = 25$, with a standard deviation of $\sigma_x = 8$. The mean energy consumption per capita ($Y$, in MWh) is $\bar{y} = 12$, with a standard deviation of $\sigma_y = 4$. If the linear correlation coefficient is $r = 0,85$, determine the equation of the regression line of $Y$ on $X$.
The following scatter diagram shows the relationship between the temperature applied to a metal alloy ($X$, in $^\circ\text{C}$) and its thermal expansion ($Y$, in mm).…
The following scatter diagram shows the relationship between the temperature applied to a metal alloy ($X$, in $^\circ\text{C}$) and its thermal expansion ($Y$, in mm). From the visual representation of the scatter plot and the fitted regression line, estimate the value of the y-intercept and the gradient of the line. Subsequently, predict the expansion for a temperature of $80^\circ\text{C}$.
Let $(X, Y)$ be a two-dimensional distribution with covariance $\sigma_{xy} = 15$ and correlation coefficient $r = 0,6$. If a linear transformation is performed on the…
Let $(X, Y)$ be a two-dimensional distribution with covariance $\sigma_{xy} = 15$ and correlation coefficient $r = 0,6$. If a linear transformation is performed on the variables to adapt them to a new measurement scale, such that $U = 2X - 3$ and $V = -0,5Y + 1$, calculate the new covariance $\sigma_{uv}$ and the new correlation coefficient $r_{uv}$ between $U$ and $V$.
In a survey of 200 university students, the relationship between the number of weekly hours spent playing sports ($X$) and the reported stress level ($Y$, measured from…
In a survey of 200 university students, the relationship between the number of weekly hours spent playing sports ($X$) and the reported stress level ($Y$, measured from 1 to 3) was studied. Some data from the contingency table have been erased:
| $X \backslash Y$ | 1 | 2 | 3 | Total |
|---|---|---|---|---|
| 1 | 20 | 15 | 5 | 40 |
| 2 | 10 | $a$ | 20 | $b$ |
| 3 | 5 | 25 | 40 | 70 |
| Total | 35 | $c$ | 65 | 200 |
Complete the table knowing that $30\%$ of the total respondents spend 2 hours playing sports and have a stress level of 2. Once completed, mathematically justify whether the variables are statistically independent.
An e-commerce platform has modelled the relationship between the number of daily visits to a product page ($X$) and the number of units sold ($Y$) using the regression…
An e-commerce platform has modelled the relationship between the number of daily visits to a product page ($X$) and the number of units sold ($Y$) using the regression line $y = 0,04x + 2,5$. The correlation coefficient is $r = 0,91$ and the range of visits in the studied sample is between 100 and 500.
- a) Estimate the sales if a product receives 350 visits.
- b) Estimate the sales if a product receives 2000 visits.
- c) Discuss the reliability of both predictions based on the data provided.
In a study on the relationship between annual rainfall ($X$, in mm) and wheat yield ($Y$, in tonnes per hectare), it is known that the regression line of $Y$ on $X$ is…
In a study on the relationship between annual rainfall ($X$, in mm) and wheat yield ($Y$, in tonnes per hectare), it is known that the regression line of $Y$ on $X$ is $y = 0,15x - 12$. If the mean rainfall is $\bar{x} = 400$ mm and the correlation coefficient is $r = 0,75$, find the equation of the regression line of $X$ on $Y$.
From AEMET climate records in the same inland region of the peninsula during a clear autumn day, the altitude above sea level ($X$, in hundreds of meters) and the…
From AEMET climate records in the same inland region of the peninsula during a clear autumn day, the altitude above sea level ($X$, in hundreds of meters) and the maximum temperature reached ($Y$, in $^\circ\text{C}$) are recorded across 5 towns:
$A(4; 21)$, $B(6; 19)$, $C(8; 18)$, $D(10; 15)$, and $E(12; 12)$.
-
Before performing any algebraic calculations, estimate with justification the sign that the covariance should have based on the vertical temperature gradient of the troposphere, and reason whether an exact functional dependence or a purely statistical one is to be expected.
-
Calculate the coordinates of the centroid $(\bar{x}, \bar{y})$ of the distribution and the exact covariance $\sigma_{xy}$ by applying the formula $\sigma_{xy} = \frac{1}{N}\sum x_i y_i - \bar{x}\bar{y}$.
-
Check whether the numerical value obtained confirms your previous estimate, and explain the meaning of the sign of the covariance in terms of the simultaneous variation of both variables.
At an extra virgin olive oil packaging plant in Jaén, the relationship between filling time ($X$, in seconds) and the net volume filled ($Y$, in centiliters) is analyzed…
At an extra virgin olive oil packaging plant in Jaén, the relationship between filling time ($X$, in seconds) and the net volume filled ($Y$, in centiliters) is analyzed for $N = 4$ containers selected during quality control. Due to a computer error, two coordinates have been lost, leaving only the pairs $(2; 98)$, $(3; y_2)$, $(x_3; 100)$, and $(7; 102)$. However, the general record preserves two parameters: the centroid is $(\bar{x}, \bar{y}) = (4; 100)$ and the sample covariance is $\sigma_{xy} = 2,5\text{ s}\cdot\text{cl}$.
-
Deduce the missing values $x_3$ and $y_2$ using exclusively the properties of the marginal means.
-
With the complete series of the four points, numerically verify that the covariance matches the figure in the report ($2,5\text{ s}\cdot\text{cl}$).
-
Determine what value the $y$-coordinate of the fourth point should take (replacing $102$ with a new value $y_4$, keeping $x_1, x_2, x_3, x_4$ fixed and readjusting $y_2$ so that the mean $\bar{y} = 100$ is not altered) for the covariance to be exactly equal to $0\text{ s}\cdot\text{cl}$.
In a sociodemographic analysis, the two regression lines relating the birth rate ($X$, per thousand) and life expectancy ($Y$, in years) of a region have been obtained.…
In a sociodemographic analysis, the two regression lines relating the birth rate ($X$, per thousand) and life expectancy ($Y$, in years) of a region have been obtained. The equations of the lines are:
$3x + y - 105 = 0$
$x + 2y - 160 = 0$
Identify, giving reasons, which is the regression line of $Y$ on $X$ and which is that of $X$ on $Y$. Subsequently, calculate the marginal means $\bar{x}$ and $\bar{y}$, and the linear correlation coefficient $r$.
Prove mathematically that if the equations of the regression lines of $Y$ on $X$ and $X$ on $Y$ are expressed in the form $y = mx + n$ and $x = m'y + n'$ respectively,…
Prove mathematically that if the equations of the regression lines of $Y$ on $X$ and $X$ on $Y$ are expressed in the form $y = mx + n$ and $x = m'y + n'$ respectively, then the linear correlation coefficient satisfies $r = \pm \sqrt{m \cdot m'}$. Furthermore, give reasons as to what determines the sign of $r$.
The relationship between the drying time of an industrial paint ($X$, in hours) and its abrasion resistance ($Y$, on an index from 0 to 100) was analysed in 4 trials,…
The relationship between the drying time of an industrial paint ($X$, in hours) and its abrasion resistance ($Y$, on an index from 0 to 100) was analysed in 4 trials, yielding the following pairs of values: $(2, 40)$, $(3, 55)$, $(5, k)$, $(6, 85)$.
If it is known that the marginal mean of the resistance is $\bar{y} = 62,5$, first determine the value of the parameter $k$. Next, calculate the covariance $\sigma_{xy}$ and the gradient of the regression line of $Y$ on $X$.
The growth of a bacterial colony as a function of time ($X$, in hours) does not follow a linear model, but an exponential one of the form $Y = A \cdot e^{BX}$, where $Y$…
The growth of a bacterial colony as a function of time ($X$, in hours) does not follow a linear model, but an exponential one of the form $Y = A \cdot e^{BX}$, where $Y$ is the number of bacteria (in thousands). To apply linear regression techniques, the change of variable $Z = \ln Y$ is performed.
The transformed data $(X, Z)$ yield the following marginal and joint results for 5 observations: $\bar{x} = 4$, $\bar{z} = 2,1$, $\sigma_x^2 = 2,5$, $\sigma_{xz} = 1,2$.
Calculate the values of the parameters $A$ and $B$ of the original exponential model.
The following scatter diagram relates the concentration of a chemical pollutant in a river ($X$, in ppm) to the mortality rate of a fish species ($Y$, in %). Observe the…
The following scatter diagram relates the concentration of a chemical pollutant in a river ($X$, in ppm) to the mortality rate of a fish species ($Y$, in %). Observe the presence of an outlier clearly distinct from the rest of the scatter plot.
Explain, giving reasons, how removing this outlier would affect the covariance $\sigma_{xy}$, the gradient of the regression line of $Y$ on $X$, and the linear correlation coefficient $r$.
For a bivariate statistical distribution $(X, Y)$ of sample size $N = 10$, the following sums are known: $\sum x_i = 50$, $\sum y_i = 70$, $\sum x_i^2 = 286$,…
For a bivariate statistical distribution $(X, Y)$ of sample size $N = 10$, the following sums are known:
$\sum x_i = 50$, $\sum y_i = 70$, $\sum x_i^2 = 286$, $\sum y_i^2 = 540$, $\sum x_i y_i = 385$.
Calculate the coefficient of determination $R^2$ and the residual variance $\sigma_e^2$. Interpret the meaning of both values in the context of the goodness of fit of the linear model.
In a study, the variables $X$ and $Y$ take the values $X \in \{2, 4, 6\}$ and $Y \in \{4, 6, 8\}$. The marginal distributions are identical and uniform (absolute…
In a study, the variables $X$ and $Y$ take the values $X \in \{2, 4, 6\}$ and $Y \in \{4, 6, 8\}$. The marginal distributions are identical and uniform (absolute frequency of 10 for each individual value, with a sample size of $N=30$). Furthermore, it is known that the joint distribution is perfectly symmetric ($f_{ij} = f_{ji}$) and that the joint frequency for $X=2$ and $Y=4$ is 8, for $X=2$ and $Y=6$ is 2, and for $X=4$ and $Y=6$ is 2.
Calculate the remaining joint frequencies in the table and prove that the covariance of this distribution is $\sigma_{xy} = 1,6$.
Consider a bivariate distribution of variables $(X, Y)$ with strictly positive marginal standard deviations ($\sigma_x > 0$ and $\sigma_y > 0$). Prove analytically that…
Consider a bivariate distribution of variables $(X, Y)$ with strictly positive marginal standard deviations ($\sigma_x > 0$ and $\sigma_y > 0$). Prove analytically that if an exact linear functional relationship exists between both variables of the form $Y = aX + b$ (with $a \neq 0$), then the linear correlation coefficient is $r = 1$ if $a > 0$, or $r = -1$ if $a < 0$. (Hint: use the properties of the mean and variance under linear transformations).
A socio-occupational report at a technology park in Asturias analyzes the relationship between years of work experience ($X$) and net monthly salary ($Y$, in hundreds of…
A socio-occupational report at a technology park in Asturias analyzes the relationship between years of work experience ($X$) and net monthly salary ($Y$, in hundreds of euros) in a sample of 6 workers classified into two professional departments:
-
Department A (Support and Operations): composed of employees $A_1(6; 15)$, $A_2(8; 17)$, and $A_3(10; 19)$.
-
Department B (Software Development and Architecture): composed of employees $B_1(1; 26)$, $B_2(3; 28)$, and $B_3(5; 30)$.
-
Analyze each department separately: calculate the centroid and covariance of each subgroup ($\sigma_{xy}^A$ and $\sigma_{xy}^B$). Describe the trend observed within each sector.
-
Model the overall sample by combining the 6 workers into a single two-dimensional distribution. Calculate the overall centroid $(\bar{x}, \bar{y})$ and the joint covariance $\sigma_{xy}$.
-
Contrast the sign of the overall covariance with the signs obtained in each department separately. What is this statistical paradox called? Explain what confounding or lurking variable operates on the dataset and why aggregating heterogeneous subgroups without disaggregating them can completely distort sociological conclusions.
A student makes the following claim: “Since covariance measures the joint trend between two variables, the greater its absolute value, the greater the strength or…
A student makes the following claim: “Since covariance measures the joint trend between two variables, the greater its absolute value, the greater the strength or intensity of their linear dependence; therefore, a distribution with $\sigma_{xy} = 1500$ exhibits a much stronger and more deterministic linear relationship than one with $\sigma_{uv} = 0,02$.” Prove with reasoning that this conclusion is false through the following steps:
-
Consider the distribution $D_1$ formed by the four points $(1; 10)$, $(2; 2)$, $(3; 11)$, and $(4; 3)$. Calculate its centroid, its covariance $\sigma_{xy}$, and justify why its linear dependence is weak. Next, define two scale factors $a$ and $c$ such that, when transforming the variables according to $U = aX$ and $V = cY$, the new covariance $\sigma_{uv}$ exceeds the value of $1\,000\,000$, without the relative arrangement of the scatter plot changing at all.
-
Design with reasoning a distribution $D_2$ formed by four points that satisfy a strict, decreasing linear functional dependence ($y = -0,5x + 10$, such that all points are perfectly aligned), but whose $x$-coordinates are chosen so that their covariance satisfies $|\sigma_{xy}| < 0,02$.
-
From the previous results, justify why covariance does not allow comparing the degree of linear association between different distributions that have different units or scales, arguing what property this parameter lacks to serve as a universal correlation indicator.