# # 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. # #----- save_plots = F library(DAAG) cuckoos.lm_a = lm( length ~ breadth, data=cuckoos ) # one model cuckoos.lm_b = lm( length ~ breadth + species, data=cuckoos ) # different intercepts and the same slope cuckoos.lm_c = lm( length ~ breadth + species + breadth:species, data=cuckoos ) # different intercepts and different slopes anova( cuckoos.lm_a, cuckoos.lm_b, cuckoos.lm_c ) # look for outliers: if( save_plots ){ postscript("../../WriteUp/Graphics/Chapter7/prob_5_plot.eps", onefile=FALSE, horizontal=FALSE) } plot( cuckoos.lm_b, which=1 ) if( save_plots ){ dev.off() }