Skip to content

hist with relative frequency

2 messages · Erin Hodgess, Peter Dalgaard

#
Dear R People:

Here is yet another histogram question (yahq), please:

When I use the hist() command with
freq=F, I get density on the side.

I would really like to have relative frequency; that is,
Rf = density/(sum(density))

Is there a step that I'm leaving out, please?

thanks!

Sincerely,
Erin
hodgess at uhddx01.dt.uh.edu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Erin Hodgess <hodgess at uhddx01.dt.uh.edu> writes:
Several people would probably contest that that is really what you
want (histograms are supposed to be density estimates), but if you
insist then you could use x <- hist(..., plot=F), normalize the count
or density component, then plot(x).