On 09/11/2013 08:37 PM, email@thorstenschaefer.de wrote:
> We have a sample which comes from a binomial process with unknown probability. Is it
possible to get the likelihood of the population is larger than a userspecified value (with
e.g. 95% certainty) in commonsmath?
> For example, given we have two samples:
> S1: we have 4 out of 5 successes
> S2: we have 80 out of 100 successes
>
> I would like to know the probability that the real mean is larger than 60% given one
of the samples above. Is there an easy way to calculate it?
Hi Thorsten,
there is not yet a binomial test available (would be a nice addition),
but you can calculate the requested values with the binomial distribution:
// create a binomial distribution with null hypothesis of p=0.6
BinomialDistribution s1 = new BinomialDistribution(5, 0.6);
System.out.println(1  s1.cumulativeProbability(41));
// = 0.3369 > 0.05 significance level
// thus null hypothesis can not be rejected
BinomialDistribution s2 = new BinomialDistribution(100, 0.6);
System.out.println(1  s2.cumulativeProbability(801));
// = 1.64e5 < 0.05 significance level
// thus null hypothesis can be rejected
// the observed probability must be larger
Note: the  1 is used to get the same results as with R binom.test
see also
http://stats.stackexchange.com/questions/44125/isthereanerrorintheonesidedbinomialtestinr
Best regards,
Thomas

To unsubscribe, email: userunsubscribe@commons.apache.org
For additional commands, email: userhelp@commons.apache.org
