Linear Correlation Coefficient
Ximena and Diego compare two studies: in one, the covariance between hours of study and grade is 12; in the other, between the weight of shipments and their cost it is 4,800. Which relationship is stronger? The covariance tells you the sign of the relationship, but not its strength, because it depends on the units. The correlation coefficient solves the problem: it is a unitless number that always lies between $-1$ and $1$.
The Pearson correlation coefficient
To calculate $r$ from data, you need means, standard deviations, and the covariance: $\sigma_{xy}=\dfrac{\sum x_iy_i}{N}-\bar x\,\bar y$ and $\sigma_x^2=\dfrac{\sum x_i^2}{N}-\bar x^2$ (same for $y$).
A guide for classifying: $|r|\ge0.8$ strong, between $0.5$ and $0.8$ moderate, less than $0.5$ weak. These are rough guidelines, not exact rules.
In a study on solar panel efficiency, it has been calculated that the covariance between received solar radiation ($X$) and generated energy ($Y$) is…
In a study on solar panel efficiency, it has been calculated that the covariance between received solar radiation ($X$) and generated energy ($Y$) is $\sigma_{xy} = 15.2$. Knowing that the standard deviations are $\sigma_x = 4.0$ and $\sigma_y = 3.9$, calculate Pearson's linear correlation coefficient and interpret the result.
Classify the strength (strong, moderate, or weak/none) and direction (positive or negative) of the linear correlation for each of the following coefficients obtained in…
Classify the strength (strong, moderate, or weak/none) and direction (positive or negative) of the linear correlation for each of the following coefficients obtained in different statistical studies:
- a) $r = 0.98$
- b) $r = -0.12$
- c) $r = -0.85$
- d) $r = 0.55$
Consider the following pairs of statistical variables. State, giving reasons, whether the linear correlation coefficient between them will be positive, negative, or…
Consider the following pairs of statistical variables. State, giving reasons, whether the linear correlation coefficient between them will be positive, negative, or close to zero:
- a) The number of hours an athlete trains per week and their time to run 100 meters.
- b) The amount of rainfall in a month and umbrella sales in that same month.
- c) The last digit of a person's ID number and their height in centimeters.
Observe the three scatter diagrams labelled A, B, and C. Match each of them with the value of the linear correlation coefficient that best describes it, choosing from…
Observe the three scatter diagrams labelled A, B, and C. Match each of them with the value of the linear correlation coefficient that best describes it, choosing from the following values: $r = -0.92$, $r = 0.05$, and $r = 0.95$.
The linear correlation coefficient between advertising expenditure ($X$, in thousands of pesos) and sales revenue ($Y$, in thousands of pesos) of a company is…
The linear correlation coefficient between advertising expenditure ($X$, in thousands of pesos) and sales revenue ($Y$, in thousands of pesos) of a company is $r = 0.88$. If the marginal standard deviations are $\sigma_x = 2.5$ and $\sigma_y = 12.4$, determine the value of the covariance $\sigma_{xy}$.
Reaction time ($X$, in seconds) and the number of errors made ($Y$) in a psychomotor coordination test were measured for 3 individuals, obtaining the following pairs of…
Reaction time ($X$, in seconds) and the number of errors made ($Y$) in a psychomotor coordination test were measured for 3 individuals, obtaining the following pairs of values: $(1, 2)$, $(2, 4)$, and $(3, 5)$. Calculate Pearson's linear correlation coefficient for this small data set.
A logistics company wants to study the relationship between the weight of shipments ($X$, in kg) and the transportation cost ($Y$, in pesos). To do so, it selects a…
A logistics company wants to study the relationship between the weight of shipments ($X$, in kg) and the transportation cost ($Y$, in pesos). To do so, it selects a sample of 5 shipments, obtaining the following data:
-
Weight ($X$): 2, 4, 5, 8, 11
-
Cost ($Y$): 240, 300, 360, 500, 600
Calculate the means, the marginal standard deviations, the covariance, and the linear correlation coefficient. Based on the result, is weight a good linear predictor of transportation cost?
The data from a clinical trial on drug dosage ($X$, in mg) and recovery time ($Y$, in days) for $N=10$ patients are summarised in the following summations:…
The data from a clinical trial on drug dosage ($X$, in mg) and recovery time ($Y$, in days) for $N=10$ patients are summarised in the following summations:
$\sum x_i = 120$, $\sum y_i = 80$, $\sum x_i^2 = 1540$, $\sum y_i^2 = 680$, $\sum x_i y_i = 910$.
Calculate the linear correlation coefficient and interpret the result in the context of the medical problem.
Relationship with the regression lines
Why? With $m_{yx}=\sigma_{xy}/\sigma_x^2$ and $m_{xy}=\sigma_{xy}/\sigma_y^2$, both have the covariance in the numerator, so they share the same sign. Multiplying them gives $\sigma_{xy}^2/(\sigma_x^2\sigma_y^2)=r^2$.
In a bivariate distribution, the gradient of the regression line of $Y$ on $X$ is known to be $m_{yx} = 1.25$ and the gradient of the regression line of $X$ on $Y$ is…
In a bivariate distribution, the gradient of the regression line of $Y$ on $X$ is known to be $m_{yx} = 1.25$ and the gradient of the regression line of $X$ on $Y$ is $m_{xy} = 0.65$. Knowing that the relationship between the variables is positive, calculate the linear correlation coefficient $r$.
In market research, the two linear regression lines relating the price of a product ($X$) and its monthly demand ($Y$) have been obtained. The equations of these lines…
In market research, the two linear regression lines relating the price of a product ($X$) and its monthly demand ($Y$) have been obtained. The equations of these lines are:
Line 1: $y = -1.5x + 120$
Line 2: $x = -0.6y + 75$
Calculate the linear correlation coefficient and state the degree of relationship between price and demand.
Given the regression lines $y = 0.8x + 2.5$ and $x = 1.1y - 1.2$, calculate the linear correlation coefficient $r$. Then, determine the mean of the variable $Y$.
Given the regression lines $y = 0.8x + 2.5$ and $x = 1.1y - 1.2$, calculate the linear correlation coefficient $r$. Then, determine the mean of the variable $Y$.
In an engineering study on the strength of certain polymeric materials, two regression lines were obtained whose implicit equations are $3x - 2y - 8 = 0$ and…
In an engineering study on the strength of certain polymeric materials, two regression lines were obtained whose implicit equations are $3x - 2y - 8 = 0$ and $x - 2y + 4 = 0$.
- a) Identify, giving reasons, which is the regression line of $Y$ on $X$ and which is the regression line of $X$ on $Y$.
- b) Calculate the linear correlation coefficient $r$ between both variables.
r is invariant under changes of scale
This is because adding a constant to a variable does not change its covariance, and multiplying by $a$ multiplies $\sigma_{xy}$ by $a$ and the standard deviation by $|a|$.
In an agronomy study, the linear correlation coefficient between the mean monthly temperature in degrees Celsius ($C$) and crop yield in metric tons ($P$) was calculated…
In an agronomy study, the linear correlation coefficient between the mean monthly temperature in degrees Celsius ($C$) and crop yield in metric tons ($P$) was calculated to be $r = 0.82$. If we decide to express the temperature in degrees Fahrenheit using the formula $F = 1.8C + 32$ and the yield in kilograms using $K = 1000P$, what will be the new correlation coefficient between $F$ and $K$? Justify your answer based on the mathematical properties of this coefficient.
Given two statistical variables $X$ and $Y$, their corresponding standardised variables are defined as $Z_x = \frac{X - \bar{x}}{\sigma_x}$ and…
Given two statistical variables $X$ and $Y$, their corresponding standardised variables are defined as $Z_x = \frac{X - \bar{x}}{\sigma_x}$ and $Z_y = \frac{Y - \bar{y}}{\sigma_y}$. Prove step by step that the covariance between the standardised variables, $\sigma_{z_x z_y}$, is exactly equal to the linear correlation coefficient $r_{xy}$ of the original variables.
Covariance of a linear combination
Sometimes a new variable is built by adding others, such as $W=X+kY$. To study its correlation with $X$, you need its covariance with $X$ and its variance.
Why? The covariance distributes over the sum: $\sigma_{x,x+ky}=\sigma_{x,x}+k\,\sigma_{x,y}$, and the covariance of $X$ with itself is its variance. The variance of $W$ comes from $\sigma_{w,w}$ with the same distribution.
The random variables $X$ and $Y$ have variances $\sigma_x^2 = 16$ and $\sigma_y^2 = 25$, and their linear correlation coefficient is $r_{xy} = 0.4$. A new synthetic…
The random variables $X$ and $Y$ have variances $\sigma_x^2 = 16$ and $\sigma_y^2 = 25$, and their linear correlation coefficient is $r_{xy} = 0.4$. A new synthetic variable $W = X + kY$ is defined, where $k$ is a real constant. Determine the exact value of $k$ so that the variables $X$ and $W$ are uncorrelated (that is, $r_{xw} = 0$).
Note: You may use the linearity property of covariance: $\sigma_{x, x+ky} = \sigma_x^2 + k\sigma_{xy}$.
The limiting case: r = ±1 and zero correlation
Why? All the points lie on a straight line with no scatter: each deviation of $X$ is carried over completely and proportionally to $Y$.
The relationship between two variables $X$ and $Y$ is being studied using three experimental observations: $(0, 2)$, $(3, 8)$, and $(5, k)$. It is known beforehand that…
The relationship between two variables $X$ and $Y$ is being studied using three experimental observations: $(0, 2)$, $(3, 8)$, and $(5, k)$. It is known beforehand that there is a perfect positive linear functional relationship between both variables, that is, the correlation coefficient is $r = 1$. Without needing to calculate the standard deviations, determine the value of the parameter $k$.
Consider a bivariate distribution $(X, Y)$ where the variable $Y$ is obtained from the variable $X$ by means of the affine transformation $Y = -4X + 7$, with $X$ not…
Consider a bivariate distribution $(X, Y)$ where the variable $Y$ is obtained from the variable $X$ by means of the affine transformation $Y = -4X + 7$, with $X$ not constant ($\sigma_x > 0$). Prove analytically, using the algebraic definitions of covariance and standard deviation, that the linear correlation coefficient between $X$ and $Y$ is exactly $-1$.
The following scatter diagram represents the relationship between the temperature of a chemical reactor ($X$, centred at 0) and the reaction yield ($Y$). The recorded…
The following scatter diagram represents the relationship between the temperature of a chemical reactor ($X$, centred at 0) and the reaction yield ($Y$). The recorded points are $(-2, 4)$, $(-1, 1)$, $(0, 0)$, $(1, 1)$, and $(2, 4)$.
- a) Calculate Pearson's linear correlation coefficient for these data.
- b) In light of the mathematical result and the attached diagram, explain carefully why the correlation coefficient takes that value even though an exact functional relationship ($y = x^2$) exists between the variables.
Outliers and their effect on r
An outlier is a point far from the cloud. Since $r$ is calculated using means, variances, and the covariance, a single distant point can change its value a lot, even its sign.
The following scatter diagram shows the relationship between weekly study hours ($X$) and the mark obtained in an exam ($Y$) for a group of students. Visually analyse…
The following scatter diagram shows the relationship between weekly study hours ($X$) and the mark obtained in an exam ($Y$) for a group of students.
Visually analyse the scatter plot and answer, giving reasons:
- a) If we did not take into account the outlier located in the bottom right, what would the linear correlation coefficient be like?
- b) What effect does the inclusion of this outlier have on the value of Pearson's correlation coefficient compared to the previous case?
Linearizing a model with a change of variable
$r$ only measures straight-line alignment. If theory says the relationship is not linear but becomes linear after a change of variable, you transform the data and calculate $r$ with the new variable.
Why? $r$ detects lines. By replacing $V$ with $1/V$, the curve becomes a line and now it makes sense to measure its alignment.
In a thermodynamics experiment, the pressure ($P$) of a gas is measured at different volumes ($V$) while keeping the temperature constant. Physical theory predicts a…
In a thermodynamics experiment, the pressure ($P$) of a gas is measured at different volumes ($V$) while keeping the temperature constant. Physical theory predicts a relationship of the form $P = \frac{k}{V}$. To linearise the model and apply linear regression, a new auxiliary variable $X = \frac{1}{V}$ is defined. The following experimental pairs $(V, P)$ were obtained: $(2; 12.1)$, $(4; 5.9)$, $(5; 4.8)$, $(8; 3.0)$.
Calculate the linear correlation coefficient between $X$ and $P$. Does the result obtained confirm the underlying physical theory?
Coefficient of determination r²
The coefficient of determination of a mathematical model relating the age of a commercial vehicle ($X$, in years) to its market value ($Y$, in pesos) is $R^2 = 0.7225$.…
The coefficient of determination of a mathematical model relating the age of a commercial vehicle ($X$, in years) to its market value ($Y$, in pesos) is $R^2 = 0.7225$. Knowing that as age increases, the value of the vehicle decreases, what is the exact value of the linear correlation coefficient $r$?
A basketball coach analyses the minutes played ($X$) and the points scored ($Y$) by 6 of his players in a match, obtaining the following pairs of data: $(10, 4)$,…
A basketball coach analyses the minutes played ($X$) and the points scored ($Y$) by 6 of his players in a match, obtaining the following pairs of data: $(10, 4)$, $(15, 8)$, $(20, 12)$, $(25, 14)$, $(30, 20)$, $(35, 22)$. Calculate the coefficient of determination $R^2$ and explain what percentage of the variability of points scored is explained linearly by minutes played.
In a bivariate statistical distribution, it is known that the variance of the first variable is $\sigma_x^2 = 25$, the joint covariance is $\sigma_{xy} = 18$, and the…
In a bivariate statistical distribution, it is known that the variance of the first variable is $\sigma_x^2 = 25$, the joint covariance is $\sigma_{xy} = 18$, and the linear correlation coefficient is $r = 0.6$. From these data, determine the exact value of the variance of the second variable, $\sigma_y^2$.
The residual variance (or mean squared error) of the regression of $Y$ on $X$ provides a measure of the scatter of the points around the line of best fit, and can be…
The residual variance (or mean squared error) of the regression of $Y$ on $X$ provides a measure of the scatter of the points around the line of best fit, and can be calculated using the expression $\sigma_e^2 = \sigma_y^2 (1 - r^2)$. In a socioeconomic study, the variance of the dependent variable $Y$ is known to be $36$ and the regression line of $Y$ on $X$ leaves a residual variance of $6.25$. If the gradient of this regression line is known to be negative, find the linear correlation coefficient $r$ and interpret its meaning statistically.
Back to the beginning: Ximena and Diego cannot compare covariances of 12 and 4,800 because they depend on the units; they can compare their coefficients $r$, which have no units and measure the linear strength of each relationship.