# program to approximate the sampling distn of X-bar # for several values of n # Choosing a sample size: my.n <- 16 number.samples <- 10000 # Examining 10000 values of X-bar # Sampling from standard exponential population: skewed.data <- matrix(rexp(my.n * number.samples), nrow=number.samples, ncol=my.n) xbar.values <- apply(skewed.data, 1, mean) hist(xbar.values)