Overview
This supplement was also published on RPubs here with a virtual magazine name.
Executive Summary
Firstly we setup the relationship between transmission and MPG via statistical regression analysis technology and find the result that manual transmission is better for MPG. Secondly we go deeply with data to show the detailed quantitative information on MPG between the two main transmissions. After analyzing the single variable transmission, we create new models with new variables to further our finding about which variables help increase MPG.
Analysis phase I:
head(mtcars)
## mpg cyl disp hp drat wt qsec vs am gear carb
## Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
## Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
## Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
## Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
## Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
这是一个多元回归方程用于揭示汽车油耗和汽车属性之间的关系,试图回答常见的问题:是否自动档的汽车更费油?除了自动档这个属性,还有其他属性和汽车耗油之间的关系更大吗?原文见于RPubshere.
分析基于R语言,mtcars小数据集(可以扩展到更大数据集),希望对读者有所帮助。
This supplement was also published on RPubs here with a virtual magazine name.
Executive Summary
Firstly we setup the relationship between transmission and MPG via statistical regression analysis technology and find the result that manual transmission is better for MPG. Secondly we go deeply with data to show the detailed quantitative information on MPG between the two main transmissions. After analyzing the single variable transmission, we create new models with new variables to further our finding about which variables help increase MPG.
Analysis phase I:
In this part, we setup a regression model between transmissions and MPG. And below are the first 6 records of data.
head(mtcars)
## mpg cyl disp hp drat wt qsec vs am gear carb
## Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
## Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
## Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
## Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
## Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
## Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1
<