Ana Kolar
2011-Jul-17 18:03 UTC
[R] How to estimate overlapping area of two distributions?
Hi there dear R users, By using the code below that plots two distributions and calculates a bootstrap hypothesis test of equality, similarity of these two distributions was calculated. What I'm interested now is to find out a size of the area where both distributions are overlapping. I know that mathematically this should be done with integrals but have no idea how to do it the most efficiently with R. Any help will be greatly appreciated! Best regards, Ana library(sm) data <- rnorm(40,0,1)#provides data rang <- sample(1:2,40, replace=TRUE,prob=c(.3,.7))#provides how data should be separated (1 - distribution one and 2 - distribution two) sm.density.compare(data,rang,model="equal", nboots=1000) [[alternative HTML version deleted]]