# # 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. # #----- stem <- function(x,y,pch=16,linecol=1,clinecol=1,...){ if (missing(y)){ y = x x = 1:length(x) } plot(x,y,pch=pch,...) for (i in 1:length(x)){ lines(c(x[i],x[i]), c(0,y[i]),col=linecol) } lines(c(x[1]-2,x[length(x)]+2), c(0,0),col=clinecol) } n=102 zd4d_r_k = c( -0.39, -0.24, 0.17, 0.21, -0.27, -0.03, 0.26, -0.10, -0.20, 0.07, 0.44, -0.58, 0.09, 0.17, 0.01, -0.24, 0.16, 0.04, -0.12, -0.01, 0.11, 0.08, -0.33, 0.28, 0.01, -0.14, -0.02, 0.18, -0.13, 0.04, -0.01, 0.10, -0.13, -0.09, 0.27, -0.22, 0.00, 0.09, 0.02, -0.18, 0.17, -0.05, 0.00, -0.06, 0.06, 0.06, -0.13, 0.11 ) #postscript("../../WriteUp/Graphics/Chapter9/prob_7_zd4drk_plot.eps", onefile=FALSE, horizontal=FALSE) stem( zd4d_r_k, pch=18 ) abline(h=+2/sqrt(n),col="red") abline(h=-2/sqrt(n),col="red") #dev.off()