# # 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) attach(oddbooks) # Compute our derived features from the base features: volume = thick * height * breadth area = breadth * height density = weight / volume #postscript("../../WriteUp/Graphics/Chapter5/prob_4_plot_wv.eps", onefile=FALSE, horizontal=FALSE) # Part (a): #plot( log(weight) ~ log(volume) ) #m1 = lm( log(weight) ~ log(volume) ) plot( log(density) ~ log(volume) ) m1 = lm( log(density) ~ log(volume) ) abline(m1) summary(m1) #dev.off() #postscript("../../WriteUp/Graphics/Chapter5/prob_4_plot_wa.eps", onefile=FALSE, horizontal=FALSE) # Part (b): #plot( log(weight) ~ log(area) ) #m2 = lm( log(weight) ~ log(area) ) plot( log(density) ~ log(area) ) m2 = lm( log(density) ~ log(area) ) abline(m2) summary(m2) #dev.off()