In: Math
To see for yourself how the central limit theorem works, let's say we have a normal distribution (with mean =100 and standard devation = 20). Let's generate some random samples of various sizes from this distribution. We can do this in excel using =norm.inv(rand(),100,20) and it will randomly generate numbers from this distribution. I generated four samples of size 5, 10, 20 and 30, and got the means of 124 (n=5); 91 (n=10); 105 (n=20); 103 (n=30). If I continue to increase the sample size, my average values should converge to the mean of 100. Now you try. Pick a distribution and generate some sample sizes to prove this to yourself. Post and discuss your results.
ANSWER:
In R,
set.seed(5) s1=rnorm(5,mean=100,sd=20) mean(s1) set.seed(5) s2=rnorm(10,mean=100,sd=20) mean(s2) set.seed(5) s3=rnorm(15,mean=100,sd=20) mean(s3) set.seed(5) s4=rnorm(20,mean=100,sd=20) mean(s4) set.seed(5) s5=rnorm(25,mean=100,sd=20) mean(s5) set.seed(5) s6=rnorm(30,mean=100,sd=20) mean(s6) set.seed(5) s7=rnorm(40,mean=100,sd=20) mean(s7) set.seed(5) s8=rnorm(50,mean=100,sd=20) mean(s8) set.seed(5) s9=rnorm(100,mean=100,sd=20) mean(s9) set.seed(5) |
> set.seed(5) > s1=rnorm(5,mean=100,sd=20) > mean(s1) [1] 104.2784 > set.seed(5) > s2=rnorm(10,mean=100,sd=20) > mean(s2) [1] 98.42297 > set.seed(5) > s3=rnorm(15,mean=100,sd=20) > mean(s3) [1] 96.43686 > set.seed(5) > s4=rnorm(20,mean=100,sd=20) > mean(s4) [1] 94.38884 > set.seed(5) > s5=rnorm(25,mean=100,sd=20) > mean(s5) [1] 99.37997 > set.seed(5) > s6=rnorm(30,mean=100,sd=20) > mean(s6) [1] 100.226 > set.seed(5) > s7=rnorm(40,mean=100,sd=20) > mean(s7) [1] 101.3566 > set.seed(5) > s8=rnorm(50,mean=100,sd=20) > mean(s8) [1] 101.2987 > set.seed(5) > s9=rnorm(100,mean=100,sd=20) > mean(s9) [1] 100.6327 > set.seed(5) |
So as sample size increases the sample mean follows to population mean = 100