[R] Question about density()

From: Dan Bolser <dmb_at_mrc-dunn.cam.ac.uk>
Date: Fri 04 Mar 2005 - 12:48:34 EST

If I integrate over the result of the density() funcion, is the result 1?

For example

x <- rnorm(1000)

Does the area under the curve I see sum to 1?

What I really want to know is if I can directly compare two particular curves, generated like this

x <- rnorm(1000)

a.seq <- seq(min(x),max(x),0.01)

I guess they are directly comparable if the area under density sums to one.

Is this correct?

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Mar 04 12:55:49 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:40 EST