The function builds a logistic (mixed) regression and applies a Wald test to compare the estimated value of the intercept to its theoretical value under H0. Eventual overdispersion is taken into account, by using a quasi-binomial law in case of no blocks or by introducing an individual-level random factor if blocks are present.
If the response is a 0/1 vector, the probability of the '1' group is tested. With other vectors, the response is transformed into a factor and the probability of the second level is tested.
If the response is a two-column matrix, the probability of the left column is tested.
If the reponse is a vector and no blocking factor is present, the exact binomial test performed by binom.test
should be preferred since it is an exact test, whereas the Wald test is an approximate test.