2004-12-02 Robin Hankin wrote:

> hist(replicate(10000,f(10)))
>
> gives us a histogram of 10000 observations of a variable that is
> itself the mean of 10 exponential variables.

You might want to use 'truehist' from the 'MASS' package instead. It 
draws a real histogram (where the area of the bars sum to 1), and the 
number of bars increases with the number of observations.

Example:

library(MASS)
truehist(rnorm(100), col="wheat")
truehist(rnorm(1000), col="wheat")
truehist(rnorm(10000), col="wheat")

x = rnorm(100000)
truehist(x, col="wheat")
plot(density(x))   # Density estimate

(Regarding col="wheat": The default colour used by 'truehist' is 
really eye-blinding ... :) )

-- 
Regards,
Karl Ove Hufthammer

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to