printers<-read.table("http://www.uwyo.edu/crawford/datasets/printers.txt",header=TRUE) #see the data plot(time~make,data=printers) #Make all the 1's and 0's (slow painful method) iscanon<-rep(0,nrow(printers)) iscanon[printers\$make=="Canon"]<-1 isepson<-rep(0,nrow(printers)) isepson[printers\$make=="Epson"]<-1 ishp<-rep(0,nrow(printers)) ishp[printers\$make=="HP"]<-1 islexmark<-rep(0,nrow(printers)) islexmark[printers\$make=="Lexmark"]<-1 ispanasonic<-rep(0,nrow(printers)) ispanasonic[printers\$make=="Panasonic"]<-1 isxerox<-rep(0,nrow(printers)) isxerox[printers\$make=="Xerox"]<-1 printers<-cbind(printers,iscanon,isepson,ishp,islexmark,ispanasonic,isxerox) #Do multiple regression (aka ANOVA) fit<-lm(time~iscanon+isepson+ishp+islexmark+ispanasonic+isxerox,data=printers) plot(fit) summary(fit) #Take out a category because we don't need all 6 fit<-lm(time~isepson+ishp+islexmark+ispanasonic+isxerox,data=printers) plot(fit) summary(fit) #Do it the easy way (the way you would think it should work) fit<-lm(time~make,data=printers) plot(fit) summary(fit)