Jörg Groß wrote:
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

x <- runif(10000,0,1)
y <- runif(10000,0,1)
z <- runif(10000,0,1)
u <- runif(10000,0,1)
v <- runif(10000,0,1)
w <- runif(10000,0,1)
t <- x+y+z+u+v+w
hist(t,breaks=100,xlab="sum of i.i.d r.v with finite mean and variance",ylab="Frequency",main="")

Change runif for the corresponding function of the distribution of your choice.
Not exactly what you wanted but it does verify the C.L.T.
Rubén

______________________________________________
R-help@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.

Reply via email to