# # EPage 214 # # 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) # Fit the models suggested in the book on the hills2000 dataset: hills2000.lm_male = lm( log(time) ~ log(dist) + log(climb), data=hills2000 ) hills2000.lm_female = lm( log(timef) ~ log(dist) + log(climb), data=hills2000 ) if( save_plots ){ postscript("../../WriteUp/Graphics/Chapter6/prob_4_lm_male_plot.eps", onefile=FALSE, horizontal=FALSE) } plot(hills2000.lm_male, which=1) if( save_plots ){ dev.off() } if( save_plots ){ postscript("../../WriteUp/Graphics/Chapter6/prob_4_lm_female_plot.eps", onefile=FALSE, horizontal=FALSE) } plot(hills2000.lm_female, which=1) if( save_plots ){ dev.off() } # Remove data for Caerketton and 12 Trig Trog: use = !( row.names( hills2000 ) %in% c("Caerketton", "12 Trig Trog") ) hills2000.lm_male = lm( log(time) ~ log(dist) + log(climb), data=hills2000[use,] ) hills2000.lm_female = lm( log(timef) ~ log(dist) + log(climb), data=hills2000[use,] )