![Page 1: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/1.jpg)
House Keeping
Tutorials at the usual times this week but note some venuechanges!
Tues 10-11 Bedson Teaching Centre 1.48Tues 11-12 Herschel LT2 (ground)Tues 2-3 Herschel TR2 (level 4)Thurs 10-11 Herschel TR1 (level 4)Thurs 11-12 Herschel TR3 (level 4)
Assignment 2 available from Wednesday (at the latest) –deadline Friday 2nd May
This week’s work will help with the last question!
This week’s exercise sheet contains a prize question!
![Page 2: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/2.jpg)
CBA 5
CBA 5 goes live this week in assessed mode (will test you onchapters 4 and 5)
The is a glitch in question 3 when working out the expectedfrequencies for ‘Mathematics’
This has now been fixed!
For those people who have already completed the CBA inassessed mode, the marks will be adjusted!
![Page 3: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/3.jpg)
Lecture 8
CORRELATIONAND
LINEAR REGRESSION
![Page 4: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/4.jpg)
Introduction
In this lecture we look at relationships between pairs ofcontinuous variables. These might be
![Page 5: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/5.jpg)
Introduction
In this lecture we look at relationships between pairs ofcontinuous variables. These might be
height and weight
![Page 6: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/6.jpg)
Introduction
In this lecture we look at relationships between pairs ofcontinuous variables. These might be
height and weight
market value and number of transactions
![Page 7: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/7.jpg)
Introduction
In this lecture we look at relationships between pairs ofcontinuous variables. These might be
height and weight
market value and number of transactions
temperatures and sales of ice cream
![Page 8: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/8.jpg)
Introduction
In this lecture we look at relationships between pairs ofcontinuous variables. These might be
height and weight
market value and number of transactions
temperatures and sales of ice cream
We can examine the relationship between our two variablesthrough a scatter diagram (plot one against the other).
![Page 9: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/9.jpg)
Introduction
In this lecture we look at relationships between pairs ofcontinuous variables. These might be
height and weight
market value and number of transactions
temperatures and sales of ice cream
We can examine the relationship between our two variablesthrough a scatter diagram (plot one against the other).
Today we will look at how to examine such relationships moreformally.
![Page 10: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/10.jpg)
Example: ice cream sales
The following data are monthly ice cream sales at Luigi Minchella’sice cream parlour.
![Page 11: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/11.jpg)
Month Average Temp (oC) Sales (£000’s)
January 4 73February 4 57March 7 81April 8 94May 12 110June 15 124July 16 134
August 17 139September 14 124October 11 103November 7 81December 5 80
![Page 12: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/12.jpg)
Month Average Temp (oC) Sales (£000’s)
January 4 73February 4 57March 7 81April 8 94May 12 110June 15 124July 16 134
August 17 139September 14 124October 11 103November 7 81December 5 80
Is there any relationship between temperature and sales?
![Page 13: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/13.jpg)
Month Average Temp (oC) Sales (£000’s)
January 4 73February 4 57March 7 81April 8 94May 12 110June 15 124July 16 134
August 17 139September 14 124October 11 103November 7 81December 5 80
Is there any relationship between temperature and sales?
Can you DESCRIBE this relationship?
![Page 14: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/14.jpg)
![Page 15: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/15.jpg)
The scatter plot goes “uphill”, so we say there is a positiverelationship between temperature and ice cream sales.
![Page 16: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/16.jpg)
The scatter plot goes “uphill”, so we say there is a positiverelationship between temperature and ice cream sales.
As temperatures rise, so do ice cream sales!
![Page 17: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/17.jpg)
The scatter plot goes “uphill”, so we say there is a positiverelationship between temperature and ice cream sales.
As temperatures rise, so do ice cream sales!
If the scatter plot had shown a “downhill” slope, we wouldhave a negative relationship.
![Page 18: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/18.jpg)
The scatter plot goes “uphill”, so we say there is a positiverelationship between temperature and ice cream sales.
As temperatures rise, so do ice cream sales!
If the scatter plot had shown a “downhill” slope, we wouldhave a negative relationship.
We could draw a straight line through the middle of most ofthe points. Thus, there is also a linear association present.
![Page 19: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/19.jpg)
The scatter plot goes “uphill”, so we say there is a positiverelationship between temperature and ice cream sales.
As temperatures rise, so do ice cream sales!
If the scatter plot had shown a “downhill” slope, we wouldhave a negative relationship.
We could draw a straight line through the middle of most ofthe points. Thus, there is also a linear association present.
If we were to draw a line through the points, most pointswould lie close to this line. The closer the points lie to a line,the stronger the relationship.
![Page 20: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/20.jpg)
Correlation
We now look at how to quantify the relationship between twovariables by calculating the sample correlation coefficient. Thisis
![Page 21: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/21.jpg)
Correlation
We now look at how to quantify the relationship between twovariables by calculating the sample correlation coefficient. Thisis
r =SXY√
SXX × SYY,
where
![Page 22: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/22.jpg)
Correlation
We now look at how to quantify the relationship between twovariables by calculating the sample correlation coefficient. Thisis
r =SXY√
SXX × SYY,
where
SXY =(
∑
xy)
− nx y ,
![Page 23: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/23.jpg)
Correlation
We now look at how to quantify the relationship between twovariables by calculating the sample correlation coefficient. Thisis
r =SXY√
SXX × SYY,
where
SXY =(
∑
xy)
− nx y ,
SXX =(
∑
x2)
− nx2,
![Page 24: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/24.jpg)
Correlation
We now look at how to quantify the relationship between twovariables by calculating the sample correlation coefficient. Thisis
r =SXY√
SXX × SYY,
where
SXY =(
∑
xy)
− nx y ,
SXX =(
∑
x2)
− nx2,
SYY =(
∑
y2)
− ny2.
![Page 25: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/25.jpg)
r always lies between –1 and +1.
![Page 26: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/26.jpg)
r always lies between –1 and +1.
If r is close to +1, we have evidence of a strong positive(linear) association.
![Page 27: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/27.jpg)
r always lies between –1 and +1.
If r is close to +1, we have evidence of a strong positive(linear) association.
If r is close to –1, we have evidence of a strong negative(linear) association.
![Page 28: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/28.jpg)
r always lies between –1 and +1.
If r is close to +1, we have evidence of a strong positive(linear) association.
If r is close to –1, we have evidence of a strong negative(linear) association.
If r is close to zero, there is probably no association!
![Page 29: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/29.jpg)
r always lies between –1 and +1.
If r is close to +1, we have evidence of a strong positive(linear) association.
If r is close to –1, we have evidence of a strong negative(linear) association.
If r is close to zero, there is probably no association!
A correlation coefficient close to zero does not imply norelationship at all, just no linear relationship.
![Page 30: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/30.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
![Page 31: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/31.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
x y x2 y2 xy
4 73
![Page 32: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/32.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
x y x2 y2 xy
4 73 16
![Page 33: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/33.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
x y x2 y2 xy
4 73 16 5329
![Page 34: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/34.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
x y x2 y2 xy
4 73 16 5329 2924 57
![Page 35: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/35.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
x y x2 y2 xy
4 73 16 5329 2924 57 16
![Page 36: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/36.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
x y x2 y2 xy
4 73 16 5329 2924 57 16 3249
![Page 37: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/37.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
x y x2 y2 xy
4 73 16 5329 2924 57 16 3249 228
![Page 38: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/38.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
x y x2 y2 xy
4 73 16 5329 2924 57 16 3249 2287 81 49 6561 567
![Page 39: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/39.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
x y x2 y2 xy
4 73 16 5329 2924 57 16 3249 2287 81 49 6561 5678 94 64 8836 752
![Page 40: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/40.jpg)
Example: ice cream sales
The easiest way to calculate r is to draw up a table!
x y x2 y2 xy
4 73 16 5329 2924 57 16 3249 2287 81 49 6561 5678 94 64 8836 75212 110 144 12100 132015 124 225 15376 186016 134 256 17956 214417 139 289 19321 236314 124 196 15376 173611 103 121 10609 11337 81 49 6561 5675 80 25 6400 400
120 1200 1450 127674 13362
![Page 41: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/41.jpg)
Notice in the formulae for SXY , SXX and SYY we need the samplemeans x and y . Thus,
![Page 42: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/42.jpg)
Notice in the formulae for SXY , SXX and SYY we need the samplemeans x and y . Thus,
x =120
12
= 10 and
![Page 43: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/43.jpg)
Notice in the formulae for SXY , SXX and SYY we need the samplemeans x and y . Thus,
x =120
12
= 10 and
y =1200
12
= 100.
![Page 44: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/44.jpg)
Similarly,
![Page 45: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/45.jpg)
Similarly,
SXY =(
∑
xy)
− nx y
= 13362− 12× 10× 100
= 1362,
![Page 46: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/46.jpg)
Similarly,
SXY =(
∑
xy)
− nx y
= 13362− 12× 10× 100
= 1362,
SXX =(
∑
x2)
− nx2
= 1450− 12× 10× 10
= 250 and
![Page 47: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/47.jpg)
Similarly,
SXY =(
∑
xy)
− nx y
= 13362− 12× 10× 100
= 1362,
SXX =(
∑
x2)
− nx2
= 1450− 12× 10× 10
= 250 and
SYY =(
∑
y2)
− ny2
= 127674− 12× 100× 100
= 7674.
![Page 48: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/48.jpg)
Thus,
![Page 49: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/49.jpg)
Thus,
r =SXY√
SXX × SYY
![Page 50: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/50.jpg)
Thus,
r =SXY√
SXX × SYY
=1362
√250× 7674
![Page 51: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/51.jpg)
Thus,
r =SXY√
SXX × SYY
=1362
√250× 7674
= 0.983 (to 3 decimal places).
![Page 52: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/52.jpg)
A few points to remember...
![Page 53: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/53.jpg)
A few points to remember...
If your calculated correlation coefficient does not lie between−1 and +1, you’ve done something wrong!
![Page 54: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/54.jpg)
A few points to remember...
If your calculated correlation coefficient does not lie between−1 and +1, you’ve done something wrong!
Check that your correlation coefficient agrees with your plot
![Page 55: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/55.jpg)
A few points to remember...
If your calculated correlation coefficient does not lie between−1 and +1, you’ve done something wrong!
Check that your correlation coefficient agrees with your plot
an “uphill” slope ties in with a positive correlation coefficient;
![Page 56: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/56.jpg)
A few points to remember...
If your calculated correlation coefficient does not lie between−1 and +1, you’ve done something wrong!
Check that your correlation coefficient agrees with your plot
an “uphill” slope ties in with a positive correlation coefficient;a “downhill” slope ties in with a negative correlationcoefficient;
![Page 57: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/57.jpg)
A few points to remember...
If your calculated correlation coefficient does not lie between−1 and +1, you’ve done something wrong!
Check that your correlation coefficient agrees with your plot
an “uphill” slope ties in with a positive correlation coefficient;a “downhill” slope ties in with a negative correlationcoefficient;a random scattering of points indicates a correlationcoefficient close to zero;
![Page 58: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/58.jpg)
A few points to remember...
If your calculated correlation coefficient does not lie between−1 and +1, you’ve done something wrong!
Check that your correlation coefficient agrees with your plot
an “uphill” slope ties in with a positive correlation coefficient;a “downhill” slope ties in with a negative correlationcoefficient;a random scattering of points indicates a correlationcoefficient close to zero;the closer the points lie to a straight line (either “uphill” or
“downhill”), the closer to either +1 or −1 the correlationcoefficient will be!
![Page 59: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/59.jpg)
Simple linear regression
A correlation analysis helps to establish whether or not there is alinear relationship between two variables. However, it doesn’t allowus to use this linear relationship.
![Page 60: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/60.jpg)
Simple linear regression
A correlation analysis helps to establish whether or not there is alinear relationship between two variables. However, it doesn’t allowus to use this linear relationship.
Regression analysis allows us to use the linear relationshipbetween two variables. For example, with a regression analysis, wecan predict the value of one variable given the value of another.
![Page 61: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/61.jpg)
Simple linear regression
A correlation analysis helps to establish whether or not there is alinear relationship between two variables. However, it doesn’t allowus to use this linear relationship.
Regression analysis allows us to use the linear relationshipbetween two variables. For example, with a regression analysis, wecan predict the value of one variable given the value of another.
To perform a regression analysis, we must assume that
![Page 62: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/62.jpg)
Simple linear regression
A correlation analysis helps to establish whether or not there is alinear relationship between two variables. However, it doesn’t allowus to use this linear relationship.
Regression analysis allows us to use the linear relationshipbetween two variables. For example, with a regression analysis, wecan predict the value of one variable given the value of another.
To perform a regression analysis, we must assume that
the scatter plot of the two variables (roughly) shows astraight line, and
![Page 63: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/63.jpg)
Simple linear regression
A correlation analysis helps to establish whether or not there is alinear relationship between two variables. However, it doesn’t allowus to use this linear relationship.
Regression analysis allows us to use the linear relationshipbetween two variables. For example, with a regression analysis, wecan predict the value of one variable given the value of another.
To perform a regression analysis, we must assume that
the scatter plot of the two variables (roughly) shows astraight line, and
the spread in the Y –direction is roughly constant with X .
![Page 64: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/64.jpg)
![Page 65: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/65.jpg)
Look at the scatter plot of ice cream sales against temperature.
![Page 66: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/66.jpg)
Look at the scatter plot of ice cream sales against temperature.
A “line of best fit” can be drawn through the data;
![Page 67: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/67.jpg)
Look at the scatter plot of ice cream sales against temperature.
A “line of best fit” can be drawn through the data;
This line could then be used to make predictions of icecream sales based on temperature.
![Page 68: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/68.jpg)
Look at the scatter plot of ice cream sales against temperature.
A “line of best fit” can be drawn through the data;
This line could then be used to make predictions of icecream sales based on temperature.
However, everyone’s line is bound to be slightly different!
![Page 69: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/69.jpg)
Look at the scatter plot of ice cream sales against temperature.
A “line of best fit” can be drawn through the data;
This line could then be used to make predictions of icecream sales based on temperature.
However, everyone’s line is bound to be slightly different!
And so everyone’s predictions will be slightly different!
![Page 70: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/70.jpg)
Look at the scatter plot of ice cream sales against temperature.
A “line of best fit” can be drawn through the data;
This line could then be used to make predictions of icecream sales based on temperature.
However, everyone’s line is bound to be slightly different!
And so everyone’s predictions will be slightly different!
The aim of regression analysis is to find the “best” line whichgoes through the data.
![Page 71: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/71.jpg)
Look at the scatter plot of ice cream sales against temperature.
A “line of best fit” can be drawn through the data;
This line could then be used to make predictions of icecream sales based on temperature.
However, everyone’s line is bound to be slightly different!
And so everyone’s predictions will be slightly different!
The aim of regression analysis is to find the “best” line whichgoes through the data.
At this point, we should remind ourselves about the equationfor a straight line and how to draw it!
![Page 72: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/72.jpg)
The regression equation
![Page 73: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/73.jpg)
The regression equation
The simple linear regression model is given by
Y = α+ βx + ǫ,
where
![Page 74: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/74.jpg)
The regression equation
The simple linear regression model is given by
Y = α+ βx + ǫ,
where
Y is the response variable and
![Page 75: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/75.jpg)
The regression equation
The simple linear regression model is given by
Y = α+ βx + ǫ,
where
Y is the response variable and
X is the explanatory variable.
![Page 76: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/76.jpg)
The regression equation
The simple linear regression model is given by
Y = α+ βx + ǫ,
where
Y is the response variable and
X is the explanatory variable.
ǫ is the random error taken to be zero on average, withconstant variance.
![Page 77: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/77.jpg)
The regression equation
The simple linear regression model is given by
Y = α+ βx + ǫ,
where
Y is the response variable and
X is the explanatory variable.
ǫ is the random error taken to be zero on average, withconstant variance.
α represents the intercept of the regression line (the pointwhere the line “cuts” the Y –axis),
![Page 78: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/78.jpg)
The regression equation
The simple linear regression model is given by
Y = α+ βx + ǫ,
where
Y is the response variable and
X is the explanatory variable.
ǫ is the random error taken to be zero on average, withconstant variance.
α represents the intercept of the regression line (the pointwhere the line “cuts” the Y –axis),
β represents the slope of the regression line (i.e. how steepthe line is), and
![Page 79: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/79.jpg)
The regression equation
The simple linear regression model is given by
Y = α+ βx + ǫ,
where
Y is the response variable and
X is the explanatory variable.
ǫ is the random error taken to be zero on average, withconstant variance.
α represents the intercept of the regression line (the pointwhere the line “cuts” the Y –axis),
β represents the slope of the regression line (i.e. how steepthe line is), and
We need to estimate α and β from our sample data. But how?
![Page 80: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/80.jpg)
Remember, the aim of regression analysis is to find a linewhich goes through the middle of the data in the scatter plot,closer to the points than any other line;
![Page 81: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/81.jpg)
Remember, the aim of regression analysis is to find a linewhich goes through the middle of the data in the scatter plot,closer to the points than any other line;
So the “best” line will minimise any gaps between the line andthe data!
![Page 82: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/82.jpg)
Remember, the aim of regression analysis is to find a linewhich goes through the middle of the data in the scatter plot,closer to the points than any other line;
So the “best” line will minimise any gaps between the line andthe data!
It turns out that the values of α and β which give this bestline are
β =SXY
SXXand
![Page 83: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/83.jpg)
Remember, the aim of regression analysis is to find a linewhich goes through the middle of the data in the scatter plot,closer to the points than any other line;
So the “best” line will minimise any gaps between the line andthe data!
It turns out that the values of α and β which give this bestline are
β =SXY
SXXand
α = y − βx .
![Page 84: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/84.jpg)
Example: ice cream sales
For the ice cream sales data, we can find the “best” line using theformulae on the previous slide! Thus
![Page 85: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/85.jpg)
Example: ice cream sales
For the ice cream sales data, we can find the “best” line using theformulae on the previous slide! Thus
β =SXY
SXX
=1362
250
= 5.448,
and
![Page 86: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/86.jpg)
Example: ice cream sales
For the ice cream sales data, we can find the “best” line using theformulae on the previous slide! Thus
β =SXY
SXX
=1362
250
= 5.448,
and
α = y − βx
= 100− 5.448× 10
= 45.52.
![Page 87: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/87.jpg)
Thus, the regression equation is
![Page 88: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/88.jpg)
Thus, the regression equation is
y = 45.52 + 5.448x
![Page 89: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/89.jpg)
![Page 90: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/90.jpg)
Making predictions
We can use our estimated regression equation to make predictionsof ice cream sales based on average temperature.
![Page 91: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/91.jpg)
For example: Predict monthly sales if the average temperature is10oC.
![Page 92: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/92.jpg)
For example: Predict monthly sales if the average temperature is10oC.
We can use take a reading from our graph, or, more accurately, useour regression equation!
y = 45.52 + 5.448x i.e.
= 45.52 + 5.448× 10
= 45.52 + 54.48
= 100,
![Page 93: HouseKeeping - Newcastle Universitynag48/teaching/MAS1403/slides7slr.pdf · 14 124 196 15376 1736 11 103 121 10609 1133 7 81 49 6561 567 5 80 25 6400 400 120 1200 1450 127674 13362](https://reader035.vdocuments.us/reader035/viewer/2022081409/607d04b7e14823701464cf75/html5/thumbnails/93.jpg)
For example: Predict monthly sales if the average temperature is10oC.
We can use take a reading from our graph, or, more accurately, useour regression equation!
y = 45.52 + 5.448x i.e.
= 45.52 + 5.448× 10
= 45.52 + 54.48
= 100,
i.e. if the average temperature is 10oC, we can expect sales of£100,000.