##### R-code for making Figure 4.2. It reads data from ##### "example41.dat" generated by the R-code "example41.r" dat <- matrix(scan("example41.dat"),ncol=5,byrow=T) xbar <- numeric() cn <- numeric() xbar[1] <- mean(dat[1,]) cn[1] <- xbar[1] for(i in 2:20){ xbar[i] <- mean(dat[i,]) cn[i] <- cn[i-1]+xbar[i] } i <- seq(1,20) postscript("fig42.ps",width=5,height=5,horizontal=F) plot(i[1:10],cn[1:10],type="o",lty=1,pch=16,xlab="n", ylab=expression(C[n]),mgp=c(2,1,0),xlim=c(0,21), ylim=c(-2,2.5),cex=0.8) lines(i[11:20],cn[11:20],type="o",lty=3,pch=1,cex=0.8) graphics.off()