# # EPage 241 # # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- library(DAAG) toycars$car = as.factor(toycars$car) # Part (a): # toycars.lm_a = lm( distance ~ angle + car, data=toycars ) # Part (b): # plot( toycars.lm_a, which=1 ) # Part (c): # toycars.lm_c = lm( distance ~ angle:car, data=toycars ) # we can also use distance ~ angle + angle:car to get this fit ... I don't know which is better / preferred plot( toycars.lm_c )