Discussion Forum 3: Linear Regression - Needed in 16 - 18 Hours
Your assignment for this discussion is to learn how to use linear regressions to help you make decisions and better understand what your data is telling you.
Here’s your task : You want to learn whether there is a relationship between the number of cylinders a sedan has and its average miles per gallon (mpg).
· First, pick six cars from the following list.
o You can pick them however you want.
o NOTE: Pick at least one vehicle with a different number of cylinders or mpg than the others. For example, if all the vehicles you choose have 4 cylinders, or all of them get 30 mpg, your homework won’t work.
|
Car |
Cylinders |
Average MPG |
|
Car |
Cylinders |
Average MPG |
|
Acura ILX |
|
|
|
Hyundai Accent |
4 |
32 |
|
Acura ILX Hybrid |
4 |
29 |
|
Hyundai Equus |
8 |
19 |
|
Acura TL |
4 |
38 |
|
Hyundai Genesis |
6 |
23 |
|
Acura TSX |
6 |
24 |
|
Hyundai Elantra |
4 |
33 |
|
Audi A4 |
4 |
26 |
|
Hyundai Sonata |
4 |
29 |
|
Audi A6 |
4 |
27 |
|
Hyundai Sonata H |
4 |
36 |
|
Audi A8 |
4 |
25 |
|
Kia Forte |
4 |
29 |
|
Audi S4 |
6 |
23 |
|
Kia Rio |
4 |
33 |
|
Audi S6 |
6 |
21 |
|
Lexus ES 300h |
4 |
39 |
|
BuickLaCrosse |
8 |
22 |
|
Lexus ES 350 |
6 |
26 |
|
Cadillac ATS |
4 |
30 |
|
Lexus GS 350 |
6 |
23 |
|
Cadillac CTS |
4 |
27 |
|
Lexus GS 450h |
6 |
31 |
|
Cadillac CTS-V |
4 |
22 |
|
Lexus IS 250 |
6 |
25 |
|
Cadillac XTS |
8 |
16 |
|
Lexus IS 350 |
6 |
23 |
|
ChevroletCruze |
6 |
22 |
|
Lincoln MKS |
6 |
22 |
|
Chevrolet Impala |
4 |
30 |
|
Lincoln MKZ |
4 |
27 |
|
Chevrolet Malibu |
6 |
24 |
|
Lincoln MKZ Hybrid |
4 |
45 |
|
Chevrolet Sonic |
4 |
31 |
|
Mazda 3 |
4 |
29 |
|
Chrysler 300 |
4 |
30 |
|
Mazda 6 |
4 |
25 |
|
Dodge Dart |
6 |
25 |
|
Mercedes-Benz C |
6 |
24 |
|
Dodge Charger |
4 |
30 |
|
Mercedes-Benz E |
6 |
25 |
|
Ford Fiesta |
6 |
22 |
|
Mercedes-Benz S |
12 |
12 |
|
Ford Focus |
4 |
34 |
|
Nissan Altima |
4 |
32 |
|
Ford Fusion |
4 |
31 |
|
Nissan Sentra |
4 |
31 |
|
Ford Fusion Hybrid |
4 |
28 |
|
Nissan Versa |
4 |
31 |
|
Ford Taurus |
4 |
47 |
|
Toyota Avalon |
6 |
26 |
|
Honda Civic Hybrid |
6 |
24 |
|
Toyota Camry |
4 |
30 |
|
Honda Civic |
4 |
44 |
|
Toyota Corolla |
4 |
30 |
|
Honda Accord EX |
4 |
32 |
|
VolkswagenJetta |
4 |
29 |
|
Hyundai Azera |
6 |
24 |
|
VolkswagenPassat |
5 |
27 |
· Second, to see whether the number of cylinders affects a vehicle’s mpg, let’s make the number of cylinders be variable “X” and average mpg be variable “Y.”
· Third, take your six choices and place them in the following grid:
|
|
A |
B |
C |
D |
|
|
Average MPG (Y) |
Cylinders (X) |
(X - avg X)^2 |
(X - avgX)(Y -avgY) |
|
Your Choices: |
|
|
|
|
|
o Car 1 |
|
|
|
|
|
o Car 2 |
|
|
|
|
|
o Car 3 |
|
|
|
|
|
o Car 4 |
|
|
|
|
|
o Car 5 |
|
|
|
|
|
o Car 6 |
|
|
|
|
|
Sum |
|
|
|
|
|
Average |
|
|
|
|
For example, if you picked six of the Hyundai vehicles, your chart would look like this:
|
|
A |
B |
C |
D |
|
|
Average MPG (Y) |
Cylinders (X) |
(X - avg X)^2 |
(X - avgX)(Y -avgY) |
|
Your Choices: |
|
|
|
|
|
o Accent |
32 |
4 |
|
|
|
o Equus |
19 |
8 |
|
|
|
o Genesis |
23 |
6 |
|
|
|
o Elantra |
33 |
4 |
|
|
|
o Sonata |
29 |
4 |
|
|
|
o Sonata Hybrid |
36 |
4 |
|
|
|
Sum |
|
|
|
|
|
Average |
|
|
|
|
Fourth , get the sums and averages for both columns of data, like this:
|
|
A |
B |
C |
D |
|
|
Average MPG (Y) |
Cylinders (X) |
(X - avg)^2 |
(X - avgX)(Y -avgY) |
|
Your Choices: |
|
|
|
|
|
o Accent |
32 |
4 |
|
|
|
o Equus |
19 |
8 |
|
|
|
o Genesis |
23 |
6 |
|
|
|
o Elantra |
33 |
4 |
|
|
|
o Sonata |
29 |
4 |
|
|
|
o Sonata Hybrid |
36 |
4 |
|
|
|
Sum |
172 |
30 |
|
|
|
Average |
28.7 |
5 |
|
|
NOTE : Some of you will get averages that are not even numbers, like 4.667, 11.339, etc. For the purposes of this homework, just round them to one place past the decimal, if needed.
Fifth , fill in the answers for Column C by subtracting the average from each value in Column A, then squaring what’s left over.
· For example, with the Accent, the solution would be (4 – 5)2, or (1)2, for an answer of 1.
· On the other hand, for the Equus the answer would be (8 – 5)2, or (3)2, for an answer of 9.
|
|
A |
B |
C |
D |
|
|
Average MPG (Y) |
Cylinders (X) |
(X - avgX)^2 |
(X - avgX)(Y -avgY) |
|
Your Choices: |
|
|
|
|
|
o Accent |
32 |
4 |
1 |
|
|
o Equus |
19 |
8 |
9 |
|
|
o Genesis |
23 |
6 |
4 |
|
|
o Elantra |
33 |
4 |
1 |
|
|
o Sonata |
29 |
4 |
1 |
|
|
o Sonata Hybrid |
36 |
4 |
1 |
|
|
Sum |
172 |
30 |
17 |
|
|
Average |
28.7 |
5 |
|
|
To finish step 5, sum the numbers in Column C. This gives us a total of 17.
Sixth , to get the answers for Column D, do the following:
* First, subtract the number of cylinders (Column B) from the average number of cylinders.
* Second, subtract the MPG (Column A) from the average MPG.
* Finally, to get Column D, multiply these two numbers.
For example, using the Accent, the first half of the equation (the X part) would be (4 – 5), or -1.
The second half of the equation (the Y part) would be (32 - 28.7), or 3.3.
Finally, to get Column D, multiply the X part (-1) times the Y part (3.3) to get an answer of -3.3.
|
|
A |
B |
C |
D |
|
|
Average MPG (Y) |
Cylinders (X) |
(X - avgX)^2 |
(X - avgX)(Y - avgY) |
|
Your Choices: |
|
|
|
|
|
o Accent |
32 |
4 |
1 |
-3.3 |
|
o Equus |
19 |
8 |
9 |
-29 |
|
o Genesis |
23 |
6 |
4 |
-5.7 |
|
o Elantra |
33 |
4 |
1 |
-4.3 |
|
o Sonata |
29 |
4 |
1 |
-0.3 |
|
o Sonata Hybrid |
36 |
4 |
1 |
-7.3 |
|
Sum |
172 |
30 |
17 |
-49.9 |
|
Average |
28.7 |
5 |
|
|
To finish step 6, sum the numbers in Column D. This gives the sum of -49.9.
Now that you’ve made your choices and have a complete grid, use your class notes to do a regression. Use the Discussion Board to answer the following:
a. What six cars did you choose? (15 pts)
b. What were the values for each (cylinders and MPG)? (15 pts)
c. What value did you get for “b0”? (35 pts)
d. What value did you get for “b1”? (35 pts)