Equivalent of two one-sided t-tests for binomial test? I want to verify that the phenomenon I am observing is generated by a Binomial distribution with $p \approx 0.5$. The normal Binomial test verifies the opposite: a small p-value gives me confidence that the parameter p is NOT 0.5.
I thought I could verify that $0.5-\delta < p < 0.5+\delta$ using the trick of the "two one-sided t-tests", which tests that the mean of a process is within an interval $[l_1,l_2]$ by testing that it is not smaller than $l_1$ and that it is not larger than $l_2$.
My questions then are:


*

*Is my approach sensible?

*How do I aggregate the two p-values to obtain an overall p-value? I see statsmodels's ttost_ind takes the maximum of the two p-values: can I do the same?

*What works can I cite to back the correctness of this method if I publish my research?


Bonus question: Can you give me the exact lines to implement this using SciPy's scipy.stats.binom_test?
 A: Your approach is about as sensible as doing the same with another statistical distribution. There are some problems that need to be addressed.
Regarding p-values, if you allocate half of your $\alpha$ level to each one sided test you should be on the safe side. That's a Bonferroni correction for multiple testing. Other methods like a Holm correction are less conservative, have more statistical power. It is a little more tedious to implement but should be possible as well.
Your test will also be more conservative than the $\alpha$ level indicates since the binomial distribution is discrete. Suppose you allocate 2.5% $\alpha$ per one sided test. It may be that the largest p-value attainable with your binomial distribution that lies beneath 2.5% is infact considerably lower than 2.5%, perhaps 1.8%. In this case you would be testing at a more stringent significance level than your nominal $\alpha$ suggests. This effect is larger with smaller sample sizes since then the jumps are bigger
The most important problem is the $\delta$ term that you need to use. It is not possible to do equivalence testing without such a term, but you need to motivate it well. This term gives you a researcher degree of freedom that will make the reviewer suspicious. To be frank, you could always post-hoc increase $\delta$ so that the two one sided null hypothese get rejected and you prove your equivalence. It would be very difficult for the reviewer to know if you fixed $\delta$ before seeing the data, hence the suspicion. You need to determine your $\delta$ in a principled way by stating that an effect of $\delta$ or more would start being practically relevant (as opposed to statistically significant) and ideally have a citation for that value.
A: Well, the problem is, you are trying to use hypothesis testing for something it can't really do, which is claiming that a certain (even approximate) value GAVE rise to something you observed. 
What in my opinion would work as a heuristic is that you take your lower ($0.5 - \delta$) and upper bound($0.5 + \delta$) and calculate the probabilities of observing the result that you have - for the lower bound you could do a right-tailed test, for the upper bound you could take a left-tailed test. 
Scipy should be (but I'm not 100% about that, I don't use SciPy so can't test):
scipy.stats.binom.pdf(your_test_result, n, 1/2 - delta) * 2
(1 - scipy.stats.binom.pdf(your_test_result, n, 1/2 + delta)) * 2
This would give you two probabilities that would upper bound the probability of your observation for all "truthes" outside of your specified range (edit: I'm assuming here that your observation is within your specified range). But I would like to stress that this would not allow you to infer a probability for the truth being in your specified interval, since ultimately this requires a model/assumption on the true value of p.
To really answer a question like this, you would need Bayesian Methods (which gives you ways to model the prior distribution of p you need to actually quantify interval probabilities) - If it's important that you get this right, maybe switching to Bayesian is the way? In that case you might search for "Bayesian credible intervals"
