# # Epage # # 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(alr3) data(shortshoots) attach(shortshoots) # 5.2.1: a scatterplot # epage # plot( Day, ybar, xlab="Day", ylab="Number of stem units") one_pct_quant <- quantile( SD, c(0.01) ) SD[1] <- (1.e-3) * one_pct_quant wm <- lm( ybar ~ Day, weights=1./( SD^2 ) ) uwm <- lm( ybar ~ Day ) postscript("../../WriteUp/Graphics/Chapter5/prob_2.eps", onefile=FALSE, horizontal=FALSE) plot( Day, ybar, xlab="Day", ylab="Number of stem units") abline( wm ) #abline( uwm ) dev.off() summary(wm) summary(uwm)