Generalizing the binomial model for testing binary data