# This program reproduces a similar output of Fig 3.21 # Page 129 in BCK # Created 060312 by C. Andy Tsao # Load the package "foreign" # Switch your working dir to the dir where your data is t36<-read.S("t3-6 starting salary.splus") t36[,1] t36[,2] dt36<-data.frame(gpa=t36[,1],salary=t36[,2]) dt36 attach(dt36) plot(salary~gpa) fm<-lm(salary~gpa) abline(fm) summary(fm) par(mfrow=c(2,2)); plot(fm) history() # When you quit from R, do NOT save workspace image unless necessary.