Skip to content

hist density...

2 messages · Wolski, Brian Ripley

#
Hi!
Do not understand following behavior.
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.
#
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: