Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Binomial test in Java

I'm looking for an efficient Java library (or even a function) to perform the infamous Exact Binomial Test. Something similar to the R function "binom.test" described here.

Can you help me? Thanks a lot! :-)

like image 935
Federico Giorgi Avatar asked Jun 06 '12 07:06

Federico Giorgi


People also ask

How do you test binomial data?

To hypothesis test with the binomial distribution, we must calculate the probability, p , of the observed event and any more extreme event happening. We compare this to the level of significance α . If p>α then we do not reject the null hypothesis. If p<α we accept the alternative hypothesis.

What is a binomial test used for?

A binomial test uses sample data to determine if the population proportion of one level in a binary (or dichotomous) variable equals a specific claimed value.

What is a binomial distribution test?

The Binomial test procedure compares the observed frequencies of the two categories of a dichotomous variable to the frequencies that are expected under a binomial distribution with a specified probability parameter. By default, the probability parameter for both groups is 0.5.

Is binomial test the same as Z test?

We can always use a 2-sided z-test. However, a binomial test is always 1-sided unless P0 = 0.5. A z-test allows us to compute a confidence interval for our sample proportion.


2 Answers

In addition to the BinomialDistribution Apache commons.math3 3.3 (unreleased at the moment of writing) has a BinomialTest that will get you the p-value as well as BinomialConfidenceInterval. It's not much compared to the stats R package you named, but it's more than just the distribution mentioned above.

Posting this as I landed on your question looking for a way to get just the p val for a known binomial distribution and the link above is the answer.

like image 120
ilinca Avatar answered Sep 21 '22 22:09

ilinca


Maybe you should check http://sourceforge.net/projects/parallelcolt/ This package and apache Math are the most common for statistical computation

like image 33
Andrey Avatar answered Sep 19 '22 22:09

Andrey