Exercise 11. A researcher wants to develop a mathematical model that relates fuel efficiency (MPG), y, to three variables: Engine size, x1, curb weight, x2, and horsepower, x3. Data are gathered from 13 randomly selected vehicles and listed in the table below. Find the multiple regression equation for the data.
MPG, y |
Engine size, x1 |
Curb weight, x2 |
Horsepower, x3 |
24 |
2.4 |
3289 |
177 |
25 |
2.4 |
3263 |
158 |
24 |
2.5 |
3230 |
170 |
22 |
3.5 |
3580 |
272 |
18 |
2.8 |
3175 |
255 |
22 |
3.5 |
3643 |
263 |
20 |
3.5 |
3497 |
306 |
21 |
3.0 |
3340 |
230 |
19 |
3.6 |
3861 |
263 |
24 |
2.4 |
3287 |
173 |
21 |
3.3 |
3629 |
234 |
22 |
2.5 |
3270 |
170 |
22 |
3.5 |
3292 |
270 |
You can do this in two methods, one is you can simply input the data in R, as x1,x2,x3,y
and type in the command : lm(formula = y~x1+x2+x3)
this will give you the following result.
or you could estimate by hand.
let I be a matrix of order 13*1, and I'=[1,1,1,1,1,1,1,1,1,1,1,1,1]
so, X= [ I x1 x2 x3 ]
and by least square method,
using this, the same answer is achieved as above.
>1m (y-xl+x2 +x3) Call: 1m (formula y xl x2 x3) Coefficients: (Intercept) xl x2 x3 35.826758 4.803063 -0.003945 -0.065831
1 2.4 3289 177 X= |1 2.4 3263 158 1 3.5 3292 270
(X'X)X'Y
Get Answers For Free
Most questions answered within 1 hours.