In: Statistics and Probability
The Department of Energy and the U.S. Environmental Protection Agency's 2012 Fuel Economy Guide provides fuel efficiency data for 2012 model year cars and trucks.† The file named CarMileage provides a portion of the data for 309 cars. The column labeled Size identifies the size of the car (Compact, Midsize, and Large) and the column labeled Hwy MPG shows the fuel efficiency rating for highway driving in terms of miles per gallon. Use α = 0.05 and test for any significant difference in the mean fuel efficiency rating for highway driving among the three sizes of cars. (Hint: you will need to re-organize the data to create indicator variables for the qualitative data).
State the null and alternative hypotheses.
H0: β1 =
β2 = 0
Ha: One or more of the parameters is not equal
to zero.
Find the value of the test statistic for the overall model. (Round your answer to two decimal places.)
Find the p-value for the overall model. (Round your answer to three decimal places.)
p-value =
please explain the process through excel
Size | Hwy MPG |
Compact | 30 |
Compact | 31 |
Compact | 31 |
Compact | 33 |
Compact | 29 |
Compact | 31 |
Compact | 27 |
Midsize | 33 |
Midsize | 34 |
Midsize | 32 |
Midsize | 30 |
Midsize | 31 |
Midsize |
30 |
Large | 34 |
Large | 34 |
Large | 34 |
Large | 35 |
Large | 35 |
Large | 28 |
Large | 25 |
Large | 25 |
Large | 27 |
Large | 27 |
Large | 31 |
Large | 27 |
First of all, we need to reorganize the data to distinguish each column, the size of the cars with their mileage is reflected. I shall name the three columns as Compact, midsize and Large. Under each column, the mileage information will be entered or copied. The data will now look like this:
Compact | Midsize | Large |
30 | 33 | 34 |
31 | 34 | 34 |
31 | 32 | 34 |
33 | 30 | 35 |
29 | 31 | 35 |
31 | 30 | 28 |
27 | 25 | |
25 | ||
27 | ||
27 | ||
31 | ||
27 |
Now Compact column will have 7 rows of data and Midsize will have 6 and Large will have 12 rows.
Null Hypothesis: The average mileages of all three sizes are the same
Where is the Average for compact size car, is the average of mid sized cars and is the average of the Large sized cars.
Alternative Hypothesis: One or more of the parameters is not equal
Test Statistic : where MSS is Mean Sum of squares from ANOVA table and Bet refers to between groups and Err refers to Error or Within groups. In the output, p-values will also be reported.
We shall now proceed to analysis using Excel. Under Excel, use the data analysis tool. Under the tool, use Anova: Single factor. In this option, select the options grouped by Columns and Click the Labels in first row option and give a range to output. We shall get the following output.
Anova: Single Factor | ||||||
SUMMARY | ||||||
Groups | Count | Sum | Average | Variance | ||
Compact | 7 | 212 | 30.28571 | 3.571429 | ||
Midsize | 6 | 190 | 31.66667 | 2.666667 | ||
Large | 12 | 362 | 30.16667 | 16.33333 | ||
ANOVA | ||||||
Source of Variation | SS | df | MS | F | P-value | F crit |
Between Groups | 9.731429 | 2 | 4.865714 | 0.499214 | 0.613719 | 3.443357 |
Within Groups | 214.4286 | 22 | 9.746753 | |||
Total | 224.16 | 24 |
From the table above, the test statistics is 0.50 and the p-value is 0.61.