R-beta: histogram

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Sat Jul 4 00:08:08 CEST 1998


Bill Simpson <wsimpson at uwinnipeg.ca> writes:

> 
> Can someone please tell me to make a density histogram?
> hist makes one with count or relative frequency on the y-axis.
> I want the density, which is (rel freq)/(bin width)
>  In the help I see:
> 
>    intensities: values f^(x[i]), as estimated density values.
>              If `all(diff(breaks) == 1)', they are the relative
>              frequencies `counts/n' and in general satisfy
>              sum[i; f^(x[i]) (b[i+1]-b[i])] = 1, where
>              b[i]=`breaks[i]'.
> 
> which sounds like what I want but there is no info on how to get this sort
> of histogram.

freq=TRUE should do it. If you look in the code, you'll see

            intensities <- counts/(n * h)

and that is what is getting used if freq=TRUE. The help text would
seem to be imprecise, though...

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list