0

This should be trivial. But when I evaluate the p-value for 4 observations in 5 binomial trials for a one sided test/hypothesis H0: p<=0.8, H_a: p>0.8

In scipy notation:

stats.binom_test(x=4, n=5, p=0.8, alternative='greater')

I get p-value = 0.73. I would have assumed that under H0, with 4 observations the largest p in the hypothesized range i.e. p=0.8 is the relevant one.

Furthermore, at p=0.8 for 5 trials, the outcome of 4 observations is the most likely one. Hence, the p-value should be 1, shouldn't it? Where am I wrong?

bebissig
  • 73
  • 1
  • 6
  • Could you explain why "p=0.8 is the relevant one" might depend on how many successes appeared in the five trials? One concern is whether your $H_0$ was developed *as a response* to observing $0.8=4/5$ successes or whether it was formulated independently of the data. The former produces a meaningless test. – whuber Feb 13 '20 at 15:48
  • Your second issue first: 0.8 is not related with the observation. It is fixed "externally". First issue: I understand the $H_0: p\leq0.8$ as follows: Within all $p$ allowed by the hypothesis, the relevant p-value for the observation ist the largest one. This I thought I find it with $p=0.8$, as 4 is the most likely observation in 5 trials with $p=0.8$ and hence the p-value should be 1? – bebissig Feb 13 '20 at 15:58
  • The p-value will be computed as the chance (according to $H_0$) of observing either a $4$ or a $5.$ If that's not clear, then please consult our threads on p-values, such as https://stats.stackexchange.com/questions/31. – whuber Feb 13 '20 at 17:12
  • I probably don't follow the question, but if you conduct a two-sided test, the p-value will be 1. If you sum the p-value from the 'greater' test and 1 - the p-value of the 'less' test, the result will be approximately 1. (Assuming x/n=p in the test). – Sal Mangiafico Feb 14 '20 at 11:32

0 Answers0