[R] density 1?

2009-03-02 Thread Johannes Elias
Dear R-Gurus, I wonder why 'density' values as shown in hist or plot(density(x)) are sometimes over 1. How can that be? Example hist(rnorm(1000,sd=.5),freq=FALSE) The resulting plot shows density values below 1 on the y-axis. However, hist(rnorm(1000,sd=.1),freq=FALSE) shows density values

Re: [R] density 1?

2009-03-02 Thread Bill.Venables
-help@r-project.org Subject: [R] density 1? Dear R-Gurus, I wonder why 'density' values as shown in hist or plot(density(x)) are sometimes over 1. How can that be? Example hist(rnorm(1000,sd=.5),freq=FALSE) The resulting plot shows density values below 1 on the y-axis. However, hist(rnorm(1000

Re: [R] density 1?

2009-03-02 Thread Eik Vettorazzi
Hi Johannes, ist more a statistical issue. In short: densities are not probabilities! With a continuous random variable probability statements are typically over intervals not over points. A density is bound to have an integral of 1 (and to be non-negative), nothing else. Consider the uniform

Re: [R] density 1?

2009-03-02 Thread Peter Dalgaard
Johannes Elias wrote: Dear R-Gurus, I wonder why 'density' values as shown in hist or plot(density(x)) are sometimes over 1. How can that be? Example hist(rnorm(1000,sd=.5),freq=FALSE) The resulting plot shows density values below 1 on the y-axis. However,

Re: [R] density 1?

2009-03-02 Thread Bernardo Rangel Tura
On Mon, 2009-03-02 at 13:27 +0100, Johannes Elias wrote: Dear R-Gurus, I wonder why 'density' values as shown in hist or plot(density(x)) are sometimes over 1. How can that be? Example hist(rnorm(1000,sd=.5),freq=FALSE) The resulting plot shows density values below 1 on the y-axis.