##### R-code for making Figure 3.1. It reads data from ##### "example41.dat" generated by the R-code "example41.r" set.seed(100) dat <- matrix(c(rnorm(50,0,1),rnorm(50,1,1)),ncol=5,byrow=T) xbar <- numeric() rbar <- numeric() for(i in 1:20){ xbar[i] <- mean(dat[i,]) rbar[i] <- max(dat[i,])-min(dat[i,]) } i <- seq(1,20) pdf("fig31.pdf",width=4.5,height=4.0) U=3/sqrt(5) C=0 L=-3/sqrt(5) plot(i[1:10],xbar[1:10],type="o",lty=1,pch=16,xlab="n", ylab=expression(bar(X)[n]),mgp=c(2,1,0),xlim=c(0,21), ylim=c(-2,2), cex=0.8) lines(i[11:20],xbar[11:20],type="o",lty=3,pch=1,cex=0.8) lines(i,rep(U,length(i)),lty=2,cex=0.8) lines(i,rep(C,length(i)),lty=2,cex=0.8) lines(i,rep(L,length(i)),lty=2,cex=0.8) graphics.off()