mpg: Data on automobile efficiency on town streets and highway.

Description Usage Format Details Source References Examples

Description

Fuel efficiency in miles per gallon for a variety of cars in the USA.

Usage

1

Format

A data frame listing fuel efficiency and other car characteristics including

symbol

Insurers measure of relative riskiness of car from -3 (safe) to 3 (risky)

loss

average insurance loss payment per insured vehicle per year.

hw.mpg

Fuel consumption on highway as miles per US gallon.

city.mpg

Fuel consumption in town as miles per US gallon.

make

Name of car maker.

fuel

2 level factor. gas or diesel.

aspir

2 level factor. std or turbo.

doors

2 level factor. two or four.

style

Factor indicating style of car.

drive

3 level factor indicating front, rear or all wheel drive: fwd, rwd or 4wd.

eng.loc

Engine location

wb

wheel base in inches

length

in inches

width

in inches

height

in inches

weight

in pounds

eng.type

Factor giving engine type

cylinders

Factor for number of cylinders

eng.cc

cubic capicity of engine in cubic inches.

fuel.sys

fuel system

bore

in inches

stroke

in inches

comp.ratio

compression ratio

hp

horse power

rpm

maximum RPM

price

in US dollars

Details

Data were collected by Jeffrey C. Schlimmer from 1) 1985 Model Import Car and Truck Specifications, 1985 Ward's Automotive Yearbook. 2) Personal Auto Manuals, Insurance Services Office, 160 Water Street, New York, NY 10038 3) Insurance Collision Report, Insurance Institute for Highway Safety, Watergate 600, Washington, DC 20037

Source

https://archive.ics.uci.edu/ml/datasets/Automobile

References

Wood, S.N. (2006) Generalized Additive Models: An Introduction with R

Examples

1
2
3
4
5
6
require(gamair);require(mgcv)
data(mpg)
b <- gam(list(city.mpg~fuel+style+drive+s(weight)+s(hp)+s(make,bs="re"),
          hw.mpg~fuel+style+drive++s(weight)+s(hp)+s(make,bs="re")),
          family=mvn(d=2),data=mpg)
plot(b,pages=1,scheme=1)

Example output

Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-17. For overview type 'help("mgcv-package")'.

gamair documentation built on Aug. 23, 2019, 5:03 p.m.