基于数据分析,是否自动档汽车比手动挡更耗油

通过R语言进行多元回归分析,发现手动挡汽车比自动挡汽车平均油耗高7.245单位。进一步引入其他变量如车重、齿轮数等进行分析,发现车重对油耗影响显著,而手动挡的优势依然存在。最终结论是手动挡汽车在一般情况下具有更高的燃油效率,同时汽缸数量越少,油耗也更低。
Overview

这是一个多元回归方程用于揭示汽车油耗和汽车属性之间的关系,试图回答常见的问题:是否自动档的汽车更费油?除了自动档这个属性,还有其他属性和汽车耗油之间的关系更大吗?原文见于RPubshere.

分析基于R语言,mtcars小数据集(可以扩展到更大数据集),希望对读者有所帮助。

There are always same questions we are being asked, "Is an automatic or manual transmission better for MPG (miles per gallon)"? "Can you show me the quantitative MPG difference between automatic and manual transmissions?" such kinds of question which are related to choosing a car and saving money on gasoline. In this document we will give our answer to these questions based on our data.
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.


data(mtcars)
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


here, the most left column shows cars' model and, other colums are properties of that model. while am variable is for Transmission (0 = automatic, 1 = manual) and as its names suggests mpg column is for MPG.
Bar plot with Regression Line
Now, let's draw a basic bar plot
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值