[R] density > 1?
Peter Dalgaard
P.Dalgaard at biostat.ku.dk
Mon Mar 2 13:47:29 CET 2009
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,
>
>> hist(rnorm(1000,sd=.1),freq=FALSE)
>
> shows density values over 1.
>
> How to interpret density values over 1?
This comes up every now and again. The real question is: Why do people
believe that densities should be probabilities? They're not, they denote
(differential) probability per unit on the x axis, and the denominator
can be small. The density _integrates_ to 1, so if e.g. it is
concentrated on (0, 0.5) if has to be at least 2 somewhere.
> Greetings,
>
> Johannes
>
> ______________________________________________
> 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.
--
O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list