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?