mpg {gamair} | R Documentation |
Data on automobile efficiency on town streets and highway.
Description
Fuel efficiency in miles per gallon for a variety of cars in the USA.
Usage
data(mpg)
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
ordiesel
.- aspir
2 level factor.
std
orturbo
.- doors
2 level factor.
two
orfour
.- style
Factor indicating style of car.
- drive
3 level factor indicating front, rear or all wheel drive:
fwd
,rwd
or4wd
.- 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
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)