Case Study 7-01

Read in the data into a data frame

> case0701 = read.table("case0701.csv",sep=",",header=T)

Make sure the structure of the data frame is correct.

> str(case0701)

Attach the data frame so variables can be refered to by name.

> attach(case0701)

Fit an regression using lm

> fit1 = lm(DISTANCE ~ VELOCITY)
> summary(fit1)
> anova(fit1)

Make several summary plots

> plot(fit1)

Plot Residuals versus fitted values

> plot(fitted(fit1),residuals(fit1))