Back to homeMathematics · 5th Year HL · Change subject
Start for free
5th Year HL · Mathematics
Statistics · Statistics

Regression line

Aoife and Conor in Fifth Year notice that the more hours their classmates spend on their phones, the lower the battery is by the evening. Can you predict the battery left from the hours of use? You already have the covariance and the correlation coefficient. Now build the tool that predicts: the line of best fit (the regression line). There are two, depending on which variable you want to estimate from the other. In the Leaving Cert you meet the line of best fit by eye, and the calculator gives you the exact one.

The regression line of $Y$ on $X$

Scatter plot with the regression line of Y on X passing through the centre of gravity and minimising the squared residuals. (x̄, ȳ) passes through the centre; minimises the sum of squared residuals
Practice★☆☆Not started
A study on study habits in Year 12 analyses the relationship between the number of weekly hours spent reading, $X$, and the mark obtained in the Spanish exam, $Y$. The…

A study on study habits in Year 12 analyses the relationship between the number of weekly hours spent reading, $X$, and the mark obtained in the Spanish exam, $Y$. The regression line of $Y$ on $X$ is:

$y = 0.65x + 3.2$

  1. a) Justify whether the correlation between both variables is positive or negative.
  2. b) If a student spends $8$ weekly hours reading, what mark is estimated for them in the exam?
Solve
Practice★★☆Not started
A group of 5th Year students has conducted a study on the relationship between the daily time (in hours) spent using a popular short-video social network ($X$) and the…

A group of 5th Year students has conducted a study on the relationship between the daily time (in hours) spent using a popular short-video social network ($X$) and the battery percentage remaining on their mobile at the end of the day ($Y$). The data obtained from 6 classmates are as follows:

Hours of use ($X$) 1.5 2 3 3.5 4 5
% Battery ($Y$) 75 68 50 45 32 20

a) Calculate the centre of gravity of the distribution $(\bar{x}, \bar{y})$.

b) Find the covariance $\sigma_{xy}$ and the linear correlation coefficient $r$. Interpret the result obtained regarding the sign and the strength of the relationship.

c) Determine the equation of the regression line of $Y$ on $X$.

d) If a student uses the social network for 2.5 hours, what battery percentage is estimated to remain? Is this prediction reliable? Justify your answer based on the coefficient of determination $r^2$.

1 2 3 4 5 6 20 40 60 80 100 Hours of use (X) % Battery (Y) 2.5 ? (x̄, ȳ) Actual data Regression Prediction
Solve
Practice★★★Not started
In a study on the performance of a new cryptocurrency, the variables $X$ (advertising expenditure in thousands of euros) and $Y$ (daily transaction volume in millions of…

In a study on the performance of a new cryptocurrency, the variables $X$ (advertising expenditure in thousands of euros) and $Y$ (daily transaction volume in millions of euros) have been analysed. After processing the data, the equations of the two regression lines have been obtained:

  • Regression line of $Y$ on $X$: $y = 0.85x + 1.24$

  • Regression line of $X$ on $Y$: $x = 0.92y - 0.15$

Determine with reasoning:

  1. The centre of gravity of the distribution $(\bar{x}, \bar{y})$.

  2. Pearson's linear correlation coefficient ($r$).

  3. If an advertising expenditure of $15\,000$ € is intended, what would be the expected transaction volume? Justify the reliability of this prediction based on the coefficient of determination.

2 4 6 8 10 12 2 4 6 8 x̄ ȳ G(x̄, ȳ) y = 0.85x + 1.24 Y on X x = 0.92y - 0.15 X on Y Advertising expenditure (X) Transaction volume (Y)
Solve

The regression line of $X$ on $Y$

The two regression lines, of Y on X and of X on Y, both with a slope of the same sign and crossing at the centre of gravity. Y on X X on Y (x̄, ȳ)
Practice★★☆Not started
In a study on sleep habits and academic performance, the following regression lines were obtained for the variables $X$ (daily hours of sleep) and $Y$ (average term…

In a study on sleep habits and academic performance, the following regression lines were obtained for the variables $X$ (daily hours of sleep) and $Y$ (average term mark):

Regression line of $Y$ on $X$: $y = 0.65x + 3.2$

Regression line of $X$ on $Y$: $x = 1.15y - 0.45$

a) Knowing that both lines intersect at the centre of gravity of the distribution, calculate the mean hours of sleep ($\bar{x}$) and the students' average mark ($\bar{y}$).

b) Calculate the linear correlation coefficient $r$ from the gradients of both lines.

c) State with reasoning whether the correlation is positive or negative and whether it is strong or weak.

X (Hours of sleep) Y (Average mark) 0 5 10 15 20 5 10 15 y = 0.65x + 3.2 x = 1.15y - 0.45 G(x̄, ȳ) x̄ ȳ
Solve
Practice★★★Not started
The grades of 50 students in Economics ($X$) and Geography ($Y$) have a mean of 6.5 in both subjects. The variance in Economics is 4 and in Geography it is 2,25. It is…

The grades of 50 students in Economics ($X$) and Geography ($Y$) have a mean of 6.5 in both subjects. The variance in Economics is 4 and in Geography it is 2,25. It is known that the correlation coefficient is $r = 0.8$.

  1. a) If a student has obtained a 4 in Economics, estimate their grade in Geography.
  1. b) If another student has obtained a 9 in Geography, estimate their grade in Economics using the appropriate regression line.
  1. c) Compare both estimates and explain why the same line cannot be used for both cases if we want to minimize the mean squared error.
Solve

The residual: the error of a prediction

Diagram of the residual as the vertical distance between an observed data point and its corresponding predicted value on the line. actual data point yᵢ predicted ŷᵢ residual = vertical distance, data point to line
Practice★☆☆Not started
The charging time of a mobile phone battery ($X$, in minutes) and the percentage of charge reached ($Y$, in %) have been measured. The results are shown in the following…

The charging time of a mobile phone battery ($X$, in minutes) and the percentage of charge reached ($Y$, in %) have been measured. The results are shown in the following graph:

10 20 30 40 50 60 20 40 60 80 100 0 X (min) Y (%)

If the equation of the orange line is $y = 1.5x + 5$:

  1. a) Estimate the percentage of charge after $60$ minutes.
  2. b) Is it a functional or statistical relationship? Justify your answer by observing the position of the points relative to the line.
Solve
Practice★★☆Not started
An athletics coach analyses the relationship between the height of his athletes in cm ($X$) and their stride length in cm ($Y$). The data for 5 athletes are: (160, 110),…

An athletics coach analyses the relationship between the height of his athletes in cm ($X$) and their stride length in cm ($Y$). The data for 5 athletes are: (160, 110), (170, 120), (175, 125), (180, 132) and (190, 145).

a) Obtain the regression line of $Y$ on $X$.

b) What stride length would be expected for an athlete who is 185 cm tall?

c) Calculate the prediction error (residual) for the athlete who is 180 cm tall. The error is defined as the difference between the actual value and the value estimated by the line: $e = y_i - \hat{y}_i$.

d) If the correlation coefficient were $r = 0.98$, what could you state about the reliability of the coach's predictions?

Solve
Practice★★★Not started
In a contingency table relating level of education ($X$) and income ($Y$) for a sample, some data have been lost. We know the following parameters: $\bar{x} = 3$;…

In a contingency table relating level of education ($X$) and income ($Y$) for a sample, some data have been lost. We know the following parameters:

$\bar{x} = 3$; $\bar{y} = 2\,400$; $s_x^2 = 1.2$; $s_y^2 = 160\,000$ and the regression line of $Y$ on $X$ is $y = 300x + 1\,500$.

  1. Calculate the coefficient of determination $R^2$ and interpret the percentage of the variance in income that is explained by the level of education.

  2. If an individual has an education level of $X=5$ and their actual income is $3\,200$ €, calculate the prediction error (residual) made by the line.

1 2 3 4 5 6 1500 2000 2500 3000 3500 Level of education (X) Income (Y) y = 300x + 1500 Residual = 200 Centre of gravity (3, 2400) Prediction (5, 3000) Actual value (5, 3200)
Solve

Predicting with caution: interpolating and extrapolating

Regression line with a scatter plot illustrating an interpolation within the observed data range and an extrapolation outside it. observed data extrapolate (outside the range) within the range: reliable outside: not guaranteed
Practice★☆☆Not started
A courier company knows that the cost of a shipment, $Y$ (in euros), depends on the weight of the parcel, $X$ (in kg), according to the regression line $y = 2.5x + 5$.…

A courier company knows that the cost of a shipment, $Y$ (in euros), depends on the weight of the parcel, $X$ (in kg), according to the regression line $y = 2.5x + 5$.

If the correlation coefficient is $r = 0.98$, which of the following statements is correct?

  1. For every kilogram increase in weight, the cost increases by exactly $2.5$ euros.

  2. Predictions made for parcels of a similar weight to those studied will be very reliable.

  3. If a parcel weighs $0$ kg, the cost will necessarily be $0$ euros.

  4. The relationship between weight and cost is inverse.

Solve
Practice★★☆Not started
A pet adoption centre wants to predict the time it takes for a dog to be adopted ($Y$, in days) based on its age ($X$, in years). They have collected data from 10 dogs…

A pet adoption centre wants to predict the time it takes for a dog to be adopted ($Y$, in days) based on its age ($X$, in years). They have collected data from 10 dogs and obtained a correlation of $r = 0.85$. The mean age is 4 years and the mean number of days until adoption is 25 days. The standard deviation of age is 2 years and that of the days is 10 days.

a) Find the equation of the regression line.

b) Estimate how long it will take for a 0.5-year-old puppy to be adopted.

c) Estimate how long it will take for a 12-year-old senior dog.

d) Of the two previous estimates, indicate which is more reliable and why, taking into account the range of the original data (ages between 1 and 8 years).

Solve
Practice★★★Not started
Given the following scatter plot of 12 cars for the variables $X$ (age of a car in years) and $Y$ (market value in thousands of euros), the regression line of $Y$ on…

Given the following scatter plot of 12 cars for the variables $X$ (age of a car in years) and $Y$ (market value in thousands of euros), the regression line of $Y$ on $X$, calculated with all 12 points, has been drawn; its equation is $y = -0.88x + 14.59$. Note that there is an outlier at the coordinates $(1, 2)$.

Scatter plot of 12 points of car age and value, with an outlier at (1, 2) and the decreasing regression line y = −0,88x + 14,59 Age X (years) Value Y (thousand €) 0 2 4 6 8 10 12 14 16 5 10 15 20 y = −0.88x + 14.59 Outlier (1, 2)
  1. a) If we remove that point from the data set, what would you expect to happen to the absolute value of the correlation coefficient? And to the slope of the regression line? Justify your answer.
  1. b) Using the given regression line, $y = -0.88x + 14.59$, calculate the estimated value for a 10-year-old car and discuss whether it is appropriate to use this model for cars older than 15 years.
Solve

Lab: comparing a line and a parabola with a spreadsheet

A Galway sports club is studying the cost of an advertising campaign. These data are simulated for practice: t is the number of batches of adverts and s is the total cost, in hundreds of euros.

t 0 1 2 3 4
s 0.9 2.2 5.0 9.8 17.1

Before calculating, plot the points and make a prediction: does the cost of each additional batch seem constant or increasing?

  1. Write t in A1 and s in B1; place the five pairs in A2:B6. Create an XY scatter plot, not a chart that treats the quantities as category labels.

  2. Obtain a linear fit and a degree-2 polynomial fit using your spreadsheet's fitting/trendline tool. Display the equations and keep enough decimal places. Compare the coefficients with the calculation below.

  3. In C2 write =-1+4*A2 (linear prediction) and in D2 =1+A2^2 (quadratic); fill down to row 6. In E2 write =B2-C2 and in F2 =B2-D2: these are the residuals, observed minus predicted.

  4. In G2 write =E2^2, in H2 =F2^2 and in I2 =(B2-7)^2; fill down. Here 7 is the mean of the five costs. Add up each column; for example, =G2+G3+G4+G5+G6 avoids depending on the language of the functions.

The curvature can be seen by plotting the data together with both models:

Scatter plot of cost with a visual comparison between the linear fit and the parabolic fit. 04 batches 016Cost (hundreds of €) lineparabola

The scatter plot and the residuals favour the parabola over this interval. At $t=2.5$, it predicts $7.25$ hundred euros; this is interpolation. At $t=10$, it predicts $101$ hundred euros, but this is a distant extrapolation: neither the fit nor its $R^2$ guarantees that the cost structure will hold. Compare with a new data point before using the model to make decisions.

Interpolating a parabola through three points forces it to pass through them; a regression with more data minimises the residuals and, in general, does not pass through all of them. They are not the same procedure.

Summary

See all the exercises in this section