For the first week, we have a simple warm-up exercise for the discussion. Using R, generate 100 simulations of 30 samples each from a distribution (other than normal) of your choice.

sims <- 100
nunifs <- 30
set.seed(31)

system.time(
  sim1 <- replicate(sims, runif(n=nunifs), simplify = "array")
)
##    user  system elapsed 
##   0.001   0.000   0.001

Graph the sampling distribution of means.

require(ggplot2)
## Loading required package: ggplot2
means <- data.frame(colMeans(sim1))
ggplot(means, aes(x=means, xlabel = "simulation means")) + geom_density() + geom_histogram(aes(y=..density..), fill="grey", alpha = .5, binwidth = .013)
## Don't know how to automatically pick scale for object of type data.frame. Defaulting to continuous.

Graph the sampling distribution of the minimum. Share your graphs and your R code. What did the simulation of the means demonstrate? What about the distribution of the minimum…?

mins <- data.frame(apply(sim1,2,min))
ggplot(means, aes(x=mins), xlab = "simulation means") + geom_density() + geom_histogram(aes(y=..density..), fill="grey", alpha = .5, binwidth = .01)
## Don't know how to automatically pick scale for object of type data.frame. Defaulting to continuous.