[R] plot - central limit theorem

Greg Snow 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
Intermountain Healthcare
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
> Hi,
> 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,
> joerg
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list