[R] The other type of relative frequency for hist()
RexBryan1 at attbi.com
Fri Jan 24 20:11:17 CET 2003
Hist() can plot histogram bars with a relative frequency scale. However,
this relative frequency is scaled as a probability density, where the sum of
the bar heights times the bar widths will equal 1. There is another way to
define relative frequency which is based on the proportion of the count in a
bin to the total count over all bins. Is there a way to scale the vertical
axis so as to show this other type?
hist.dump<-hist(v3, freq=FALSE, plot=FALSE)
 6 1 0 0 0 4
 10.909078 1.818182 0.000000 0.000000 0.000000 7.272727
Now for this histogram 3 bins have bars with widths in this case that happen
to be 0.05 units wide. If hist.dump$count is multiplied
by hist.dump$density for the first bin a value of 0.5455 is obtained.
This is of course simply the 6 observations in the first bin divided by 11.
Is there a simple way of representing this second type of relative frequency
in the y-axis?
More information about the R-help