Area of density
On 05/09/2008 4:32 PM, pragmatic wrote:
Hello! Please, anybody help me. Can I calculate area of density was created by:
D <- density(x)
In other words I want to know area under curve 'plot(D)'
That should be 1.
and It's good to calculate area before and after 0 separately.
That's harder, but a good approximation should be sum(x < 0)/length(x) and sum(x > 0)/length(x). Duncan Murdoch