====== Central Limit Theorem ====== Let $X_{1}, X_{2}, \ldots$ be a sequence of iid random variables with $E(X_{i})=\mu$ and $0 This animation shows the distribution of the sample mean as the sample size $n$ grows. A normality test ''shapiro.test()'' is also performed to check whether the sample mean follows the normal distribution. ===== R code ===== oopt = ani.options(ani.height = 500, ani.width = 600, outdir = getwd(), nmax = 100, interval = 0.1, title = "Demonstration of the Central Limit Theorem", description = "This animation shows the distribution of the sample mean as the sample size grows.") ani.start() par(mar = c(3, 3, 1, 0.5), mgp = c(1.5, 0.5, 0), tcl = -0.3) clt.ani(type = "h") ani.stop() ani.options(oopt)