Learn R Programming

MPV (version 1.64)

table.b3: Table B3

Description

The table.b3 data frame has observations on gasoline mileage performance for 32 different automobiles.

Usage

data(table.b3)

Arguments

Format

This data frame contains the following columns:

y

Miles/gallon

x1

Displacement (cubic in)

x2

Horsepower (ft-lb)

x3

Torque (ft-lb)

x4

Compression ratio

x5

Rear axle ratio

x6

Carburetor (barrels)

x7

No. of transmission speeds

x8

Overall length (in)

x9

Width (in)

x10

Weight (lb)

x11

Type of transmission (1=automatic, 0=manual)

References

Motor Trend, 1975

Examples

Run this code
data(table.b3)
attach(table.b3)
y.lm <- lm(y ~ x1 + x6)
summary(y.lm)
# testing for the significance of the regression:
y.null <- lm(y ~ 1)
anova(y.null, y.lm)
# 95% CI for mean gas mileage:
predict(y.lm, newdata=data.frame(x1=275, x6=2), interval="confidence")
# 95% PI for gas mileage:
predict(y.lm, newdata=data.frame(x1=275, x6=2), interval="prediction")
detach(table.b3)

Run the code above in your browser using DataLab