Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Multiple Linear Regression Example

Suppose we have the following dataset with one dependent


variable y and two independent variables X1 and X2.
y X1 X2
140 60 22
155 62 25
159 67 24
179 70 20
192 71 15
200 72 14
212 75 14
215 78 11

Fit a multiple linear regression model to this dataset by


calculating the means, sums, squares, their sums and the
regression sums to complete the tables (below), calculate the
coefficients b0, b1 and b2 and then write down the estimated
multiple regression equation and interpret the b coefficients.
variable y X1 X2
mean
sum

Note: the regression sums are given by.


( Ʃ X 1)2
 Ʃx1 = ƩX1 –
2 2
n
2
( Ʃ X 2)
 Ʃx2 = ƩX2 –
2 2
n
ƩX 1 Ʃy
 Ʃx1y = ƩX1y – n
ƩX Ʃy
 Ʃx2y = ƩX2y – n2
ƩX ƩX
 Ʃx1x2 = ƩX1X2 – 1n 2

squares X12 X 22 X 1y X2y X1X2

sum
Reg Sum Ʃx12 Ʃx22 Ʃx1y Ʃx2y Ʃx1x2
values

And the b coefficients are given by.


( Ʃx ¿ ¿ 2 ) ( Ʃx1 y ) – (Ʃx 1 x 2)( Ʃx2 y)
2

 b1 = ( Ʃx ¿ ¿ 1 ) ( Ʃ x2 ) – ¿ ¿¿
2 2
¿

( Ʃ x 21 ) ( Ʃ x2 y ) –(Ʃ x 1 x 2)( Ʃ x 1 y )
 b2 = ( Ʃ x 2)( Ʃ x 2 ) – ( Ʃ x x )2
1 2 1 2

 b0 = y – b1X1 – b2X2, using mean values of the variables


Where the estimated regression equation is: ŷ = b0 + b1x1 + b2x2

You might also like