function(n,k=2,PDF=T,iseed=28){ set.seed(iseed) m=n-k if(PDF==T) pdf(file=paste("EDFm",m,"n",n,".pdf",sep=""),width=11) x=sort(rnorm(n)) y=sort(rnorm(m,1)) mx=min(c(x,y)) Mx=max(c(x,y)) plot.stepfun(stepfun(x,c(0,(1:n)/n)),xlab="x", ylab=expression(F[m](x)~" and "~G[n](x)),cex=.7,pch=16 ,axes=F,main="",xlim=c(mx,Mx)) axis(1) axis(2) abline(h=c(0,1),lty=2,col="grey") points(x,rep(-.01,n),pch=16,col="green",cex=.7) points(y,rep(-.02,n-k),pch=16,col="orange",cex=.7) for(i in 1:n){ segments(x[i],-.01,x[i],i/n,lty=2,col="green") } text(mx,.9,paste("m =",m,", n =",n),adj=0) text(-.2,.65,expression(G[n](x))) text(.9,.4,expression(F[m](x)),col="blue") out=stepfun(y,c(0,(1:(n-k))/(n-k))) plot(out,add=T,cex=.7,col.hor="blue",col.vert="blue",pch=16) if(PDF==T) dev.off() }