From p.dalgaard@biostat.ku.dk  Fri Jan 23 15:15:16 1998
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 23 Jan 1998 16:15:16 +0100
Subject: hist: rel.freqs
In-Reply-To: Philippe Lambert's message of Fri, 23 Jan 1998 14:53:10 +0100
References: <34C8A0C6.11E8BEBE@ulg.ac.be>
Message-ID: <x2btx32pdn.fsf@blueberry.kubism.ku.dk>

Philippe Lambert <plambert@ulg.ac.be> writes:

> 
> In R0.61,
> 
> In hist(), should the line
>   rel.freqs <- counts/(sum(x) * diff(breaks))
> computing the relative frequencies or height of the rectangles 
> in a histogram not be
>   rel.freqs <- counts/(sum(counts) * diff(breaks))
> instead, or do I misunderstand something?

Oops. You're right. Total area should be 1, not mean(x). Current code
mus give funny results if the mean is negative...

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

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


hist: rel.freqs
Peter Dalgaard BSA