Gosset - The God
Purpose
To Visualize Gauss Seminal Contribution
> n <- 10 * 10000 > x <- matrix(rnorm(n, 1, 2), ncol = 10000) > mu <- apply(x, 2, mean) > sample.sd <- apply(x, 2, sd)/sqrt(10) > t.stat <- (mu - 1)/sample.sd > plot.new() > plot(density(t.stat), col = "blue", xlim = c(-4, 4), xlab = "Quantile", + main = "", ylim = c(0, 0.4)) > par(new = T) > plot(density(rnorm(1e+05, 0, 1)), col = "red", xlim = c(-4, 4), + xlab = "", main = "", ylim = c(0, 0.4)) > legend("topleft", legend = c("Normal", "T Dist"), fill = c("red", + "blue")) |