[R] hist and normal curve

Douglas Bates bates at stat.wisc.edu
Mon Oct 15 19:52:27 CEST 2001


Erin Hodgess <hodgess at uhddx01.dt.uh.edu> writes:

> I would like to superimpose a normal curve on a histogram.
> 
> I've seen this example in a book, somewhere.
> 
> I know that you draw the hist, get the mean and sd
> of the data set, but then I'm stuck.

There is an example of overlaying a density estimate on a histogram in 

library(Devore5)
example(xmp01.01)

You can modify that to use the dnorm function instead of the density
estimate.  The important thing to remember is to use prob = TRUE in
the histogram.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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