V = NULL ## Sample sizes. NSamp = c(10,20,40,80,160) ## Loop over a sequence of sample sizes. for (k in 1:length(NSamp)) { ## The sample size for this iteration. r = NSamp[k] ## Generate nrep data sets containing r values each. X = array(rcauchy(r*1000), c(1000,r)) ## The sample mean of each data set. Y = apply(X, 1, mean) V[k] = var(Y) }