Comparing different conditions on a binomial distribution I have some data where I have tested a binomial random variable under 4 conditions. The null hypothesis is that they all have equal means, alternative hypothesis is that one or more means differ from the others.
What kind of test can I use to compare the means of each condition? Sample size for each condition is quite small (under 20), but if it is necessary, then I can get more.
The data look like:
$$\begin{array}{c|cccc}\rm{Condition}&A&B&C&D\\\hline\rm{Successes}&9&8&4&12\\\rm{Fails}&4&4&3&7\end{array}$$
 A: Overall you have 33 successes and 18 failures.  So if the means are the same, you would expect the numbers of successes in each case to be close to $\frac{33}{51}$ of the attempts in each case, respectively 13, 12, 7, and 19, so giving the numbers    
 8.412    4.588
 7.765    4.235
 4.529    2.471
12.294    6.706

These are very close to what you have observed: the biggest difference is below $0.6$, which is very small given that your observations are integers.  So any reasonable hypothesis test will not reject the null hypothesis of the means being the same.
More generally, you are looking at a contingency table. So you might want to consider something like a chi-squared test (though some cells are small) or a Fisher exact test.
Added: some simple R code
> dat <- rbind(c(9,4),c(8,4),c(4,3),c(12,7))
> dat
     [,1] [,2]
[1,]    9    4
[2,]    8    4
[3,]    4    3
[4,]   12    7
> chisq.test(dat)

        Pearson's Chi-squared test

data:  dat 
X-squared = 0.332, df = 3, p-value = 0.9539

Warning message:
In chisq.test(dat) : Chi-squared approximation may be incorrect
> fisher.test(dat)

        Fisher's Exact Test for Count Data

data:  dat 
p-value = 0.9758
alternative hypothesis: two.sided 
> dat-outer(rowSums(dat),colSums(dat),"*")/sum(dat)
           [,1]       [,2]
[1,]  0.5882353 -0.5882353
[2,]  0.2352941 -0.2352941
[3,] -0.5294118  0.5294118
[4,] -0.2941176  0.2941176

A: Here's R code for testing this with Fisher's exact test (set B lower on slow computers):
fisher.test(matrix(c(9,8,4,12,4,4,3,7),byrow=T,nrow=2,ncol=4),simulate.p.value=T,B=10000000)

Like @Henry suggested, very weak evidence against the null: $p=.98$.
You may wish to consider some controversy about Fisher's exact test, but I don't think they apply here.
