Professional Documents
Culture Documents
CO 4 Session 34 Linear Regression and Its Applications
CO 4 Session 34 Linear Regression and Its Applications
CO 4 Session 34 Linear Regression and Its Applications
20MT1101
I/IV B. Tech. Semester-1
A.Y. 2021-2022
19/11/2022 MFC 1
Session 34
19/11/2022 MFC 2
Regression
Definition: Regression is the measure of the average relationship between
two or more variables in terms of original units of data.
19/11/2022 MFC 3
Lines of regression:
• When the dots of the scatter diagram tend to cluster along a well-defined
direction, it suggests a linear relationship between the two variables x and
y. Such a line of best-fit for the given distribution of dots is called the line
of regression.
• If the curve is a straight line, it is called the line of regression and the
regression is a linear regression.
• We shall have two regression lines as the regression of X on Y and the
regression of Y on X.
• The Regression line of Y on X gives the most probable values of Y for given
value of X.
• The Regression line of X on Y gives the most probable values of X for given
values of Y.
19/11/2022 MFC 4
Regression line equations
The equation of the regression line of Y on X is , …. (1)
where byx = is the regression coefficient of Y on X
This equation is used to predict the unknown values of Y for given values of X.
The equation of the regression line of X on Y is …. (2)
where bxy = is the regression coefficient of Y on X.
This equation is used to predict the unknown values of X for given values of Y.
In both equations = is the mean of X values and = is the mean of Y values.
Note1: The two regression lines intersect at the point (.
Note2: Both the regression coefficients must be of the same sign, and both can’t be
greater than one.
19/11/2022 MFC 5
Example:1
The values of x and the corresponding values of y are shown in the table
below:
X 0 1 2 3 4
y 2 3 5 4 6
19/11/2022 MFC 6
Solution:
We now use the following table to compute the required sums
x y xy x2
0 2 0 9 4
1 3 3 1 9
2 5 10 4 25
3 4 12 9 16
4 6 24 16 36
=10 =20 =49 =30 =90
19/11/2022 MFC 7
Substituting n=5, =10, =20, =49 and =30 in the formula of regression coefficient of y
on x
byx = = = 0.9 , = = = 2 and = = 4
Equation of the regression line of y on x is y – = byx (x-
…. (1)
To find the value of y when x=10, put x=10 in (1).
Then y= 0.9(10) + 2.2= 11.2.
Substituting n=5, =10, =20, =49 and =90 in the formula of regression coefficient of x
on y
bxy = = = 0.9
Equation of the regression line of y on x is
…. (2)
19/11/2022 MFC 8
Example:2
The sales of a store ( In million rupees) for each year are shown below:
19/11/2022 MFC 9
Solution:
We now use the following table to compute the required sums
t y ty t2
0 12 0 9
1 19 19 1
2 29 58 4
3 37 111 9
4 45 180 16
=10 =142 =368 =30
19/11/2022 MFC 10
Substituting n=5, =10, =142, =368 and =30 in the formula of regression
coefficient of y on t
byt = = = 8.4, = 2 and = 28.4
To find the sales of the company in the year 2012 is obtained by putting
t= (2012-2005)=7 in (1)
Y= 8.4(7)+11.6= 70.4 million rupees.
19/11/2022 MFC 11
Example 3:
The age X in months and vocabulary Y were measured for 6 children, with
the results shown in the following table.
X 13 14 15 16 17 18
Y 8 10 15 20 27 30
19/11/2022 MFC 12
Solution:
We now use the following table to compute the required sums
x y xy x2
13 8 104 169
14 10 140 196
15 15 225 225
16 20 320 256
17 27 459 289
18 30 540 324
=93 =110 =1788 =1459
19/11/2022 MFC 13
Substituting n=6, =93, =110, =1788 and =1459 in the formula of regression
coefficient of y on x
byx = = = 4.74, = = =15.5 and
= = = 18.33
Equation of the regression line of y on x is y – = byx (x-
- 18.33 = 4.74(x-15.5) y= 4.74x -15.5 ….(1)
To find the vocabulary of the child when the child is 2 years is obtained by
putting x= 24 months in (1)
y= 4.74(24)-55.17= 58.89 59 words.
19/11/2022 MFC 14
Example: 4
The fat content in grams and calories for several burgers at a fast-food
restaurant are given below:
Fat(g) 20 23 31 33 37 38 40 43
Determine the equation of regression line to predict calories from fat and
estimate the calories when the fat is 35 grams.
19/11/2022 MFC 15
Solution:
Let X be the fat content and Y be the calories of a burger. Then we have to
find the regression line of Y on X.
We now use the following table to compute the required sums
x y xy x2
20 410 820 400
23 490 11270 529
31 570 17670 961
33 590 19470 1089
37 580 21460 1369
38 630 23940 1444
40 670 26800 1600
43 680 29240 1849
=265 =4620 =158050 =9241
19/11/2022 MFC 16
Substituting n=8, =265, =4620, =158050 and =9241 in the formula of
regression coefficient of y on x
byx = = = 10.829 ,
= = = 33.125 and
= = 577.5
Equation of the regression line of Y on X is y – = byx (x-
y- 577.5 = 10.829(x-33.125) y= 10.829x +218.78 …. (1)
To find the calories when the fat is 35 grams put x=35 in (1).
Then y= 10.829(10) + 218.78= 327.07 calories.
19/11/2022 MFC 17
Practice Problems:
1) In an attempt to increase the yield Y (Kg/h) of an industrial process a technician
varies the percentage of a certain additive(X) used when keeping all other
conditions as constant as possible. The results are shown below:
=34; =1057; =4504; =15.5.
Calculate the equation of the regression line of yield on percentage additive.
2) An experiment is conducted to investigate variation of solubility of chemical X in
water. The quantities in Kg. that dissolved in one liter of water at various
temperatures are shown in the following table:
Temperature 15 20 25 30 35 50 70
C(Y)
Mass of X (Kg) 2.1 2.6 2.9 3.3 4.0 4.1 7.0
19/11/2022 MFC 18
3) A student counted the number of words in an essay she had written, recording the total
every 10 lines
No. of lines (X) 10 20 30 40 50 60
No. of words (Y) 75 136 210 291 368 441
Find the formula to convert lines to words. How many words (approximately) has she
written if she writes (a) 35 lines (b) 100 lines?
4) If six test areas were given different concentrations of a new fertilizer and the resulting
crop was weighed
Draw the scatter plot diagram to show the data. Calculate the equation of the regression
line of Y on X and show it in your diagram. What increase in weight of crop might be
expected from raising the concentration of fertilizer by 1 g/L?
19/11/2022 MFC 19
5) The experimental data below were obtained by measuring the horizontal
distance Y cm, rolled by a n object raised from the point on a plane inclined
at to the horizontal
19/11/2022 MFC 20
19/11/2022 MFC 21