[R] plot - central limit theorem
Greg.Snow at imail.org
Wed Oct 15 21:56:20 CEST 2008
Look at the clt.examp function in the TeachingDemos package, it generates samples from normal, uniform, gamma (default exponential), and beta (default U-shaped) distributions and plots histograms of the means along with a reference line of a normal distribution with the same mean and sd. The default sample size is 1 which will show the shape of the population, then you can run it again with larger values of n to show how all of them become more and more normal (the exponential is the slowest).
Hope this helps,
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Jörg Groß
> Sent: Wednesday, October 15, 2008 1:49 PM
> To: r-help at r-project.org
> Subject: [R] plot - central limit theorem
> Is there a way to simulate a population with R and pull out m samples,
> each with n values
> for calculating m means?
> I need that kind of data to plot a graphic, demonstrating the central
> limit theorem
> and I don't know how to begin.
> So, perhaps someone can give me some tips and hints how to start and
> which functions to use.
> thanks for any help,
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help