经验分布函数图形R语言实现set.seed(1)n=100x1=rnorm(n,15,16)x=seq(min(x1),max(x1),0.1)y=pnorm(x,15,16)plot(x,y,type=l,main=P237课本的图5.1)plot(ecdf(x1),verticals=TRUE,do.points=FALSE,add=T,col=red)legend(-20,0.95,c(分布函数,经验分布函数),lty=1,col=c(black,red))-20020400.00.20.40.60.81.0P237课本的图5.1xy分布函数经验分布函数