1

I want to calculate the overlap of two binomial distributions A and B (e.g.

  • A with 100 trials and a probability of success with 0.7
  • B with 100 trials and a probability of success with 0.6.)

I think I can empirically get the value (see 2. picture) by simulating values and calculating the "Common Language Effect Size" (how many points of B are bigger than A). Since the overlap only depends on the probability of success and the number of trials, it feels like there should be a direct solution without simulating it first.

Is there a direct way to get to this value in R?

enter image description here.

1
  • Does this help? You may also be more likely to get an answer on stackexchange.com, since stackoverflow is a programming site. I will suggest migration... Commented Oct 28, 2021 at 9:59

1 Answer 1

2

Get the probability density of the 0.6 binomial for each possible outcome that it can be larger (1 through 100) and multiply it by the CDF of the 0.7 binomial for the same outcome minus one, then sum all the products:

> sum(pbinom(0:99, 100, 0.7)*dbinom(1:100, 100, 0.6)) [1] 0.05896353 

Check the answer against a simulation:

> mean(rbinom(1e6, 100, 0.6) > rbinom(1e6, 100, 0.7)) [1] 0.058982 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.