[R] hist density...
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Jun 17 13:03:04 CEST 2003
A density integrates to one, so the total area of the bins is one.
It's your `Thought' which is incorrect.
For hist(freq=FALSE) the area of each rectangle (not its height)
represents the proportion of the data falling into the base of the
rectangle.
On Tue, 17 Jun 2003, wolski wrote:
> Hi!
> Do not understand following behavior.
>
>
> > summary(test$dif)
> Min. 1st Qu. Median Mean 3rd Qu. Max.
> 0.7389 0.9713 0.9850 0.9818 1.0000 1.0000
> length(test$dif)
> [1] 85879
>
>
> tmp <- hist(test$dif,breaks=100,freq=FALSE)
>
> The density on the Y axis in the plot are in the range 0-200.
> Thought that the density should be in the range 0-1
> (something like tmp$count/length(test$dif))?
>
>
> Eryk
>
> P.S.
> In case of frequencies all are fine for the dataset.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list