I am comparing two diff treatments:

H0: p_t1 = p_t2
Ha: p_t1 ≠ p_t2

Treatment 1: 47030 trials, 5390 worked Treatment 2: 340 trials, 11 worked

from scipy import stats
import numpy as np
trials = np.array([[47030, 5390], [340, 11]])

p-value from above is close to zero so null hyp is rejected. What changes I need to do in my approach to say one treatment is better than other? here I have only tested that they aren't equally effective.....any leads?

  • $\begingroup$ Well, check what the actual proportions are, if your treatment has a higher proportion of successes and you tested that these two proportions are not equal, then... that's it. $\endgroup$ Mar 29, 2022 at 7:18

1 Answer 1


I think, you made a mistake there:

Treatment 1: 47030 trials, 5390 worked

That means that 47030 - 5390 = 41640 did not work. For the contingency table, you need the number of "worked" and the number of "did not work", not the number of trials.

The same is true for [340, 11] which should be [329, 11].

It will not change the $p$-value a lot in this case, but still.

Once statistical significance is established you can just compare 5390/47030 with 11/340 to see, which one was larger in the sample. The statistical significance then allows you to generalize from the sample to the population.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.