neff <- t(sapply(1:30, function(i) sapply(1:100*10, function(n) max(rnorm(n)))))
qB <- quantileBands(neff, x=1:100*10)
qB[,1:10]
quantileBands(neff, x=1:100*10, smooth=19, meanargs=list(col=2), txi=NA)
library(RColorBrewer)
quantileBands(neff, x=1:100*10, smooth=9, ylab="max of rnorm(n)",
xlab="sample size (n)", probs=0:10/10, col=brewer.pal(5,"BuGn"),
medargs=list(lwd=2), meanargs=list(col=2, lty=1), txi=c(40,50,60),
main="Maximum is an unsaturated statistic:
it rises with sample size")
neff2 <- t(sapply(1:30, function(i) sapply(1:100*10, function(n) mean(rnorm(n)))))
quantileBands(neff2, x=1:100*10, smooth=9, ylab="mean of rnorm(n)",
xlab="sample size (n)", probs=0:10/10, col=brewer.pal(5,"BuGn"),
txi=c(40,50,60), textargs=list(col="yellow"), medargs=list(lwd=2),
meanargs=list(col=2, lty=1), main="Mean converges to true population mean")
Run the code above in your browser using DataLab