[R] Area of density
murdoch at stats.uwo.ca
Sat Sep 6 00:39:42 CEST 2008
On 05/09/2008 4:32 PM, pragmatic wrote:
> 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).
More information about the R-help